Software Architecture Design ( PDFDrive )
Software Architecture Design ( PDFDrive )
Dr Fritz Solms
fritz@solms.co.za
http://www.solms.co.za
2 Structural patterns 23
2.1 What are structural patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Why use structural patterns? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3 Layering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3.1 Uses of the layering pattern . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3.2 Advantages and disadvantages of layering . . . . . . . . . . . . . . . . . . 25
2.4 Microkernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.4.1 Uses of the microkernel pattern . . . . . . . . . . . . . . . . . . . . . . . . 26
2.4.2 Benefits and challenges of the microkernel pattern . . . . . . . . . . . . . 26
2.5 Blackboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5.1 Uses of the blackboard pattern . . . . . . . . . . . . . . . . . . . . . . . . 28
2.5.2 Benefits and concerns around the blackboard pattern . . . . . . . . . . . . 28
2.6 Master-Slave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6.1 Uses of the master-slave pattern . . . . . . . . . . . . . . . . . . . . . . . 30
2.6.2 Benefits and concerns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.7 Hierarchical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.7.1 Uses of the hierarchical pattern . . . . . . . . . . . . . . . . . . . . . . . . 31
3
4 CONTENTS
3 Architectural tactics 37
3.1 What is an architectural tactic? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2 Why use architectural tacitcs? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.3 Some examples of architectural decisions . . . . . . . . . . . . . . . . . . . . . . . 38
3.4 Scalability and Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.5 Reliability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.6 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.7 Modifiability and extensibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.8 Accessibility and integrability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.9 Tactics and quality attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.10 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4 Integration architecture 47
4.1 Integration challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.1.1 Accessibility challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.1.2 Infreastructure constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.1.3 Providing quality attributes across integration channels . . . . . . . . . . 48
4.1.4 Lack of contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.1.5 Integration complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2 Integration concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
4.2.1 Component or service publication . . . . . . . . . . . . . . . . . . . . . . . 48
4.2.2 Communication protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2.3 Integration approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.2.4 Integration mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.3 Integration patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.3.1 Messaging benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3.2 Why . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3.3 Message channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.3.4 Message construction patterns . . . . . . . . . . . . . . . . . . . . . . . . 55
4.3.5 Routing patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
4.3.6 Transformation patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.3.7 End-point patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4.3.8 System management patterns . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.4 Best practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
4.4.1 Some general best practices around integration . . . . . . . . . . . . . . . 74
4.4.2 Best practices for request-based integration . . . . . . . . . . . . . . . . . 74
4.4.3 Best practices for document-based integration . . . . . . . . . . . . . . . . 74
4.4.4 Best practices for integration infrastructure . . . . . . . . . . . . . . . . . 75
4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
CONTENTS 5
5 Reference architectures 77
5.1 What is a reference architecture and a framework . . . . . . . . . . . . . . . . . . 77
5.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5.3 Benefits and risks of using reference architectures . . . . . . . . . . . . . . . . . . 78
5.4 CORBA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.4.1 What is CORBA? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.4.2 Overview of CORBA reference architecture . . . . . . . . . . . . . . . . . 79
5.4.3 The CORBA object model . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.5 Java-EE Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.5.1 Java-EE: first level of granularity . . . . . . . . . . . . . . . . . . . . . . . 79
5.5.2 What does the EJB container provider? . . . . . . . . . . . . . . . . . . . 82
5.5.3 Enterprise beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
5.5.4 Entity objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.6 Services-Oriented Architectures (SOA) . . . . . . . . . . . . . . . . . . . . . . . . 88
5.6.1 What is a services oriented architecture? . . . . . . . . . . . . . . . . . . . 89
5.6.2 Aims of Services-Oriented Architectures . . . . . . . . . . . . . . . . . . . 89
5.6.3 Overview of the SOA reference architecture . . . . . . . . . . . . . . . . . 89
5.6.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
5.6.5 SOA standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.6.6 Application concepts and constraints introduced by SOA . . . . . . . . . 92
5.6.7 Levels of SOA use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.6.8 SOA quality attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.7 Space-Based Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.7.1 Aims of SBA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.7.2 Overview of SBA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.7.3 SBA principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.7.4 Elements of a SBA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.7.5 Operations on space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.7.6 Objects, classes and notification . . . . . . . . . . . . . . . . . . . . . . . 95
5.7.7 An example process in a SBA . . . . . . . . . . . . . . . . . . . . . . . . . 96
5.7.8 Quality attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5.7.9 SBA frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
5.8 The AUTOSAR reference architecture . . . . . . . . . . . . . . . . . . . . . . . . 97
5.8.1 Requirements which AUTOSAR was meant to implement . . . . . . . . . 98
5.8.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.8.3 Structural patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
5.8.4 Architectural tactics specified by AUTOSAR . . . . . . . . . . . . . . . . 101
5.8.5 Integration patterns specified by AUTOSAR . . . . . . . . . . . . . . . . 103
5.8.6 Concepts and constraints for application components . . . . . . . . . . . . 103
5.8.7 Trade-off decisions made in AUTOSAR . . . . . . . . . . . . . . . . . . . 104
5.9 Cloud based architectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.9.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5.9.2 Types of cloud services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Introduction to software
architecture
9
10 CHAPTER 1. INTRODUCTION TO SOFTWARE ARCHITECTURE
1. What are the architectural components (infrastructural software components) and what
are their responsibilities?
6. Does the software architecture support pluggability, to what extend and how?
11. How is maintainability supported. Can the system support life maintenance, and if so,
how?
If you get five architects together and ask each for a definition of software architec-
ture, you’ll get seven different definitions.. This is exemplified by the list of definitions
for software architecture maintained by the Software Engineering Institute at Car-
nagie Mellon which lists over 300 different definitions. Note that we do not have
such a problem in other domains like the definition of buildings architecture, quality
assurance and so on.
1.4. WHAT IS SOFTWARE ARCHITECTURE? 11
The different definitions of software architecture largely share only one commonal-
ity — that an architectural description must specify components and connectors.
However, there is no consensus on
The choice of definition for software architecture has very wide repercussions. It
affects
• how the responsibilities and skills requirements for software architects, how a
software architecture needs
• the contents of the architecture requirements specification,
• how we design an architecture,
• how we document it, and
• how we evaluate/validate it.
Scanning the many definitions of software architecture one can identify three major
classes:
1. Software Architecture is the high-level abstraction of software system.
This approach has been advocated by prominent practitioners and researchers
like Martin Fowler and Manfred Nagl.
2. The software architecture is the structure and externally visible prop-
erties of the software system.
• IEEE-1471:2000, Bass-Clements-Katzman (SEI), . . .
• Perhaps definition which is currently most widely used.
3. Fundamental concepts & constraints within which software system is
designed & developed
12 CHAPTER 1. INTRODUCTION TO SOFTWARE ARCHITECTURE
• Logical View which specifies the functionality provided to the end user using
class, component and sequence diagrams.
• Development View which depicts the modularization of the system using package
and component diagrams.
• Process View which is used to specify the system processes via activity diagrams.
• Physical View used to specify the physical deployment of system components
and the physical connections between them using deployment diagrams.
• Use Case Views showing representative use cases and scenarios using use case
and sequence diagrams.
The first version of the IEEE specification for the requirements of an architectural
description, IEEE-1471, defined software architecture as follows:
This definition does not focus on application functionality. Instead the main focus is
on the structure, i.e. the components and the relationships between them, and the
properties which are generally regarded the quality attributes of the system. But is
1.4. WHAT IS SOFTWARE ARCHITECTURE? 13
architecture the properties or should it rather include the specification of the tactics
which are used to realize those properties?
This class of definitions does not really allow for the specification of levels of granular-
ity for the software architecture. There is also still no still no clear guideline on how
to determine the boundary between architecture and application design, though such
a separation is not explicitly excluded by the definition. Once again, how do we know
whether a component is an architectural component or an application component?
The imaturity of the field and the uncertainty around the concept of software archi-
tecture are exemplified by the IEEE changing its definition of software architecture
in its 2011 version of the IEEE specification for the requirements of an architectural
description. ISO/IEC 42010:2011. The new definition reads now as follows:
This definition is a lot more abstract and does allow for the view fundamental concepts
and constraints as the concepts and constraints within which application functionality
is to be developed within that software architecture. For example. a services-oriented
architecture introduces the concept of a service with constraints that services must
be stateless, discoverable and published as WSDL contracts. The definition does not,
however, refer to strategies or tactics used in the software architecture to address
quality requirements.
One can argue that reference architectures are specifications of pure architecture.
They do not contain any specification of application functionality. For example,
Java-EE does not contain any aspects which is specific to banking, retail or insurance
systems. Similarly AUTOSAR does not contain any elements for motor or brake con-
trol. However, we can deploy banking, retail or insurance applications into Java-EE
and software systems monitoring and controlling brakes or engines into AUTOSAR.
The reference architecture does not provide any application functionality, but it does
provide an infrastructure addressing architectural concerns and within which the
non-functional requirements can be realized.
One can thus argue that one can reverse engineer a reference architecture to obtain
a definition of architecture itself and that we even have implementations of “pure
architectures” — the implementing frameworks or reference architectures.
Figure 1.1 provides an overview of the Java-EE reference architecture and its core
components.
The component for the first level of granularity is the application server itself. Its
core responsibilities include Component = Application server
1. providing access to users (human and system users),
2. providing an infrastructure for processing business logic, and
3. providing an infrastructure for integrating with backend service providers like
persistence providers and systems providing lower level services.
These high level responsibilities are assigned to next level granularity components.
In the case of Java-EE these are the web container, EJB (Enterprise Java Beans)
container, JPA (Java Persistence API) persistence context.
The reference architecture is designed to address the quality requirements for typical
enterprise systems. These include reliability, scalability, security, integrability and
flexibility.
Structural patterns are used to constrain the infrastructure between components.
Java-EE uses the layering pattern with the second level granularity components or-
ganized in layers (one layer can only access the next lower layer).
Java-EE also specifies a range of architectural tactics to address the quality require-
ments of typical enterprise systems. It specifies, at this first level of granularity tactics
like clustering and interception to increase scalability, reliability and flexibility.
Note that the first level granularity component, the application server as a whole, does
not host any application components. These are hosted by the lower level components
like the EJB container and the Web container.
The second level of granularity components are the web and EJB containers and the
JPA provider. The infrastructure of these is again based on architectural patterns,
for example the Model-View-Controller (MVC), Controller and Layering patterns.
Further architectural tactics or strategies are used to address the quality requirements
for enterprise systems. These include caching, resource reuse and interception.
1.4. WHAT IS SOFTWARE ARCHITECTURE? 15
But these lower level architectural components do host application components. For
example, web containers host facelets, backing beans and binding beans. Similarly
the EJB container does host stateful and stateless session beans and the persistence
context hosts entities.
Figure 1.2 provides an overview of the Services Oriented reference Architecture (SOA).
1.4.3.4.1 2’nd level of granularity One of the second level granularity compo-
nents is the process execution engine. Focusing on that component for this discussion,
we not that it once again implements a number of architectural tactics or strategies
to address quality requirements. These typically include clustering, thread pooling,
interception.
The process execution engine does host application components. In SOA application
components are specified using stateless services. Higher level services are “orches-
16 CHAPTER 1. INTRODUCTION TO SOFTWARE ARCHITECTURE
trated” across lower level services using the pipes and filters pattern, i.e. the infras-
tructure between application components is thus constrained by this architectural
pattern.
A number of constraints apply to the application components specified by this refer-
ence architecture. This includes that services may not maintain state across service
requests, that they must be self-healing (a failure in processing one request should
not affect the way in which subsequent requests are processed), that they must be
discoverable, that they must be pluggable components by virtue of realizing published
contracts, and so on.
introduces concepts and constraints for application components, it does not ac-
tually provide any application components.
the user roles of an authenticated principle and that of providing a handle to the
transaction manager. From the perspective of the banking system these concerns
were architectural concerns, but from the perspective of developing an application
server, these address functional requirements of the application server.
There are also architectural requirements which need to be addressed. Examples may
be portability, providing access to system resources like threads or memory and so
on. These would be addressed by the architecture of the application server which
may include a bridge to the underlying operating system (e.g. the Java Runtime
Environment, JRE) which provides access to resources obtained from the operating
system and ensures portability across operating systems.
Figure 1.3: The bigger picture: generate code implementing application functionality as specified
in application design for architecture as specified in architecture model.
Structural patterns
2.3 Layering
In the case of the layering pattern, components organized in layers, each of which is
ultimately assigned some responsibility. The responsibilities for the individual layers
23
24 CHAPTER 2. STRUCTURAL PATTERNS
is not prescribed by the pattern but is allocated when the pattern is used within a
design.
Access Layer
Services/Processes Layer
Domain/Knowledge Layer
Infrastructure Layer
Figure 2.1: In the layered pattern components in one layer may only access components which
are either in the same or the next lower layer.
The structure prescribed by the layering pattern is shown in figure 2.1. The infras-
tructural constraint introduced by the layering pattern is that components in one
layer can only access components which are either in the same layer, or in the next
lower level layer
1. Client access layer (dealer, web pages, call center, web services layer, . . . )
2. Front-office layer (providing client-faced services)
3. Back-office layer (providing back-office services)
4. Infrastructure layer (integration with suppliers, regulatory institutions, . . . )
Also, many enterprise systems are traditionally based on the layered architectural
patternn starting with the early client-server based systems through to 3, 4 and 5
tier architectures.
Even your sound system is typically based on the layered architectural pattern with
the layers being typically the following:
Another common example of the use of layering is that of network protocols. For
example, the TCP/IP protocol has the following layers:
• having pluggable layers and being able to replace single layers (e.g. the presen-
tation layer or a backend system),
• improved cohesion through defined higher-level responsibility localization,
• complexity reduction, particularly for larger systems,
• loose high-level coupling
• improved testability through the ability to mock out lower layers,
• improved reuse of high-level components, and
• improved maintainability through the ability to have different layers developed
independently by different teams with different skills sets.
2.4 Microkernel
The microkernel pattern provides an infrastructure for flexible client faced services
on robust slowly evolving core/internal services. Benefits of the microkernel pattern
include
• improved reuse through simpler integration and because the adapters make com-
ponent accessible independent of differences in implementation technologies, in-
terfaces and communication protocols, and
• improved maintainability due to the separation of low-level services from high-
level services.
2.5 Blackboard
Assume you have a difficult mathematical problem to solve and that you have asked
each of a group of mathematicians whether they could solve it for you, but none
managed to solve it. You also do not have a process to get you to the solution. Such
a process might have involved asking one of the mathematicians whom you know can
solve sub-problem 1 followed by another who you know can solve sub-problem 2 and
so on.
So, how else can you get your problem solved? You could ask the group of mathe-
maticians to solve the problem together. You will give them a blackboard (this gives
away the age of the pattern) and let them try and auto-orchestrate a process which
solves the problem — you could use the blackboard pattern.
Figure 2.3 shows the structure of the blackboard pattern, depicting the communica-
tion links between the controller, the expert pool and the blackboard itself.
The elements of the blackboard pattern are the following:
3. A controller who is minimally involved in solving the problem itself, but who
specifies the problem or feeds problems into the blackboard, feeds experts into
the expert pool and is involved in conflict resolution between experts.
• that the pattern provides a high level of flexibility and maintainability — adding
experts who are able to perform new processing steps may immediately change
a range of auto-orchestrated processes.
2.6 Master-Slave
Figure 2.4: The master-slave pattern a master distributes work across a typically large number
of slaves often located on different nodes.
Distributing the work may require transporting the data for each slave to the slave.
Alternatively the slave can get local access to data within a distributed persistence
infrastructure like a distributed file system or distributed database.
The Master-Slave pattern often requires that on uses aggregators or other reduces to
calculate some statistical or inferred result from the large amount of data processed.
2.7 Hierarchical
The structure of the hierarchical pattern is illustrated in figure 2.5. Hierarchical is
based on a recursive containment hierarchy similar to the composite pattern. It is
also used in the context of inheritance hierarchies.
Figure 2.5: In a hierarchical structure a node can only communicate with its parent node and
its child nodes and otherwise through defined communication channels.
The pattern introduces the infrastructural constraint that nodes may only commu-
nicate with parent and child nodes and otherwise through defined communication
channels.
2.7. HIERARCHICAL 31
Note that in an organization where promotion is not carefully managed the hierar-
chical pattern may lead to individuals being promoted until they reach their personal
level of incompetence.
32 CHAPTER 2. STRUCTURAL PATTERNS
• Functional programming
• Media streaming/processing pipelines which perform a sequence of operations on
media streams including encoding and/or decoding operations, object detection,
image or sound manipulation and so on.
– decoding, object detection, image/sound manipulation, . . .
• I/O streaming
The pipes and filters pattern is widely used due to the flexibility it provides. The
main benefits of the pattern include
• Flexibility and Time-To-Market as one can easily modify a work flow by adding,
removing, or replacing filters and one can easily assemble new work flows from
the available functionality (available filters).
• Reuse and Testability due to the decoupling of processing units and even more
so if pure functions are used for the pipes.
2.9. MODEL-VIEW-CONTROLLER (MVC) 33
There are, however, also a number of concerns one needs to keep in mind when using
this pattern. These include
Aims of the MVC pattern include that the three components can evolve independently
and that the components can be deployed onto different nodes.
Figure 2.6 depicts the structure of the MVC pattern. Note that the MVC pattern
fully decouples the model from both, the view and the controller. The model is
usually observed by all views, facilitating that the views can update themselves on
model changes. Additionally, the model may also be observed by the controller to
apply control logic changes on model change events.
Figure 2.7 depicts the dynamics of the MVC pattern, showing how updating the
model through one view results in other views updating themselves.
34 CHAPTER 2. STRUCTURAL PATTERNS
However, there are also a number of concerns around the MVC pattern. In particular,
Some of the above are mitigated by introducing an adapter or a bridge between the
UI (view and controller) and the model.
2.10. PATTERNS AND QUALITY ATTRIBUTES 35
Quality Attributes
Maintainability
Deployability
Performance
Affordability
Integrability
Auditability
Reusability
Testability
Scalability
Reliability
Flexibility
Usability
Security
Tactic
Layering O M M M M M M
Pipes & filters O M M N M M M M M
Microkernel H N N N N N M O O
Blackboard H N M N N N N M O O
Comp Graph O M
Bridge O M N N N M M O O
Hierarchical M M M M O H M O O
MVC O M M N N M N M
Master-Slave M N M O O O H H
Table 2.1 depicts how the selection of structural patterns can positively or nagatively
impact on quality requirements. This table is useful to check which patterns are
better aligned with the quality requirements and which other quality attributes could
be negatively impacted or enhanced by selecting a particular structural pattern.
2.11 Exercises
1. For each structural pattern, try and find one or two examples in systems you
have been working on. Discuss
a) how the pattern is manifested in that system,
b) why the pattern was used for that system,
c) the architectural trade-offs being made by using that pattern,
d) whether you agree with the use of the pattern or whether you would suggest
an alternative pattern instead.
36 CHAPTER 2. STRUCTURAL PATTERNS
Chapter 3
Architectural tactics
Architectural tactics represent more abstract design decisions which are often ad-
dressed by more concrete design patterns which implement these architectural tactics.
The aim of these tactics is to concretely realize desired quality attributes.
37
38 CHAPTER 3. ARCHITECTURAL TACTICS
Figure 3.1: Goals for scalability and performance and some tactics commonly used to concretely
address these quality requirements.
3.5. RELIABILITY 39
3.5 Reliability
Figure 3.2: Goals for reliability and some tactics commonly used to concretely address this
quality requirements.
40 CHAPTER 3. ARCHITECTURAL TACTICS
3.6 Security
Figure 3.3: Goals for security and some tactics commonly used to concretely address this quality
requirements.
3.7. MODIFIABILITY AND EXTENSIBILITY 41
Figure 3.4: Goals for modifiability and extensibility and some tactics commonly used to con-
cretely address these quality requirements.
42 CHAPTER 3. ARCHITECTURAL TACTICS
Figure 3.5: Goals for accessibility and integrability and some tactics commonly used to concretely
address these quality requirements.
3.8. ACCESSIBILITY AND INTEGRABILITY 43
44 CHAPTER 3. ARCHITECTURAL TACTICS
Quality Attributes
Maintainability
Deployability
Performance
Affordability
Integrability
Auditability
Reusability
Testability
Scalability
Reliability
Flexibility
Usability
Security
Goal Tactic
Thread pooling M N
Resource
Caching M N O
reuse
Connection pooling M N O
Virtualization O N N M N
Queueing O M M M M M
Spread load
Scheduling O M
across time
Preprocessing M M M H M M
Spread load Grids O N N O O M O O
across Clusters O N N O H O
resources Load balancing O N N O O H O
Paging H N
Reduce com- Compression O M O O
munications Batching H N O O O
load Course grained services N N M M M M M
Dynamic code optimization N M O O
Optimization Dynamic query optimization N M O O
Database indexing N M O
Resource monitoring M O N N M O O
Fault
Checkpoint evaluation O O N N M N
detection
Deadlock detection M M N M O
Active redundancy O N O H O
Fault
Removal of faulty components O N M M
prevention
Persistent messaging O N N M M M M H O
Passive redundancy N O H O
Fault
Checkpoint rollback O N
recovery
Reset to valid state M M O
Interception points/layers O O O N M N& M M
Extensibility
Support aspects M N NN N M
tactics
Contracts based decoupling M M N M N M M M
Service/ Naming service M O M N M M O N
component Trader service O N N N N O
publication Interface/contract repository M O N M N M O
Encryption H O N O O O O
Security
Message integrity O O N N O N O
tactics
Authorization O O N M O O O O
Authentication O N N O O O
Request/connection dropping M N N
Minimize accessibility N M H M O M M
Signature scanning O O M N M
Table 3.1: Impact of different tactics on quality attributes. A solid upwards/downwards pointing
triangle represents a strong positive/negative impact on a quality attribute and an empty triangle
represents a moderate effect on the quality attribute. If a tactic has no symbol assigned for a
quality attribute, that tactic has no significant effect on that quality attribute.
3.10. EXERCISES 45
3.10 Exercises
1. Select an example system and identify the most important quality requirements
for that system. For each of these quality requirements, in order of importance,
select the architectural strategies which you suggest should be employed to re-
alize the quality requirement.
2. Consider auditability as a quality requirement and
• identify core auditabilty goals, and
• identify, for each goal, a set of strategies you can use to concretely realize
the architectural goal.
46 CHAPTER 3. ARCHITECTURAL TACTICS
Chapter 4
Integration architecture
1. Accessibility challenges
2. Infrastructural constraints
3. Quality requirement challenges
4. Integration complexity
5. High-level work-flows
47
48 CHAPTER 4. INTEGRATION ARCHITECTURE
use non-standard or proprietary technologies, or that they are simply of bad quality,
i.e. not able to support the required throughput, or reliability.
• database-based integration,
• messaging,
• service-request based integration,
• space-based integration, and
• user-interface based integration.
Definition 4.3.1. Integration patterns are proven, reusable, generic integration so-
lution components, i.e. they represent specific best practices solutions to integration
problems.
4.3. INTEGRATION PATTERNS 51
Like all patterns, integration patterns are seldom used in isolation, but instead com-
monly used in combination. The aim of any particular pattern is to address a partic-
ular concern, not a combination of concerns.
Ultimately a collection of integration patterns provides a dictionary of integration
concepts.
4.3.2 Why
Benefits of using integration patterns include
1. They provide simple, proven solution components to re-occurring problems.
2. Often, using one of the integration patterns results in a simplification of the
integration solution.
3. Making use of a catalog of integration pattern often speeds up the design process,
the process of recovering and understanding aspects of a software architecture,
and the process of assessing different integration solutions.
4. Using the standard concepts and terminology simplifies communication between
integration experts.
5. Being aware of integration challenges and best practices integration solutions
reduce risk.
6. Using integration patterns results in more standardized integration approaches
which simplifies maintainability.
In the case of point-to-point channels, each message which is sent along the channel
is consumed by only a single consumer. There may still have multiple consumers
and the pattern then provides a simple load balancing solution across the different
consumers. Note that each message is only consumed once.
The datatype channel attempts to address the following problem. When sending
different artifact types across a channel, the consumer needs to be able to identify
the data or artifact in order to know how to process it. This introduces additional
complexities and processing overheads.
The structure of the datatype channel pattern is depicted in figure 4.3. The Datatype
channel pattern requires different channel for each data/artifact type. This facilitates
streamlined processing and enables one to remove any meta-data added to the mes-
sage to identify the artifact type, as well as the logic required to identify the artifact
type.
4.3. INTEGRATION PATTERNS 53
The invalid message channel pattern aims to address the following problem. Com-
municating invalid message back to the message producer might be tricky. Ignoring
invalid messages may leave the producer under the false impression that all messages
were processed.
In the Invalid message channels pattern (see figure 4.4) the message consumer simply
dumps message onto invalid message channel. Other processes may either correct
problem and resubmit the message, communicate problem back to message sender,
make invalid messages somewhere available to sender for retrieval, or simply log for
accountability reasons. In the mean time, the consumer continues processing next
message.
The dead-letter channel pattern addresses a similar problem to the invalid message
channel pattern, except that this time the message is valid, but cannot be delivered.
The pattern structure is shown in figure 4.5. The message which could not be deliv-
ered is put onto the dead-letter channel where it can be either held for a later attempt
for redelivery, logged for auditing purposes or can be made available to the message
sender for retrieval.
The guaranteed delivery channel addresses the following problem. Integrating parties
have independent life cycles. A message which is meant for a consumer may not be
deliverable when the producer sends it, i.e. the consumer not available or busy.
The guaranteed delivery channel (see figure 4.6) maintains the message until either
the message is delivered or the consumer acknowledges completion of processing of
message. The latter has the advantage that the message will be redelivered if the
processing of the message fails.
The problem addressed by the channel adaptor pattern is the following. A provider
or consumer may need to communicate with a consumer through some channel. The
other party may not be able to use that channel. The producer does not want to
support another channel because perhaps wants to stick to some standard, or other
parties use that channel and do not want to maintain a separate channel.
The solution provided by the channel adaptor is depicted in figure 4.7. The adaptor
pulls off messages for the subscriber from the channel and feeds these messages to
the channel supported by subscriber.
The problem addressed by the message bridge pattern is the following. Assume multi-
ple messaging systems are used within an organization or system. Different messaging
4.3. INTEGRATION PATTERNS 55
systems might be based on technology preferences for certain areas. Messages pub-
lished on one messaging system may have to available to parties which is connected
to another messaging system.
In the case of the message bridge pattern (see figure 4.8, the bridge is constructed from
a range of adapters between the messaging systems. Each adapter pulls messages of
one messaging system and pushes them onto another.
The problem addressed by the message bus pattern is the following. Many systems
need to be integrated. Each system needs to know how to integrate with many other
systems. This may result in excessive complexity and maintenance costs.
The message bus (see figure 4.9) is a sophisticated message channel which decouples
message producers and consumers. It is responsible for
• providing the connectivity to message producers and message consumers,
• routing messages to appropriate message consumers,
• transforming messages to format as required by consumer, and
• supporting an adapter layer which enables one to plug in an adapter for each
system.
Any system only needs to know how to communicate with bus.
The problem addressed by this pattern is the following. A recipient receives a mes-
sage, but may not know what to do with the message. Also, one may not want to
follow a Remote Procedure Call (RPC) approach.
Figure 4.10 shows the structure of the command message pattern. The command
message itself contains not only the information/artifacts which are to be transmitted,
but also the request itself, i.e. what to do with message. Command messages are
usually applicable to point-to-point channels.
The document message pattern addresses the following problem. Assume you have
a message, but you do not know what to do with it – that is the responsibility of
the message consumer, i.e. you want to leave the decision of what to do with some
information to the message consumer.
In the case od document messages (see figure 4.11) the message contains only infor-
mation — not what to do with the information.
Document messages are commonly applicable to publish-subscribe channels.
An event is the occurrence of some thing which is in some ways significant. However
event sources should not need to know who processes the event and what they are
going to do with it.
The event message pattern (see figure 4.12) avoids tight coupling by introducing an
event channel. Events are put onto the event channel, but the process which puts
4.3. INTEGRATION PATTERNS 57
the events on the channel does not know who consumes them. The channel itself
is usually a publish subscribe channel. In such a configuration the event channel
pattern is the messaging equivalent of the observer pattern. Message consumers are
fully decoupled from message producers.
The problem addressed by the request-reply channel pattern is the following. Often
senders require a response to a message. But wants to use a messaging infrastructure
and not a synchronous communication channel. This may be because one wants the
improved decoupling, the ability for the producer to continue with other work in the
mean time or that the consumer does not want to be exposed to the the producer
still being available when the response is ready to be dispatched.
In the case of the request-reply channel pattern one constructs Have channel for
request messages, and one channel for reply messages.
The correlation identifier pattern addresses the following problem. Client sends a
number of requests related to different processes. When receiving the responses, they
need to somehow pair responses up with the original requests.
In the case of the correlation identifier pattern a the producer adds a correlation iden-
tifier to request messages which uniquely identifies requests. the consumers use that
same correlation identifier on their response messages enabling the original requester
(producer) to match responses to requests.
58 CHAPTER 4. INTEGRATION ARCHITECTURE
The problem addressed by the message sequence pattern is the following. Messages
may, at times, be very large. It may not feasible or efficient to send such large message
over channel.
The solution provided by the message sequence pattern splits messages into parts.
Each message part contains
• a sequence identifier indicating to which sequence the message belongs and
• a sequence number so that the original message can be correctly re-assembled.
This information enables the message recipient to identify the message a particular
part belongs to and to re-assemble the message from the parts.
The message expiration pattern addresses the following problem. Messages which are
not consumed may continue to consume increasing amount of resources (e.g. storage
resources). Messages which are not processed within some period might be useless,
e.g. storm warning after the storm. The message channel or even recipient may not
be in a position to decide whether a message may be expired. Often only the sender
knows when a message may be expired.
When using the message expiration pattern, the message producer adds an expiry
date/time to the message. The message channel then knows when it may expire/drop
the message.
The problem addressed by the format indicator pattern is the following. A message
channel may be used to send messages in different formats. It might be non-trivial
4.3. INTEGRATION PATTERNS 59
for message consumers to identify the format used. Message consumers use valuable
processing resources which has nothing to do with processing of message.
When using the format indicator pattern, one adds information about the message
format or the document type (e.g. MIME type) to the message. in addition one may
provide information about the version of the format used.
A content-based router investigates content of message and routes the message to the
appropriate message processor. The pattern fully decouples message senders from
actual message processors1 .
The message filter pattern aims to address the following problem. A large number
of messages may be published on a particular channel. A particular consumer might,
however, not be interested in all the messages. Consider, for example, a share price
channel which publishes all share price changes. A particular consumer might be
interested in only share price changes for a particular entity or sector.
The message filter performs one or more checks on the message content and/or the
headers. It passes only messages through which satisfy condition. Filters can be
logically combined using the logical AND, OR, XOR and NOT operators.
The dynamic router pattern addresses the following problem. At times the message
recipients need to be selected dynamically, i.e. in real time. This could involve se-
lecting current best service provider on, for example, the basis of cost, performance,
or reliability. Alternatively message recipients could be dynamically selected for the
purpose of load balancing.
A dynamic router stores selection rules in rule base. The rules are evaluated to
determine whether a message is passed on or not. The dynamic router routes the
message to the first recipient for which the rules are fulfilled.
1 In pipes & filters / SOA architectures one service has no knowledge of which is next processing step. Requires
The problem addressed by the recipient list pattern is as follows. A client may want
to send a message to multiple recipients. However, the client does not want to manage
the process and occur overheads of sending individual messages to each recipient.
In the case of the recipient list pattern one defines a channel for each recipient. It
then uses a recipient list router which inspects the incoming message, determines the
list of desired recipients, and forwards the message to all channels associated with
the recipients in the list.
The problem addressed by the splitter pattern is the following. A message may
contain a range of different types of information. Different parts of the message to
be processed by different processors.
Splitters split messages into individual components and place those components onto
different channels for different processors.
A special case is a batch splitter which splits a batch into individual requests or
messages.
The problem addressed by the aggregator pattern is the following. Information re-
ceived from multiple parties needs to be combined into a single message to be for-
warded to some message consumer.
The aggergator collects and stores the individual messages until a complete set of
related messages has been received. It then constructs a composite message from
these individual messages and publishes it on appropriate channel.
A batch aggregator is a special case of this pattern. It assembles responses to set of
requests into a batch of responses.
62 CHAPTER 4. INTEGRATION ARCHITECTURE
4.3.5.7 Resequencer
The problem addressed by the resequencer pattern is the following. A message router
may route sequence of messages along different routes.The messages received through
different routes may no longer be in sequence.
A resequencer collects and re-orders messages. The messages are then pulished in
correct order.
Note: A resequencer does not have to wait for the full sequence to be received before
forwarding sequence components.
The problem addressed by the scatter-gather pattern is the following. Assume you
need to source multiple quotes for each order item. Once you have them you need to
make a decision on which quotes are best and assemble actual order.
When using the scatter-gather, one broadcasts a message to multiple recipients. One
then uses an aggregator to aggregate the responses back into a single message.
4.3. INTEGRATION PATTERNS 63
The composed message processor pattern aims to address the following problem. As-
sume you need to perform a range of processing steps on message components. Once
done, you need to forward full message.
For example, assume you need to check availability of each order item with stock man-
agement. Once availability of all order items established, need to continue processing
order.
The composed Message Processor splits the message up, and routes the sub-messages
to the appropriate processors. It then re-aggregates the responses back into a single
message.
The routing slip pattern addresses the following problem. Assume a message needs
to go through a sequence of processing steps. Individual processors should not have
to know what the next processing step is.
When using the routing slip pattern one attaches a routing slip to each message,
specifying the sequence of processing steps. Each component is then wrapped with a
special message router that reads the routing slip and routes the message to the next
component in the list.
The routing slip pattern assumes that the sequence of processing steps can be deter-
mined up-front and that the processing is to be done through sequence (linear) of
processing steps.
The process manager pattern or controller pattern addresses the following problem.
What should one do when the processing sequence depends on outcomes of other
64 CHAPTER 4. INTEGRATION ARCHITECTURE
processing steps, and if certain processing steps can be executed concurrently. One
still wants to ensure that processors do not need to know where to route a message
next.
When using the process manager or controller pattern one localizes the work-flow
logic within a process manager or controller. The process manager maintains process
state and determines the next processing step based on intermediate results.
The message broker pattern addresses the following problem. Assume you want to
decouple the destination of a message from the sender, yet you want to maintain
central control over the flow of messages.
The message broker pattern is based on the hub-and-spoke architectural style. Mes-
sages are received from multiple destinations. The broker determines the message
destination and routes the message to the correct channel.
The envelope warpper pattern addresses the following problem. Assume you need
to communicate extra information required by infrastructure and certain message
processors. You would not like to add this information to the message since you
do not want to pollute the message and since it might pose problems for message
processors.
When using the envelope wrapper pattern, one wraps the application data inside an
envelope that is compliant with messaging infrastructure. The message is unwrapped
when it arrives at the destination. Message envelopes are commonly used to communi-
cate meta-data around messages including correlation ids, authentication credentials
or user roles, transactional contexts, information about response channels or formats,
and so on.
The problem addressed by the content enricher pattern is the following. A service
provider may require more business information than client can provide. Neither
source system nor target system has access to the additional required information.
A content enricher obtains the additional information from external data source and
adds the additional business information to core message body.
The message normalizer pattern addresses the following problem. Assume different
systems use different protocols. You may need to convert between all these protocols.
The combinatorics results in high complexity. Also, core components may have to
operate on messages in different protocols. Different messages may be semantically
equivalent, but may arrive in different formats.
66 CHAPTER 4. INTEGRATION ARCHITECTURE
The message normalizer specifies a standard message format and routes each mes-
sage type through a custom message translator who translates the messages to the
standard “normalized” format.
The content filter pattern addresses the following problem. A message may have a
lot of information. Not all information required for down-stream processing.
A content filter removes any unnecessary information from the content. This reduces
communication overheads as well as down-stream de-marshaling and processing com-
plexity.
The claim-check pattern aims to address the following problem. A message has con-
tent not required by some intermediate processing steps or that the intermediate
processing units should not see some of the content of a message which is to be
processed.
When using the claim check pattern one receives a message, extracts message elements
which either are not required for some intermediate processing steps, or should not
be visible for part of the processing pipeline, generates a unique key for content which
is to be temporarily removed,persists content to be removed with key, and replaces
4.3. INTEGRATION PATTERNS 67
that content in message with unique key, At a later stage the key is used to retrieve
the persisted content and inserts it back into message.
Message endpoint patterns are patterns for message senders and receivers. They
represent best practices for the structure and behaviour of message end points and
cover synchronous and asynchronous communication, pull and push paradigms and
indempotency.
The problem addressed by the message mapper pattern is the following. Assume
you need to convert domain objects to messages as required by message channel.
However, domain objects and messaging channel should not know of each other.
The pattern suggests to create separate message mapper which contains the mapping
logic between the messaging infrastructure and the domain objects. Note that neither
objects nor infrastructure have knowledge of message mapper’s existence.
The problem addressed by the message gateway patern is the following. Assume you
want to have systems integrate via messaging in a type-safe way, without the system
knowing they are using message based integration. Systems should request normal
business services.
The problem addressed by the polling consumer pattern is the following. Assume an
application wants to consume messages, but wants to control when it does so. The
application needs to know when message is available, but messaging infrastructure
does not support events.
A polling consumer polls the messaging infrastructure for available message. The
application then requests message from polling consumer when ready to process mes-
sage. The polling consumer may generate events notifying the application that mes-
sages are available.
The event-driven consumer pattern addresses the following problem. Assume a mes-
sage processor needs to consume a message as soon as it is delivered.
The problem addressed by the competing consumers pattern is the following. As-
sume a single consumer cannot process messages fast enough. We require concurrent
message processing but have no load balancing infrastructure.
When using the competing consumers pattern, one inserts messages into a point-to-
point channel and registers multiple consumers with that channel. Each consumer
processes a next message as soon as soon as they have capacity.
4.3. INTEGRATION PATTERNS 69
The problem addressed by the selective consumer pattern is the following. Assume
a message processor is assigned to consume messages off a channel and that the
consumer should not process all messages, just some of them. How can a message
consumer select which messages it wishes to receive?
The selective consumer pattern requires that the consumer filters messages delivered
by its channel, extracting only messages that fit some criteria from the channel. The
pattern is commonly used for prioritized processing with a number of processors
assigned to process high priority messages only.
The problem addressed by the message dispatcher pattern is the following. Assume
you need to have multiple message consumers coordinate their message processing.
Different types of messages should be consumed by different consumers. For example.
all messages for a client should be dispatched to the appropriate client.
A message dispatcher consumes messages from a channel and distributes them across
processors.
70 CHAPTER 4. INTEGRATION ARCHITECTURE
The indempotent receiver pattern addresses the following problem. Assume that due
to quality of service issues on the delivery channel or any other reasons a particular
message may be received multiple times by a message processor. However, messages
should be processed only once.
In the case of the indempotent receiver pattern, one has a unique identifier assigned
to each message. Indempotent receivers keep track of the message identifiers of the
messages they have thus far received. Any duplicate messages are dropped.
The problem addressed by the service activator pattern is the following. Asasume
you want to have service which can be triggered via different messaging technologies,
and via direct synchronous requests.
A service activator extracts messages from channel and makes an appropriate method
call or service request for that message. The pattern can be used for request-reply or
one-way scenarios.
The problem addressed by the durable subscriber pattern is the following. Assume a
message receiver may go off-line sometimes. The receiver may not wants to not miss
4.3. INTEGRATION PATTERNS 71
In teh case of the durable subscriber pattern, the channel keeps track of the subscrip-
tion periods of the different subscriber, and maintains separate queue of message
references for each subscriber. Messages are only removed from the channel if they
are no longer referred to by any subscriber queue. The message is usualle combined
with the publisher-subscriber pattern.
Tjhe problem addressed by the control bus pattern is the following. How can we
effectively administer a messaging system that is distributed across multiple platforms
and across a wide geographic area?
In the control bus pattern one uses a Control Bus to manage an enterprise integration
system. The control bus uses the same messaging mechanism used by the application
data, but separate channels to transmit data that is relevant to the management of
components.
The wire-tap pattern addresses the following problem. Assume you want to use a
point-to-point channel because each message should be consumed by single consumer.
72 CHAPTER 4. INTEGRATION ARCHITECTURE
However, for testing, monitoring, debugging, want to inspect all messages sent across
a channel.
The wire-tap pattern inserts a simple recipient list into the channel that publishes each
incoming message toboth, the main (business) channel and a secondary (technical)
channel. The process flow is not altered.
The problem addressed by the detour pattern is the following. Assume you need
to not only inspect messages, but also to modify or reroute them, i.e. you want to
route a message through intermediate steps to perform tasks like validation, testing
or debugging.
The detour pattern construct a detour with a context-based router controlled via the
control bus. Depending on the router state, the router routes messages either through
additional steps, or directly to destination channel.
The message store pattern addresses the following problem. Assume you need to
provide reporting or auditing against message flows. You do not want to impact on
the loosely coupled, transient nature of messaging system.
In the case of the message store pattern one uses a message store to capture informa-
tion about each message in a central location. One can have separate channels feed
into the same message store.
4.3. INTEGRATION PATTERNS 73
The smart-proxy pattern addresses the following problem. Assume you want to track
messages, but some services publish reply messages to return address specified by
client.
The smart proxy stores the return address supplied by client, and replace return
address with address of the Smart Proxy. The return received by smart proxy is
forwarded to requested return address.
The test-message pattern addresses the following problem. Assume you are using
heart beat messages issued by system components. The messages may contain health,
load and other information. However, the heartbeat messages with vital info may be
corrupted due to internal fault. How do I know heart beat messages represent actual
state of component?
The test message pattern generate test data for the component and uses a test separa-
tor to route business messages on to business processing units, and and test messages
to test validation.
The channel purger pattern addresses the following problem. At times there are
left-over messages in channels. This may effect tests or the running system.
A channel purger is used to removes unwanted messaged from channels.
74 CHAPTER 4. INTEGRATION ARCHITECTURE
1. Stick to standards.
2. Make quality attribute trade-offs explicit
• e.g. restful web services with JSON ⇔ SOAP-based web-services with XML
schema
• usability & simplicity versus quality control & pluggability
3. Prefer document-based over request-based integration
• weaker coupling.
• localizes responsibilities where they should be.
4. At the low-level, use a components-based approach.
5. At the higher-level, use either a services-oriented, messaging or observer
4.5 Exercises
1. Considering a system you have been working on which required extensive inte-
gration
a) Identify the integration approaches and mechanisms used, how they were
concretely implemented and analyze the rationale for using them.
b) Identify any channel patterns used within the system and discuss the ratio-
nale for using those patterns.
c) Identify any message construction patterns used within the system and dis-
cuss the rationale for using those patterns.
d) Identify any routing patterns used within the system and discuss the ratio-
nale for using those patterns.
e) Identify any transformation patterns used within the system and discuss
the rationale for using those patterns.
f) Identify any end-point patterns used within the system and discuss the
rationale for using those patterns.
g) Identify any system management patterns used within the system and dis-
cuss the rationale for using those patterns.
76 CHAPTER 4. INTEGRATION ARCHITECTURE
Chapter 5
Reference architectures
5.2 Examples
A number of reference architectures are widely used. Some are reference architectures
for enterprise systems, but there are reference architectures for fields as disparate
as vehicle control systems and gaming. Some of the more widely used reference
architectures include
• Layered reference architectures for enterprise systems like Java-EE and Python
Django. These reference architectures typically emphasise scalability, security,
reliability, and, to a lesser extend, integrability. They introduce concepts for
presentation, services and persistence layer business components. Java-EE has
many implementing frameworks like JBoss, Apache Geronimo, and Glassfish as
well as a range of commercial Java-EE implementations.
• The Services-Oriented (reference) Architecture which places the core focus on in-
tegrability, felxibility (time to market) and reuse. It is based on the microkernel
pattern and introduces the concept of a stateless, discoverable and self-healing
77
78 CHAPTER 5. REFERENCE ARCHITECTURES
1. Reduced risk
• Community contributes to solution
• Typical architectural challenges for domain addressed
• Well understood by architects and developers
• Often enforces good standards compliance.
2. Lower cost
• Lower analysis and research costs.
• Implementing frameworks commonly exist.
• Lower maintenance costs because frameworks often maintained by commu-
nity.
• Lower training costs for staff and shorter time to productivity.
5.4 CORBA
5.4.1 What is CORBA?
CORBA, the Common Object Request Broker Architecture is a reference architec-
ture for object-oriented integration independent of implementation technologies, lo-
cation, network technologies, and protocols. It is an object-oriented middleware with
well over 200 implementations. Common uses of CORBA include that of providing a
base infrastructure for enterprise systems (e.g. a base technology for Java-EE), and
providing a high-performance, reliable integration infrastructure for telecommunica-
tion, defense, vehicle control and many other systems.
5.5. JAVA-EE ARCHITECTURE 79
A number of tactics or strategies are used to concretely address the quality require-
ments of a typical enterprise system. For example, clustering of all architectural
components including all layers, JNDI respositories, load balancers, firewalls and
databases is used to address scalability, availability and realiability.
At the first level of granularity no application components are hosted and hence
the architecture thus does not introduce and concepts or constraints for application
components at this level of granularity.
The EJB container is the business logic container.
At this lower level of granularity a further range of architectural tactics is applied to
address EJB container quality requirements. For example, the flyweight pattern and
resource pooling (including object, thread and connection pooling) are used to address
scalability and performance. Similarly interception is used to address for auditability
5.5. JAVA-EE ARCHITECTURE 81
and security, and queueing to address scalability and reliability. In addition, inte-
grability is addressed through seamless integration through RMI, SOAP-based and
REST-ful web services, and messaging.
The EJB container does host application components. It uses the controller pattern
for application components and introduces stateless and stateful session beans and
entities as the concepts within which applications are developed. Message driven
beans should really be used for messaging adapters and are thus conceptually part of
the access layer.
In addition EJB introduces a number of constraints for application components (ses-
sion beans) including
• may not provide no direct access to service components
• may not directly access resources (threads, DB connections, . . . )
• may not directly access native libraries
Finally EJB introduces a range of strategies to improve flexibility, reliability and
extensibilty including
• decoupling via contracts
• dependency injection & service provider lookup
• declarative authorization
• declarative transaction management
• interception for extensibility and customizability
• Scalability
– Typically good trough resource (thread, connection, object, . . . ) reuse,
load-balancing, caching and clustering.
• Reliability
– Typically good through transaction support, clustering, session replication
and support for messaging.
• Flexibility
– Average as processes not explicit.
– Improved through interceptors, removal of infrastructure/plumbing logic,
hosting process logic only in stateless session beans and annotations.
• Performance
– Average because of layers, and communication overheads.
– RMI/IIOP is reasonably efficient protocol.
– Improved through JPA-based object cache.
• Auditability
– Not directly supported. Needs to be implemented via interceptors.
• Security
– Good support for authentication, authorization and confidentiality.
• Integrability
– Quite good with support for CORBA, SOAP-based & Restless web services,
DB integration.
– Integration to systems using proprietary protocol via JCA.
82 CHAPTER 5. REFERENCE ARCHITECTURES
As the EJB container is responsible for hosting shared business objects within the
application server, it is responsible for transparently applying a number of enterprise
and middleware services to beans. Had the developer needed these services in a
traditional CORBA/DCOM or Java RMI deployment, several explicit API calls would
have to be made from within the business objects. In other words, the business logic
would be polluted with a number of complex technicalities.
The application server automatically supports concurrent service requests via multi-
ple bean instantiation, i.e. concurrent service requests are processed by different bean
instances. Bean developers need thus not worry about writing multi-threaded servers
– in fact they are forbidden to do so because that would interfere with the containers
concurrency support.
Furthermore, in the case where the different client bean instances share common data
resources the container takes over the responsibility of synchronizing the different data
views.
Component pooling is possible because, as we shall see, clients do not obtain a direct
reference to the enterprise bean instance.
As one deploys enterprise beans within a container, the container typically creates a
pool of instances of the bean. The algorithm used is specific to the container – this
is one of the many areas where application server vendors compete.
Pooling is particularly simple for stateless session beans which provide a set of client
services but which do not maintain information across service requests. In this case
the session bean is returned to the pool upon completion of the service and if the
same or another client requests a service from that same enterprise bean one of the
bean instances in the pool is allocated to the client.
Containers also provide component pooling and life-cycle management for other enter-
prise beans. For message-driven beans it is basically as simple as for stateless session
beans. For stateful session beans and entity beans the state has to be persisted before
the same bean instance can be used for another client.
If, say during peak hours, the demand for a particular enterprise bean increases, the
container can dynamically increase the pool size and at a later stage, when the load
decreases, the pool size can be reduced again.
A relatively small number of beans can thus serve a large number of clients.
Bean developers need not make the beans network-enabled. The container automat-
ically supports distributed architectures by wrapping the bean instances by bean ob-
5.5. JAVA-EE ARCHITECTURE 83
jects which are network enabled. These bean objects intercept bean service requests,
in order to provide the other services like transaction, security and persistence. Every
EJB is published as both an RMI and a CORBA object, and can easily (through the
use of Java annotations) be published as a Web Service as well.
5.5.2.5 Persistence
The application server automatically loads bean information from persistent storage
upon bean activation and saves the bean state automatically onto persistent storage
upon deactivation.
Furthermore, the bean developer need not know the details of the structure of the
persistent storage (e.g. which object fields are stored in which columns of which tables
or whether the persistent storage is a relational or object database). The mapping to
persistent storage can be done declaratively by a database administrator who need
not be a Java developer. It can be even left to the EJB container to create the
required database tables and to define the mapping implicitly. Note: If one uses
JPA based persistence, then one is locked into object-relational mapping and hence to
relational databases.
EJB also maps specialization relationships onto relational databases and allows you
to choose from a set of standard mappings for specialization.
EJB Application Servers must provide a naming and directory service which im-
plements the Java Naming and Directory Interface (JNDI). The JNDI is a generic
API for interfacing with general naming and directory services (such as, for example,
LDAP).
As is shown can be seen in 5.3, JNDI wraps concrete naming and directory services.
Some of the naming and directory services which can currently be accessed through
JNDI are
administration applications etc. would all obtain the required information from
one central LDAP. LDAP data is structured as a hierarchical database which
allows multiple entries for a specific item. Sun’s iPlanet directory server and
OpenLDAP are the most well known LDAP servers but most other directory
services provide an LDAP interface. LDAP version has support for referrals
– i.e. it makes it possible that LDAP service requests are referred on to other
service providers. This enables large-scale clustering and distribution.
• DNS:
Internet domain name servers which map a domain name (the host name) onto
a IP address (the message path) can also be accessed through JNDI.
• NIS:
NIS, Sun’s Network Information Service , which acts as a yellow pages service
for network resources.
• NDS:
The Novell Directory service .
JNDI thus provides a standard interface which decouples the application from the
physical naming and directory service provided by the environment. Naming services
are typically used to obtain a reference to an object in a distributed environment.
Directory services are really sophisticated naming services which include metadata
describing the objects they reference. This enables clients to make more sophisticated
searches for objects – i.e. for example to query all printers in a particular building
which can print color onto A3 sized paper.
5.5. JAVA-EE ARCHITECTURE 85
When you open your systems across an intranet or even internet, security becomes
of vital importance. The EJB application server facilitates a declarative support
for authentication and authorization which removes the burden of making calls to a
security API from the bean developer.
The authentication is usually done at the persistence layer using normal JAAS (Java
Authenticion and Authorization Service) based security.
Confidentiality is usually transparently configured within the architecture resulting
in secure communication (via, for example, SSL).
At the services layer, the main focus is on authorization. The bean deployer defines
security roles for entire enterprise beans or for individual services supplied by en-
terprise beans. A security administrator maps users and user groups onto security
roles.
The client session is solidly managed across presentation and services layers (the
session beans). The session context and state is propagated across session beans.
5.5.2.10 Interception
Enables you to intercept both, business logic and bean management services in order
to add further responsibilities around a set of base responsibilities addressed by the
bean logic itself and by the application server. This makes enterprise beans externally
extensible.
In a similar way, the container is typically responsible for resource connection pool-
ing like, for example, database connection pooling. Establishing these connections
is typically expensive. Enterprise beans should typically not establish connections
themselves to resources. Instead they obtain a connection from the container who
maintains a connection pool.
86 CHAPTER 5. REFERENCE ARCHITECTURES
• concurrency,
• transactions,
• security, and
• persistence.
The way in which a service request is intercepted and ultimately processed is shown
in the following figure. Note: Since EJB uses RMI/IIOP/TCP/IP as protocol,
enterprise beans can be accessed from CORBA through the standard CORBA proto-
col, IIOP. This means they are directly accessibly to, for example, CORBA or C++
clients.
The container takes over a lot of responsibilities which would otherwise have resided
with the bean developer. Consequently the bean itself is prevented from doing certain
things which interfere with the container operations.
5.5.3.3.1 Beans can’t give clients direct access to the bean instance The
client should never interface with the bean instance directly, but should instead in-
terface only with the EJB object which is generated by the container and acts as a
portal to the bean. This architecture enables the container to intercept bean service
requests and take over the responsibility of container managed services like transac-
tions, concurrency, security and persistence.
Though you can’t pass a handle of the bean instance to the client, you can, of course
pass the handle to bean helper classes (which are, from the client’s point of view part
of the bean implementation).
5.5.3.3.4 Enterprise beans should not create a user interface The whole
idea behind Enterprise Java Beans is to separate the presentation layer from the
business logic layer. No direct interaction via a GUI (AWT or Swing) or keyboard
input is allowed for enterprise beans. Of course, the latter follows from the fact that
enterprise beans may not use the java.io package. Bean developers may also not
assume that the bean host has any form of GUI support.
5.5.3.3.5 Stateful session beans can’t have persistent class fields The idea
of maintaining persistent class information (static fields) for an EJB goes largely
against OO concepts and warrants a redesign with perhaps introducing further entity
beans.
There are several problems with maintaining class state for an EJB. Firstly, the
container will not manage concurrent access to such fields and you as bean developer
may not. Furthermore, the EJB service requests may be distributed by the container
across Java Virtual Machines (JVMs) and the class state would not be available across
these JVMs.
Thus, you should only use constant (final) class attributes for EJBs.
5.5.3.3.6 Enterprise beans may not use any native libraries The reasons
for this are firstly security and secondly portability. If you really need to obtain access
to native libraries you should wrap them as a CORBA component and use them via
standard CORBA service requests.
There exist a wide variety of SOA frameworks, both open-source as well as propri-
etary. For Java there is a refined specification for SOA which is the Java Business
Integration (JBI) specification which introduces a normalized message bus, pluggable
service engines and pluggable binding components for a wide variety of integration
channels including SOAP, REST, RMI, CORBA, SMTP and so on.
5.6.4
A service registry acts as a naming and directory service for web services, i.e. can
look up a service by name or by some service classification. It also acts as a contract
repository, hosting the WSDL contract specifications. The service registry provides
governance tools to tag services as accredited or preferred service providers.
Service registries are commonly packaged together with a service repository, though
the latter can also be stand-alone. A service repository hosts the higher level service
orchestrations as specified in some orchestration language like BPEL, WS-BPEL or
BPMN. It also works in conjunction with the service registry to provide services to
assess whether an orchestrated service’s dependencies are met.
Service containers host leaf or atomic services, i.e. services which are not orchestrated
from lower level published services. Examples of services containers Spring or EJB
containers, XSLT engines, web service or CORBA wrapped systems, Microsoft.Net,
...
Process engines can interpret and execute process execution engines. Can interpret
process execution languages like BPEL, WS-BPEL, and BPMN. Examples of process
execution engines are JBoss jBPM, Petals BPEL Engine, Activiti, OW2 ORchestra,
as well as a range or proprietary engines.
5.6. SERVICES-ORIENTED ARCHITECTURES (SOA) 91
The first level of granularity pattern is SOA is the microkernel with the microkernel
itself being the services bus. The lower level components in a SOA architecture are
based on the adaptor, broker and hierarchical patterns (the adaptors which in turn
use the broker patterns and the services registry which is based on the hierarchical
pattern). At lower levels of granularity, SOA uses, for example, the adaptor, bro-
ker. SOA also uses a range of integration channels including point-to-point channels,
content based routers, message bus and so on.
• Messaging
– for reliability & decoupling
• Dynamic service provider lookup
– for flexibility and decoupling
• Interception
– for auditability (logging), security, . . .
• Clustering of all architectural elements
– for scalability and reliability
• Compensating work flows to undo on failure.
– for reliability i.e. leave in consistent state (ACID criteria)
• Federated services containers.
• WSDL, the Web Services Description Language for specifying services contracts
including quality requirements. It is provided in two different levels of abstrac-
tion with an abstract service definition defining the web-service API and a con-
crete service binding specifying service location, protocol specification, message
exchange patterns and data types in the form of XML schemas.
• WS-Policy used to specify metadata for services. This standard is used to
specify quality requirements like reliability, performance and security require-
ments.
• XSD, RDF/OWL, Relax NG which are all standards for data structure
specification.
92 CHAPTER 5. REFERENCE ARCHITECTURES
Figure 5.7 depicts the structure of a space based architecture, showing the main
components and their responsibilities. Note that the architecture is based, at the
first level of granularity, on the blackboard architectural pattern.
The system needs to provide service to generate pedagogically sound training docu-
ments from the knowledge repository. The request contains the prerequisites (current
knowledge) and the outcomes (required knowledge). The output should be a peda-
gogically sound document which takes a learner who satisfies the prerequisites to a
state where he or she understands the outcomes. The document covers all outcomes
and their components and recursively all their dependencies and their components
(excluding the prerequisites, their components and their dependencies).
The resultant set of knowledge component needs to be pedagogically ordered such
that a when knowledge component is reached, all dependencies have already been
covered. Finally, the document needs to be structured into levels of sections (e.g.
subsections,sections, chapters, and parts).
A number of frameworks have been developed which are based on the SBA reference
architecture. Some of the more well known are listed below:
• Facilitate innovative electronic systems that improve performance, safety & en-
vironmental friendliness
• Reduce cost & risk of automotive software development.
• Facilitate ncreased use of commercial off the shelf hardware
98 CHAPTER 5. REFERENCE ARCHITECTURES
• Integrability:
• Monitorability/Auditability:
• Performance:
• Scalability:
• Portability:
– across microcontrollers
• Security:
5.8.2 Overview
The Basic Software Layer is, once again, based on layering with the following layers:
1. Services Layer
2. ECU Abstraction Layer
3. Microkernel abstraction layer
Other patterns like Bridge and , Broker are used at lower levels of granularity.
Though there is only a single vehicle to monitor and control, the amount of data to
be processed across the various sensors and actuators can be significant. To this end
AUTOSAR specifies a range of scalability tactics including
• using concurrencies,
• support for scheduling including prioritized scheduling,
• event queueing,
• scaling out resources by clustering,
102 CHAPTER 5. REFERENCE ARCHITECTURES
• signal routing where not an entire message but only the signal needed by the
recipient is routed,
• task filtering — executing only tasks which do not have to wait for resources,
• load balancing across embedded multi-core processors,
• multiplexing (carrying many analog signals across a single wire) for network
scalability,
• resource management including resource allocation and demand management,
• message aggregation for improved communication scalability.
Even though reliability and monitorability are primary quality requirements, flexi-
bility is still important in the context of upgrading or renewing components which
may require a new version of the software. Flexibility tactics specified by AUTOSAR
include
• support for pluggable components through contracts based decoupling and com-
ponent life cycle management e.g. sleep and wake-up services
• location neutral brokering and support for relocatable components,
• decoupling through a message bus,
• XML-based configuration files,
5.9.1 Overview
Architecture design
methodologies
107
108 CHAPTER 6. ARCHITECTURE DESIGN METHODOLOGIES
These are specified using combination of architectural views. The views are, however,
not precisely specified. THe authors suggest a module view, a component-connector
view, and a hardware allocation view.
Some concerns one could raise against ADD include that
During the identify candidate architectural drivers step, one performs a priority ⇒
impact mapping resulting in a fuzzy impact assessment represented by (H,H), (H,M),
(H,L), (M,H), . . . , (L,L). In ADD one is required to select several (they suggest top
5 or 6) which become the candidate architectural drivers. The focus requirements for
subsequent steps in architecture design process is then on these candidate architec-
tural drivers. Note, however, that further analysis may change selection somewhat,
i.e. one may find that certain requirements have more impact than initially thought.
During the 4’th step of ADD, one chooses appropriate design concept. Note that the
authors see tactics as types of patterns. The steps in this phase are
Step 6 of ADD is the define component interfaces step. For each component one
specifies an interface with
1. operation/service signature,
6.2. SYSTEMATIC METHOD FOR ARCHITECTURE DESIGN (SYMAD) 111
During the last step,, the verify and refine step, one verifies hat the component
satisfies
1. functional requirements,
2. quality attribute requirements, and
3. architectural (design) constraints.
<<structured>>
Requirements for Architectural Component
[no architectural
component <<structured>>
satisfying customize component to meet requirements
requirements
available] configure map responsibilities
architectural tactics onto component
configure infrastructure
[all responsibilities
addressed] configure application
concepts and constraints
<<structured>>
Design of Architectural Component
[architectural
specify application component component
concepts, constraints & tactics assign responsibilities to
does not host
architectural components
application
components]
[architectural component hosts
application components] specify infrastructure
between architectural components
Figure 6.4: An overview of the SyMAD method showing method steps and reuse exploration.
The case study subject is a regular banking system used by individual and corporate
clients for transactional banking, loans and deposits. The banking services need thus
be remotely accessible by humans and client systems.
In addition to standard banking processes, the system must facilitate the maintenance
of customer information and the generation of regulatory reports which need to be
fed through to the industry regulator.
The software architecture for the system as a whole is selected as the context compo-
nent for which we need to elicit the architectural requirements, check for reuse and
potentially design the software architecture.
<<Responsibility>>
<<Responsibility>> <<Responsibility>> <<Responsibility>>
Execute Processes
Synchronous Human Access Asynchronous System Access Integrate With Regulator
<<Responsibility>>
Persist Data
<<Responsibility>> <<Responsibility>> <<Responsibility>>
Asynchronous Human Integration Synchronous Systen Access Integrate With Persistence <<Responsibility>>
Reporting
e.g. routing,
Scalability Performance
en/decoding,
- 50 000 transaction per minute < 100 milliseconds may be consumed by infrastructural code
load-balancing, ...
- 200 000 concurrent users
Security
- authentication
Reliability - authorization on both, services and on data access
< 1 in 100 million transactions fail due to architecture problems. - confidentiality on all exchanged information
Auditability
- all requests and responses must be auditable
- all changes to entities must be auditable including the user who executed the process which applied the changes
Maintainability
- the software system must be constructed such that it can be maintained at low cost and risk for at least 20 years.
6.2.3.2.2 Check for reuse In SyMAD one already checks for reuse at the first
level of granularity.
with the standards being community managed standards. Hence, by considering the
architectural constraints we exclude only Microsoft.Net.
over the next 20 years. The wide skills availability for this reference architecture also
reduces maintainability risk.
The scalability, reliability and security requirements would be achievable in SOA, but
the complexity and associated cost would be higher than in Java-EE. Message logging
is straight-forward in SOA, but entity change logging is not supported and would
have to provided by additional persistence infrastructure. Performance would be a
major risk factor when choosing SOA as the reference architecture. Furthermore, the
standards compliance is less mature within SOA frameworks. As a result, applications
developed within this reference architecture are commonly more framework locked
than applications developed for the Java-EE reference architecture—this results in a
higher maintainability risk.
<<Responsibility>>
Asynchronous Human Integration Process Execution Engine
RegulatorAdapter
Email Adapter
<<Responsibility>>
<<Responsibility>> <<Responsibility>> Persist Data Database
Synchronous Systen Access Integrate With Persistence
Web Services Broker
<<Responsibility>>
<<Responsibility>>
Reporting Reporting Engine
Asynchronous System Access Messaging Broker Persistence Adapter
Figure 6.8: Mapping of the required architectural components onto the components as specified
in the Java-EE reference architecture.
Java-EE, on the other hand, does provide specifications for most of the required com-
ponents and implementing frameworks provide implementations for these specifica-
tions. Figure 6.8 shows the mapping of the abstract components onto the components
as specified in the Java-EE reference architecture as well as the components which
are not provided by the reference architecture. These components are selected for the
next lower level of granularity where the requirements specification for them is done.
We will then either source existing architectural components which meet these re-
quirements or design appropriate architectural components. The diagram pre-empts
the results from the next level of granularity by showing which components can be
sourced and which need to be designed.
6.2.3.2.2.5 Component selection Both SOA and Java-EE satisfy the architec-
tural constraints, but the quality attribute trade-offs made in Java-EE are better
aligned with the quality requirements for the banking system, with Java-EE having
advantages on scalability, performance, security and maintainability. SOA is stronger
when it comes to integrability, but this is not a central quality requirement for this
case study. Furthermore, Java-EE addresses more of the architectural responsibili-
ties. The analysis thus leads us to select the Java-EE reference architecture for the
system as a whole.
We could go a step further and also select a particular implementing framework (e.g.
RedHat WildFly or IBM Websphere Application Server).
When configuring the re-used architectural component at the current level of gran-
ularity (in this case study, the Java-EE reference architecture), we need to map the
architectural responsibilities onto components of the re-used reference architecture
and configure the infrastructure, architectural tactics and application concepts and
constraints of the re-used component.
Banking
System <<Tactic>>
User Replication
As mentioned previously, these tactics are often cross cutting concerns which are
applied across a subset of the architectural components. Hence they are naturally
modeled as aspects. For this reason we choose the AO-ADL [?] to document the
application of architectural tactics. In addition to providing connections between
architectural components, Figure 6.9 shows the application of tactics to the system
as a whole. In AO-ADL aspectual roles represented by solid arcs to connectors
represented by largish circles (e.g. C1).
access layer
<<component>> <<component>>
Java-EE Web Container EJB Container
<<component>> <<component>> <<component>>
JSF JAX-WS Message-Driven
Framework Broker Bean Based Router
processing layer
infrastructure layer
<<component>> <<component>>
EJB Container JPA
Persistence
Email Adapter <<component>> Framework
JCA Based
Regulator Adapter
persistence layer
Database
Figure 6.10: Configuration of the infrastructure of the Java-EE reference architecture for the
banking system.
The second architectural component of the banking system which is not specified
within the Java-EE reference architecture is the reporting engine. We would specify
the architectural requirements for the reporting engine and then check for re-use. It is
likely that one of the standard reporting engines (e.g. JasperReports or Pentaho [?])
would fulfill the requirements for the reporting engine. The chosen engine would have
to be configured to meet the architecture requirements of the banking system. This
process would be similar to that of configuring the Java-EE reference architecture.
The system submits asynchronous messages and requests to external parties in a way
which is independent of whether the messages are processed by external systems or
humans. The responsibility of the email adapter is to map asynchronous messages
and requests onto an email for asynchronous human consumption and, in the case
of requests, provide a response capture facility which enables humans to submit a
response through a web page whose content is demarshalled, with the demarshalled
message being provided asynchronously back to the system.
From the perspective of the banking system, the email adapter is purely an infras-
tructural/architectural component—it is just an adapter and does not provide any
application functionality for banking. However, at this lower level of granularity we
6.2. SYSTEMATIC METHOD FOR ARCHITECTURE DESIGN (SYMAD) 121
have both non-functional and functional requirements and hence will have to do both
architecture and application design for this component. Without going into much de-
tail on the side of application design, this example also illustrates how both software
architecture and application design are done across levels of granularity.
6.2.3.5.1 Architecture design for the email adapter The quality attributes
of a lower level component need to support the qualities of the architecture at the
higher level. Furthermore, the lower level architectural components (e.g. the email
adapter) are deployed within the architecture of the parent component (the banking
system). For example, the processes of the email adapter will be executed within
the process execution engine (the EJB container) of the parent component. In this
context, lower level components benefit from the architectural tactics which have
been applied to the parent component (e.g. resource pooling in the context of thread
and connection pooling).
The architecture of the email adapter needs to provide the infrastructure to integrate
with the banking system’s asynchronous input and output channels (the message
queues) on the one side and the mail server and human beings on the other side. In
particular, it delivers asynchronous messages to humans via email and captures the
asynchronous responses from humans via the web. In addition, the email adapter
also requires an execution environment within which its processes can be executed.
The quality requirements for the email adapter are directly derived from the quality
requirements of the higher level component – the banking system as a whole. To do
this each higher level quality requirement was analyzed for its relevance at this lower
level of granularity. Those quality requirements which were relevant were quantified
in such a way that the quality requirements for the email adapter support those for
the banking system as a whole. The resultant quality requirements for the email
adapter are shown in Figure 6.12.
The software architecture of the lower level component must be designed within the
architectural constraints of the parent component. Hence no third-party elements of
the email adapter may be vendor locked.
lower level components within the email adapter—the opportunity for such reuse will
be investigated as we traverse to lower levels of granularity.
Banking System
<<Tactic>>
Thread C1 C5 Connection
Encryptor
Pooling Pooling
Process
Web Web Mail Server
C3 C4 Execution C2
Browser Broker Adapter
Engine
<<Tactic>> <<Tactic>>
Page Logging
Cache <<Tactic>>
Dependency Injection
architecture at the previous level of granularity (that mapping would only be done
as we go to the next lower level of granularity for the required architectural com-
ponents). The remaining components will need to either be externally sourced (e.g.
an email encryptor) or designed at the lower level of granularity (e.g. the logging
interceptor).
The architecture within which the functionality of the email adapter is to be devel-
oped is assembled from the architectural components addressing the non-functional
requirements. The components implementing architectural tactics can largely be
modeled as aspects in the spirit of aspect-oriented software architecture design [?].
.... complete
Write section
6.2.3.5.2.1 Services Contract Figure 6.16 depicts the services contract for the
first level of granularity for the email adapter.
<<component>>
<<Responsibility>> Mail Session
Integrate with Mail Server MailServerAdapter
<<Responsibility>> <<component>>
Execute Processes EJB Container
Process Execution Engine
<<Responsibility>> <<component>>
Synchronous Human Access Web Broker JSF
Framework
<<Responsibility>>
<<component>>
Asynchronous System Integration
JMS Queue
Queue
Reliability
- request messages and <<Tactic>>
responses should not be lost Persistent Queues <<component>>
Enterprise
Bean Pool
<<Tactic>> ThreadPool
ThreadPooling <<component>>
Scalability JSF Cache
- 1000 email requests per minute <<Tactic>> PageCache
PageChaching
<<component>>
HttpsAdapter SSL HTTPS
Security Adapter
<<Tactic>>
- confidential communication
Encryption
MailEncrypter
<<Tactic>>
Auditability Logging
- all requests and responses are auditable LoggingInterceptor
6.2.3.5.2.3 Process design During the first-level granularity process design phase
for the email adapter we assemble a process across the functions/services specified
during the functional requirements phase. Figure 6.18 depicts a process design for
the email adapter.
6.2.3.5.3 Lower levels of granularity Both the application and software ar-
chitecture design for the email adapter will have to be taken through lower levels
of granularity until all application and architectural components are assembled from
available components. At any level of granularity we may have both software archi-
tecture design addressing the non-functional requirements for that level of granularity
and application design addressing the functional requirements for that level of gran-
ularity.
EmailAdapter
+processRequest( request : Request )
<<include>> sendMessage
constructResponseCapturePage <<include>>
processRequest
MessageSender
<<include>> <<include>>
<<include>>
mapRequestOntoEmail
generateReponseAdapter
ResponsePageConstructor deployWebPage
EmailMapper
ReponseAdapterGenerator WebServer
Figure 6.17: The functional requirements and responsibility allocation for the processRequest
use case.
Software architecture
description
127
128 CHAPTER 7. SOFTWARE ARCHITECTURE DESCRIPTION
7.1.1 Views
The Logical View is concerned with the functionality the system provides to end-users,
i.e. with specifying application functionality. The UML diagrams used to document
this view are class diagrams, communication diagrams and sequence diagrams.
The Process View is used to specify the dynamic aspects of the system. It is meant
to describe the system processes and how processes communicate. The focus is on
the runtime behavior of the system including the specification of concurrencies.
The view is used to describe how some non-functional aspects are addressed, namely
performance and scalability. The approach suggests that UML activity diagrams are
used to document this view.
The development view or implementation view describes the software system from
a software management perspective. It focuses on the decomposition of the system
into software modules and subsystems.
The UML diagrams used to document this view are package diagrams and component
diagrams.
The Physical View or Deployment) View depicts the software system from a engi-
neer’s point-of-view. It describes the deployment of components onto physical com-
ponents or frameworks, i.e. the deployment onto nodes. It also depicts the physical
connections between the components.
7.2. ARCHITECTURE DESCRIPTION LANGUAGES (ADLS) 129
The description of the physical infrastructure may depicts some non-functional con-
cerns, like, for example, reliability/availability and scalability.
The UML diagram used for this view is the implementation (deployment) diagram.
The Use Case View or Scenarios View depicts the functionality of the software system
from user’s or stakeholders perspective. It documents the functional requirements and
the use case interactions from external objects perspective.
Commonly the view is restricted to a small set of use case scenarios. It illustrates
application processes within architecture. The view is sometimes used to developing
“architectural prototype” and also for scenario-based architecture validation.
The UML diagrams used for the use case view include use case diagrams, sequence
diagrams and communication diagrams.
• whether higher level components can be assembled from lower level components,
• have explicit support for patterns and tactics,
• have the concept of a responsibility,
• they can document functionality and processes, and
130 CHAPTER 7. SOFTWARE ARCHITECTURE DESCRIPTION
• whether they have a way to specify concepts and constraints for application
components.
Also, one often would like to document both, a conceptual architecture as well as an
implementation architecture which specifies the chosen technologies and frameworks.
There are a number of different approaches taken with software architecture descrip-
tion:
• Single model populated through multiple views facilitating model checking. The
approach may be supported by formal specification of semantics in the form of
an ontology.
The connectors have thus normal connection semantics extended with aspectual bind-
ings
132 CHAPTER 7. SOFTWARE ARCHITECTURE DESCRIPTION
1. Contextual information like issuing and client organizations, date, revision his-
tory, reader guidelines, . . . .
2. An identification of the architecture stakeholders.
3. For each stakeholder, the architectural requirements/concerns.
4. Models and or descriptions of the system organized in views corresponding to
defined view points.
5. The view point details explaining the artifacts of the views corresponding to the
view points.
6. The rationale used to select the described architecture and evidence that credible
alternatives were considered.
7. A list of open issues, uncertainties and potentially inconsistencies across views.
136 CHAPTER 7. SOFTWARE ARCHITECTURE DESCRIPTION
View points need not be be specific for a particular type of system or for an ar-
chitecture analysis and design method. One can reuse standard view points across
frameworks and methods. Such generally useful view points are commonly stored in
and sourced from view point libraries.
7.3. IEEE/IEC/ISO 42010 137
The architecture framework of the metamodel specifies common practices for creating,
interpreting, analyzing and using architecture descriptions.
Examples of ADLs: include AO-ADL, ACME, xADL, Rapide, SysML, and many
others.
This section specifies the quality requirements around the functionality offered by the
system.
This section specifies the constraints placed by the client on the architecture
The software architecture should be specified across levels of granularity, i.e. You
start with the software architecture for the system as a whole as initial component
and recursively decompose it into lower level architectural components.
For example, within AUTOSAR you would specify the architecture of AUTOSAR
as a whole, specifying the high-level responsibilities (host application components,
provide integration infrastructure for application components, provide bridge to mi-
crocontroller, . . . ), assign them to architectural components (application container,
virtual function bus, microcontroller adapter, . . . ), specify the connectors and struc-
tural constraints (potentially in the form of structural patterns like layering in AU-
TOSAR), specify the architectural tactics/strategies for the high-level component
and, if the component directly hosts aplication components, the concepts and con-
straints within which the application components are to be developed.
For each level of granularity you should consider providing the following views:
In this view you specify the architectural tactics through which the quality require-
ments for the architectural components are to be concretely addressed.
For each chosen tactic (including integration patterns), specify
• why the tactic was chosen (e.g. what quality requirement is is meant to address),
• how the tactic affects other quality requirements,
• how the tactic is applied to the component.
If your component hosts application concepts (e.g. a EJB container hosts enterprise
beans, a space in the space-based hosts domain objects and a services container in
SOA hosts services), specify the concepts and constraints introduced by the software
architecture.
Examples of concepts are
• procedures,
• classes,
• Components as in EJB and other component-based frameworks,
• functions as in functional programming,
• services as in SOA
Software architecture
recovery
Note that the scope, method, inputs and outputs are all influenced by choice of soft-
ware architecture definition. In either case, the output should be an IEC/ISO/IEEE
42010 compliant architectural description.
147
148 CHAPTER 8. SOFTWARE ARCHITECTURE RECOVERY
• The system may have a lot of code and a huge code bulk may have to be manually
analyzed.
• There may be a high level of system heterogeneity, i.e. different aspects of the
system designed and built against very different software architecture and tech-
nologies.
• The architecture is not explicit in the source code and hence we cannot automate
many aspects of the architecture recovery and in particular the extractions of
abstractions like patterns and tactics.
• Third party components used in the software system may address architectural
concerns and may significantly affect the quality attributes of the system. It may
be that neither the source nor sufficient architectural descriptions is available
for these components.
• No standard description framework or language for documenting a software ar-
chitecture.
• Political issues within organizations
<<structured>>
preparation select component
<<structured>>
interviews
extraction
documentation analysis
request tracing
<<structured>>
abstraction and description
Figure 8.1: The systematic method for software architecture recovery yielding, for each architec-
turally significant component, one or more Request Trace Views (RTVs), a Responsibility Allo-
cation View (RAV), a Structural View (SV), a tactics view, Framework Mapping View (FMV)
and an Application Concepts and Constraints View (ACCV).
<<Swing App>> <<Servlet>> : MessageHandler : ModuleDelegate <<Stateless Session Bean>> : ServiceLocator <<Stateless Session Bean>>
: ClientApp : CoreRouter : ProcessServiceBean : BusinessBean
getService(serviceJNDI)
statelessSessionBean
ProcessService maintains method map of
ProcessService deserializes the
(module, function, service, device) -> methodHandle
getMethodHandleFromMethodMap transfer object obtained from the
moduleData using a
TransferObjectSerializer
invoke(transferObject)
resultTransferObject
resultModuleData
moduleData
httpResponse
Figure 8.2: An example of how a request trace can expose architecturally significant components
– only the last component contains application logic.
152 CHAPTER 8. SOFTWARE ARCHITECTURE RECOVERY
Chapter 9
9.1 Overview
Architecture analysis involves analyzing either an existing software architecture or
a proposed software architecture specification for its ability to address the non-
functional requirements for some system.
An architecture analysis is commonly used to identify architectural weaknesses of
either an existing system or of a proposed software architecture and to compare
different software architecture proposals.
153
154 CHAPTER 9. SOFTWARE ARCHITECTURE ANALYSIS
The architecture evaluation team should not include members who are part of the
project team, i.e. who have a stake in the architecture. The team often includes
external consultants. This can assist with avoiding political issues and with obtaining
an independent, external assessment. The evaluation team should preferably have at
least two members.
Skills requirements for the evaluation team should include that of having a solid back-
ground in architecture concepts including architecture requirements, patterns, strate-
gies and reference architectures, and understanding the technologies and frameworks
used within the proposed/existing architecture. Furthermore, the evaluation team
should have good analytical, facilitation and presentation skills.
The project decision makers are the people who make decisions about the project
including strategic, investment and logistic decisions.
They typically include the person(s) or team which proposed the project (e.g. the
product champion), the project sponsor, and project management.
Additionally the role players in an ATAM based architecture analysis may include
any further parties who have an interest in the architecture and the resultant system.
This may include
An ATAM process is initiated with a request for an architectural analysis. The first
step is to identify and commission architecture evaluator or evaluation team and brief
them on the reason for performing the architecture evaluation. Subsequently the role
players participating in the process are identified and the team is assembled.
Once the team has been assembled the ATAM concepts are presented and explained
to the team. This includes the aim or purpose of the architecture evaluation, an
explanation of the ATAM process and the rationale behind the process, the respon-
sibilities of the different role players, and an explanation of the ATAM phases. For
each phase one discusses the purpose, the inputs and outputs, and the activities
performed.
Team members are encouraged to raise questions or concerns around the process.
9.2.6.2.1 Present the business drivers The specification of the business drivers
should include
9.2.6.2.2 Present the architecture The lead architect provides the essence of
the architecture in a concise, structured way. The focus should be on core architec-
tural decisions and not on auxillary details.
Aspects which should be covered in the architecture presentation include
9.2.6.2.3 Identify architectural approaches During this phase there are gen-
erally extensive discussions between the project’s architecture team and the architec-
ture evaluation team in order to deepen understanding of the architectural decisions
made, and the rationale behind those architectural decisions.
Usually further architectural decisions are identified during this phase. Some, but
not necessarily all of these might not have been made explicitly.
9.2. THE ARCHITECTURE TRADE-OFF ANALYSIS METHOD (ATAM) 159
9.2.6.2.4 Generate quality attribute utility tree The quality attribute utility
tree is a tree which has
During the elicitation phase one captures information about the software architecture
and develops an understanding without assessing the software architecture.
During the elaboration phase one assesses the architectural decisions, identifying risks
not identified by project team, and weighing up against alternatives. Nevertheless,
one still obtain further information from stakeholders to deepen understanding.
Typically one performs a an analysis of the code of critical components to obtain an
independent understanding of key features of the software architecture.
One then brainstorms, prioritizes and analyzes further scenarios, expanding the at-
tribute utility tree.
Ultimately one needs to assess the trade-offs made in the context of the business
requirements. Note that one should not forget investigating the maintainability of
the system.
160 CHAPTER 9. SOFTWARE ARCHITECTURE ANALYSIS
During the evaluation phase the architecture evaluation team writes the evaluation
report. The report should include
161
162 CHAPTER 10. THE MODEL DRIVEN ARCHITECTURE (MDA)
Furthermore, since the models are technology and architecture neutral, they have
better longevity, surviving technology and architecture changes. In the case of tech-
nology and architecture changes new system, documentation and test artifacts can
be generated from the technology and architecture neutral models. This results in
increased flexibility and the ability to quicker (and at lower cost) extract value from
technology advances.
• Constraint specification:
– Object Contraint Language (OCL)
• Model-To-Model Tranformation
– Query/View/Transformations
∗ Declarative → QVT-Relational
∗ Operational/algorithmic → QVT-Operational
• Text/code generation
– MOF Model to Text (MOFM2T)
– Better (??) approach: Define text syntax for DSL
∗ Render model in text syntax
In MDA MOF/EMOF based metamodels are used to specify the abstract language
within which a model (e.g. a domain model) is specified. However, MDA does not
yet specify any standards for specifying a concrete syntax for the abstract language.
The concrete syntax could be a text or a graphical/diagrammatic syntax.
There are however a range of tools provided in modeling frameworks (particularly the
Eclipse Modeling Framework, EMF) for specifying a concrete text or diagrammatic
syntax for a language and for generating a language aware text or diagrammatic edi-
tor. For a specifying a concrete text syntax and generating a syntax aware text editor
one can use either XText or EMFText. For specifying a concrete diagrammatic syntax
and generating a diagrammatic editor one can use the Graphical Editing Framework
(GEF) and the Graphical Modeling Framework (GMF).
XML MetaData Interchange (XMI) can be used for any metadata whose metamodel
can be expressed in MOF or EMOF. It is commonly used to store models in tool and
vendor independent way. This could be, for example, UML models or models encoded
in some domain specific language (DSL). Note also that the metamodels themselves
are encoded in XMI.
1 \subimport{}{example.xmi}
10.2.4.1 Examples
1 context SavingsAccount
2 inv: self.balance >= 0
The following, more complex constraint demonstrated the navigation across the ob-
ject graph following association (incl specialization) links. The constraint specifies
that the sum of the amounts of all transactions made on an account must be equal
to the balance of an account:
1 context Account
2 inv: self.transactions−>collect(amount)−>sum() = self.balance
If the pre-condition is not met, the service may be refused. This this refusal is
typically communicated by raising an exception which is associated with that pre-
condition and since the contract made provision for refusing the service under these
10.2. MDA TOOLS 167
conditions, that refusal (and the catching of the associated exception) do not represent
errors in the service itself.
Post-conditions may also be applied to the return value of a service. For example, to
specify that after having found the numerical root of a function, the function value
at that numerically calculated root must be close to zero, we can use:
OCL has a rich semantics and also allows one to specify that during the realization
of a service, a particular service must be called. This is useful to specify constraints
at a particular level of granularity and can be seen analogous to using mock objects
when unit testing a service.
For example, we can use the following constraint to specify that during processing a
claim the determineClaimCoverage message must have been sent
As an example, consider the following QVT-O snippet which collects all primitive
attributes:
The transformation enforces (potentially writes) on both sides. The when clause
selects when transformation is enforced and the where clause specifies that the At-
10.2. MDA TOOLS 169
For example, to specify an URDAD services contract one specifies both, functional
requirements with pre- and post-conditions and the quality requirements.
For each precondition one specifies the exception which will be used to communicate
that the service was not provided due to that precondition not being met. Optionally
one can specify an inverse service through which lasting effects of a service can be
reversed, i.e. implementing a compensating work flow.
For a functional requirements one specifies requires links for traceability of to the
stakeholder who requires that functionality (the stakeholder can also be another ser-
vice). One also specified the data structures for the request and result objects.
1 ServiceContract enrollForPresentation
2 {
3 FunctionalRequirements receiving Variable enrollForPresentationRequest
4 ofType EnrollForPresentationRequest
5 {
6 PreCondition enrollmentPrerequisitesMet requiredBy (TrainingRegulator Student)
7 raises EnrollmentPrerequisitesNotSatisfiedException checks constraint
8 enrollmentPrerequisitesForPresentationMet with
9 ValueOf enrollForPresentationRequest
10 PostCondition enrollmentProcessPerformed requiredBy (Student Client TrainingRegulator)
11 ensures constraint studentEnrolledForPresentation
12 with ValueOf studentEnrolledRequest constructedUsing doSequential
13 {
14 create Variable studentEnrolledRequest ofType StudentEnrolledRequest
15 set Query OCL:”studentEnrolledRequest.personIdentifier”
16 equalTo Query OCL:”enrollForPresentationRequest.personIdentifier”
17 ...
18 }
19 PostCondition invoiceIssued ...
20 }
21 Request DataStructure EnrollForPresentationRequest
22 {
23 has identification presentationIdentifier identifying Presentation
24 ...
25 }
26 Result DataStructure EnrollForPresentationResult
27 {
28 has component proofOfEnrollment ofType ProofOfEnrollment
29 ...
30 }
31 }