A Reference Architecture for Component Based Development
Keywords: Architectural layering, OO design, component based design, UML, packages, re-use.
Mark Collins-Cope
Hubert Matthews

PDF version



1. Abstract

This paper proposes a reference architecture for object-oriented/component based systems consisting of five layers. Our purpose is to show how this model helps us to understand the overall structure of a system, how layering helps to clarify our thoughts, and how it encourages the separation of concerns such as the technical v. the problem domain, policy v. mechanism, and the buy-or-build decision.

Assuming an application is made up of a number of components, the layering we propose is based on how specific to the particular requirements of an application each component is. More specific (and therefore less reusable) components are placed in the higher layers, and the more general, reusable components are in the lower layers. Since general non-application components are less likely to change than application specific ones, this leads to a stable system as all dependencies are downward in the direction of stability, and so changes tend not to propagate across the system as a whole.

As well as presenting the reference model, this paper also discusses and clarifies in concrete terms the meaning of one architectural layer being above another. Perhaps surprisingly, our background research has shown that the meaning of the layering metaphor is the subject of some confusion. Specific examples of this are given in the paper.

The model presented contains five layers, which are as follows: the interface layer; the application layer; the domain layer; the infrastructure layer; and the platform layer.

2. Introduction

Architectural layering is a visual metaphor whereby the software that makes up a system is divided into bands (layers) in an architectural diagram. Many such diagrams have been used, and by way of introduction we show two of these.

figure1

Figure 1 – Layered architecture – Example from Szyperski

Szyperski [Szperski98] presents a view of a strictly layered architecture as can be seen in figure 1. Note that this model has the device drivers below the operating system - a topic we will return to discuss later in this paper.

Figure 2 shows a type of ad-hoc architecture diagram [Carlson99] that is not uncommon in modern technical documentation. The example shown describes the architecture of the IBM San Fransisco product.

figure2

Figure 2 - Typical 'ad-hoc' architectural layering diagram

Some common themes run through these diagrams:

Turning to UML class diagrams (a younger notation), we notice that common convention usually place subclasses, which are more specialised, below their parents, which are more general purpose. This convention is the exact opposite of the architectural convention highest is most specific, and the cause of a undoubtedly confusing visual metaphor mismatch which we discuss further in our article The Topsy Turvy World of UML [Collins-Cope+00].

figure3

Figure 3 - Class diagrams and architectural views

This paper takes a revised look at application layering, with a particular focus on clarifying the unstated assumptions in such diagrams, and proposes a five layer architectural reference model for component based OO applications that can be used to assist in the design of component based systems.

3. Proposed model

3.1. Motivation

The objectives behind the architectural reference model presented in this paper are as follows:

We come back to these motivations in the conclusions section of this paper.

3.2. Reference model

We define the architecture of a system as the structural relationship between the individual components that together create an application as a whole1. We define a component as an (object-oriented) software development deliverable implementing a well defined interface that is released at the binary (or equivalent) level , which may have a number of well-defined extension points to enable it to be customised2.

Examples of components conforming to this definition3 might include '.o' or '.a' files on a Unix system, '.obj', '.dll' or '.ocx' files on a Windows based system. Components developed within a COM or EJB type environment are, of course, equally within this definition . Note, however, that in most of the following discussion we consider the design view of components, which we represent as packages in UML notation.

Figure 4 shows our proposed reference model. Figure 5 shows the same model populated with a number of classes, components and relationships between them, taken from an example banking application. Two external actors [Jacobson+94] interact with the system: a bank clerk (using a debit dialog box), and an external banking system (using an intermediate file format).



figure4

Figure 4 - Layered architecture reference model





figure5

Figure 5 - Layered architecture populated with an example



The layers presented in this model may be summarised as follows:

3.3. Associated rules

Some simple rules are associated with this model:

3.4. Layering Semantics

Most layering diagrams omit to discuss the meaning of one layer appearing on top of another, or any description of the axis of the diagram. Earlier reviews of this paper, and the example shown in figure 1 have lead us to believe some further discussion of these aspects of the layering model presented here is desirable:

figure6

Figure 6 – Szyperski’s example using our layering rules


Summarising, the layering semantics presented here tie together the concept of the specificity of a component (how much detail is filled in, how specific it is) with the notion of compile time dependencies. The higher a component in the model, the more specific it is likely to be, and the more dependent it is likely to be on other components, and vice versa.

3.5. Further notes

A number of additional points are worthy of brief discussion:

the net result being that the higher layers are deployed in one particular machines/process, and that the lower two layers are often present on multiple processes/machines.

4. How the layering helps us understand design

To see how layers and particularly our visual metaphor help us, let’s examine the Adapter pattern from the Gang of Four’s book [Gamma+95].

Figure 7 shows an adapter being used to allow two components with incompatible interfaces to be used together (a common problem in component design). The billing adapter implements the Account component’s outward billing interface and passes on any messages to the credit card billing component’s inward billing interface, with possibly modified parameters. Since both of the components are reusable and not specific to this application they belong in the domain layer. The adapter, on the other hand, is very specific to this particular configuration and so it is not in general reusable and so belongs in the application layer instead – it is acting as application-level “glue” for the other components. Note here that the two component dependencies point downwards – one being caused by an inheritance relationship, the other by a directed association.


figure7

Figure 7 - Getting an account paid by credit card


For a second example, we show in figure 8 one of the refactoring patterns from Martin Fowler’s book [Fowler+99]: Separate Domain from Presentation.


figure8

Figure 8 - Separate Domain from Presentation


Here we see a GUI dialog class containing business logic being split into two. Our architectural overlays add context to this, showing that in doing so what was previously an interface layer component has now been split into two components: one still in the interface layer, and one in the application specific (or possibly domain) layer. The refactoring visibly lowers the centre of gravity of the application. Two more benefits are that we have separated the usage of the Order component from its implementation (in other words we have separated policy from mechanism), and that we have separated the technology-free Order component from the inherently technology-based OrderWindow, thereby giving us more portable code and allowing us more freedom in deployment (for example in a three-tier system).


figure9

Figure 9 - Push Down Method (reworked by us as Pull Up Method!)


In figure 9, Fowler shows us an inheritance hierarchy with an inappropriately placed method, which is effectively polluting the component which contains it by forcing it up to an inappropriate level. The refactored version shows the component being split into two (over two levels), the method having being moved out the Employee class and into the Salesman class. This enables the Employee component to reside at a more general level in the hierarchy, and again visibly lowers the centre of gravity of the application.

5. Broader issues

6. A brief philosophical aside

Many classification systems are blurred around the edges, and our layer classification is no exception. In his excellent book Darwin's Dangerous Idea [Dennet96] Dennet describes how examining the characteristics of a particular species of gull, starting in Britain and moving west to east around the globe, yields a set of gradually evolving changes until, as the loop closes and the examiner returns to Britain, a different species of gull is finally found next to the original! Species clearly have blurred edges, so we’re in good company

7. Compromises

The model presented here is not perfect, but a compromise between simplicity and meeting the stated set of objectives. Some potential shortcomings of the model are as follows:

8. Conclusions

Summarising, in this paper we have proposed a simple five layered reference model and a number of associated rules to assist the software designer. We have noted that, by convention, UML class diagrams are upside down, at least when considered in parallel with architectural layering conventions, and that this is a block to visualising one aspect of what happens during refactoring. We have shown that once this is addressed, UML and the architectural model complement and re-enforce each other.

We have identified examples from Gamma et al’s Design Patterns book, and Fowler's refactoring book that show the reference model adds context to well known design (and refactoring) paradigms.

We have discussed how the model supports good OO design principles, in particular those concerned with ensuring stable dependency management, and have emphasised and clarified the rules on which our layering model is based (specificity/generality and compile time dependency).

Coming back to the objectives detailed in section 3.1, we believe the architectural reference model presented here:

9. References and credits

[Szperski98] Clemens Szyperski, Component Software: Beyond Object-Oriented Programming, January, Addison Wesley Longman, 1998.
[Carlson99] Brent Carlson, Design Patterns for Business Applications, the IBM SanFransisco Approach, ObjectiveView Issue 3, available at http://www.ratio.co.uk/objectiveview.html , 1999.
[Collins-Cope+00] The Topsy Turvy World of UML, Hubert Matthews and Mark Colllins-Cope, ObjectiveView Issue 4, available at http://www.ratio.co.uk/objectiveview.html, 2000.
[Jacobson+94] Ivar Jacobson, Magnus Christerson, Partrik Jonsson, Gunnar Övergaard, Object Oriented Software Engineering - A Use Case Driven Approach, Addison-Wesley, 1994.
[Gamma+95] Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, Design Patterns - Elements of Reusable Object-Oriented Software, Addison-Wesley, 1995.
[Fowler98] Martin Fowler, Analysis Patterns - Reusable Object Models, Addison Wesley, 1998.
[Jacobson+97] Ivar Jacobson, Martin Griss, Patrik Johsson, Software Reuse - Architecture, Process and Organization for Business Success, Addison Wesley Longman, 1997.
[Meyer97] Bertrand Meyer, Object Oriented Software Engineering (second edition) - Prentice Hall Professional Technical Reference, Published 1997.
[Martin96] Robert C. Martin, The Open Closed Principle, C++ Report, Jan 1996.
[Fowler+99] Martin Fowler with contributions from Kent Beck, John Brant, William Opdyke, and Don Roberts, Refactoring - Improving the Design of Existing Code, Addison Wesley, 1999.
[Martin97] Robert C. Martin, Stability, C++ Report, Feb 1997.
[Gamma+95] Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, Design Patterns - Elements of Reusable Object-Oriented Software, Addison-Wesley, 1995.
[Dennet96] Daniel C. Dennet, Darwin's Dangerous Idea: Evolution and the Meanings of Life, Touchstone Books, 1996.

Particular thanks are due to Andy Vautier, Nigel Barnes and Keith Haviland of Andersen Consulting, upon whose 1 million line+ C++ project many of the underlying concepts presented in this paper were formulated. Further detailed technical discussion this project can be found at http://www.ratio.co.uk/techlibrary.html.