Professional Documents
Culture Documents
Frank Buschmann
Kevlin Henney
ARCHITECTURE
Pattern-Oriented
Software Architecture
THE CRAFT OF SOFTWARE
Agenda
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 2 © Frank Buschmann, Kevlin Henney, all rights reserved
1
ARCHITECTURE
Where we are
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 3 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 4 © Frank Buschmann, Kevlin Henney, all rights reserved
2
ARCHITECTURE
Command
Application
Pattern-Oriented Software Architecture 5 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 6 © Frank Buschmann, Kevlin Henney, all rights reserved
3
ARCHITECTURE
beneficial properties.
Memento
Concrete Composite
• Create whole and balanced Command Command
designs that expose the
required operational and
developmental qualities. Application
Pattern-Oriented Software Architecture 7 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
patterns to create,
with economy and elegance, Telegram
Forwarder
Telegram
Receiver
passes telegrams to passes telegrams to
software designs and Telegram passes
Converter commands to
implementations applies
Command Logging
Logger
Processor Strategy
that work and meet their executes
expected quality attributes! creates
Command
Log
Alarms
Pick SetPoint
Workpiece Calculation
Pattern-Oriented Software Architecture 8 © Frank Buschmann, Kevlin Henney, all rights reserved
4
ARCHITECTURE
Where we are
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 9 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
A stand-alone pattern:
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 10 © Frank Buschmann, Kevlin Henney, all rights reserved
5
ARCHITECTURE
Solution
• Split an object into multiple halves – Client Protocol
one half per address space from
which the object is accessed.
• Within each half, fully implement all functionality that
can be executed locally without using the network.
• Implement functionality that crosses address spaces partially
in each half and coordinate the halves via a protocol.
Pattern-Oriented Software Architecture 11 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
A stand-alone pattern:
PATTTERN–ORIENTED SOFTWARE
• Is both a process and a thing, with the thing being created by the
process.
• Addresses a set of forces that completes the general problem by
describing requirements, constraints, and desired properties for the
solution.
• Introduces a set of interacting roles that can be arranged in many
different ways, not a fixed configuration of classes or components.
• Specifies a solution that is based on experience, judgment, and
diligence – it cannot necessarily be constructed in a straightforward
manner using a common engineering method.
Pattern-Oriented Software Architecture 12 © Frank Buschmann, Kevlin Henney, all rights reserved
6
ARCHITECTURE
Pattern-Oriented Software Architecture 14 © Frank Buschmann, Kevlin Henney, all rights reserved
7
ARCHITECTURE
Where we are
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 15 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern Complements
Although the two ideas seem distinct at first glance, competition and
cooperation are often very closely related.
Pattern-Oriented Software Architecture 16 © Frank Buschmann, Kevlin Henney, all rights reserved
8
ARCHITECTURE
Pattern in Competition
AbstractFactory AbstractProductA
create_productA ProductA • Resolve the same core problem, but present
dispose_productA
alternative solutions to it. Each solution
ConcreteFactory ConcreteProductA addresses different forces in context.
create_productA ProductA
dispose_productA
• Provide an overview of the problem's entire
solution space and allow developers to
decide, when to use what
Director Builder AbstractPartA pattern in the set.
create create_partA PartA
dispose dispose_partA
create_partB Examples:
dispose_partB
Builder ConcreteParttA
ParttA
• Objects for States, Methods
ConcreteBuilder
for States, Collection for
create_partA
dispose_partA AbstractPartB States
create_partB PartB
dispose_partB
• Abstract Factory, Builder
ConcretePartB
PartB
• Iterator, Batch Method,
Enumeration Method
Pattern-Oriented Software Architecture 17 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Iterator
Provide a way to access the elements of an aggregate object
sequentially without exposing its underlying representation.
Pattern-Oriented Software Architecture 18 © Frank Buschmann, Kevlin Henney, all rights reserved
9
ARCHITECTURE
Iterator's behavior
• Initializing an iteration, i.e. the initializer of a for loop
• Checking a completion condition, i.e. the continuation condition of a for loop
• Accessing a current target value, e.g. in the body of a for loop
• Moving to the next target value, i.e. the progression of a for loop
Type Type
Collection Iterator
1 *
createIterator() : Iterator finished() : Boolean {query}
«create» value() : Type {query}
next()
Pattern-Oriented Software Architecture 19 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Distribution Issues
client servant
Cost of communication
Pattern-Oriented Software Architecture 20 © Frank Buschmann, Kevlin Henney, all rights reserved
10
ARCHITECTURE
• The client and server parts spend far more time waiting on communication
than performing useful computation
• Therefore, provide the repetition in a data structure
• This is a coarser and more appropriate granularity that reduces
communication and synchronisation costs
• Batching can refer to passed sequences of values, result sequences of
values, or both passed and result sequences
Batch Method
Group multiple collection accesses together to reduce the cost of
multiple individual accesses in a distributed environment.
Pattern-Oriented Software Architecture 21 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Enumeration Method
Support encapsulated iteration over a collection by placing
responsibility for iteration in a method on the collection. The
method takes a Command object that is applied to the elements
of the collection.
Pattern-Oriented Software Architecture 22 © Frank Buschmann, Kevlin Henney, all rights reserved
11
ARCHITECTURE
approach
• Client is not responsible for loop housekeeping details
• Synchronization can be provided at the level of the whole traversal rather than
for each element access
• Sometimes known as the Internal Iterator pattern, but clearly has nothing in
common with (External) Iterator
Type Type
Collection Command
enumerationMethod(Command) executeOn(Type)
Pattern-Oriented Software Architecture 23 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern in Cooperation
Patterns in Cooperation
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 24 © Frank Buschmann, Kevlin Henney, all rights reserved
12
ARCHITECTURE
state change
• This cannot be handled adequately by the Iterator client
• Property-style programming, i.e. using fine-grained getters and
setters, is inappropriate
• There is a mismatch in granularity and coherence
Pattern-Oriented Software Architecture 25 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Combined Method
Combine methods that are commonly used together to guarantee
correctness and improve efficiency in threaded and distributed
environments.
Pattern-Oriented Software Architecture 26 © Frank Buschmann, Kevlin Henney, all rights reserved
13
ARCHITECTURE
Batched Iterators
component-based design
• A compound design that addresses many requirements
Iterator
Disposal
Method
Pattern-Oriented Software Architecture 27 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Batch Method
Iterator
Pattern-Oriented Software Architecture 28 © Frank Buschmann, Kevlin Henney, all rights reserved
14
ARCHITECTURE
Pattern Compounds
• Describe recurring * *
arrangements of several tightly Abstract Abstract
Node Node
integrated patterns that together Parent Parent
resolve more complex problems
than each constituent pattern Request
Mediator
alone can do.
• List what patterns help resolving Bureaucracy
the core problem. Abstract
Node Parent
• Specify how all patterns integrate *
with one another. Atomic Composite
Node Node
Example:
• Bureaucracy integrates Composite, Chain of Responsibility, Observer, and
Mediator to model complex, collaborative hierarchical structures.
Pattern-Oriented Software Architecture 29 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Element or Compound?
Pattern-Oriented Software Architecture 30 © Frank Buschmann, Kevlin Henney, all rights reserved
15
ARCHITECTURE
Pattern-Oriented Software Architecture 31 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Where we are
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 32 © Frank Buschmann, Kevlin Henney, all rights reserved
16
ARCHITECTURE
Pattern Stories
Pattern Stories
PATTTERN–ORIENTED SOFTWARE
Reflection
• Are like diaries that tells their readers
how one specific software system,
Proxy
subsystem, or large component was Proxy Facade Adapter
developed with the help of patterns.
They discuss: Forwarder-
Receiver
• What specific problems were to be
resolved in what specific order.
• What patterns were considered Strategy Strategy
and selected to resolve the problems.
Acceptor- Reactor
• How the selected patterns were Conector
instantiated within the system’s
specific context and architecture.
Broker
Pattern-Oriented Software Architecture 33 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 34 © Frank Buschmann, Kevlin Henney, all rights reserved
17
ARCHITECTURE
Systems requires:
• defining an appropriate base-line
architecture that specifies the system's
functional and infrastructural subsystems,
their relationships and key interactions.
• developing/selecting suitable
component/communication middleware. ERP
• designing and implementing the Warehouse
Management
system's functionality with H
Warehouse DB
sufficient quality: performance, C Representation Access
I Material Flow
stability, scalability, extensibility, etc. Control
Fault
• providing an efficient connection of Mgr
the system with the database. User
Mgr
Base Automation
• designing a user-friendly user interface.
Pattern-Oriented Software Architecture 35 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Material Flow
Control
Warehouse
Representation
Fault
Mgr
?DB
Access
Pattern-Oriented Software Architecture 36 © Frank Buschmann, Kevlin Henney, all rights reserved
18
ARCHITECTURE
Pattern-Oriented Software Architecture 37 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Layers at a Glance
Problem
PATTTERN–ORIENTED SOFTWARE
Infrastructure Layer
Solution
• Define one or more layers for the software under development with each
layer having a distinct and specific responsibility, for instance, regarding
abstraction, granularity, or rate of change.
Pattern-Oriented Software Architecture 38 © Frank Buschmann, Kevlin Henney, all rights reserved
19
ARCHITECTURE
Partition the system into multiple interacting Layers with each layer
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 39 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Access
Pattern-Oriented Software Architecture 40 © Frank Buschmann, Kevlin Henney, all rights reserved
20
ARCHITECTURE
Interface
Problem InterfaceMethod1
PATTTERN–ORIENTED SOFTWARE
InterfaceMethod2
How can we partition the functionality
in a system such that:
• Each self-contained unit of functionality Implementation
is decoupled as much as possible from Two forms of
domain object
other self-contained units of functionality.
Name Sharedname Files Types
Referenced
Manifest
• Any unit of self-contained functionality
Version Hash Security
Assemblies
Custom Product
Attributes Information
Resources
Solution
Encapsulate each self-contained functionality into a domain object
• An interface provides the accessible methods of the domain object.
• An implementation realizes the offered functionality of the domain object.
Pattern-Oriented Software Architecture 41 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 42 © Frank Buschmann, Kevlin Henney, all rights reserved
21
ARCHITECTURE
Pattern-Oriented Software Architecture 43 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Problem
PATTTERN–ORIENTED SOFTWARE
Solution
Physically separate the interface of the component from its implementation
and export the interface to the clients of the component:
• An explicit interface realizes the published contract of a component.
• An encapsulated implementation realizes the component's functionality.
Pattern-Oriented Software Architecture 44 © Frank Buschmann, Kevlin Henney, all rights reserved
22
ARCHITECTURE
Pattern-Oriented Software Architecture 45 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Warehouse
Topology
Pattern-Oriented Software Architecture 46 © Frank Buschmann, Kevlin Henney, all rights reserved
23
ARCHITECTURE
Broker at a Glance
Broker
Node 1
Solution Connection IPC
Establishment
Pattern-Oriented Software Architecture 48 © Frank Buschmann, Kevlin Henney, all rights reserved
24
ARCHITECTURE
Pattern-Oriented Software Architecture 49 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Model-View-Controller at a Glance
Problem
PATTTERN–ORIENTED SOFTWARE
View Controller
How can we develop user interfaces that:
myModel 1 1 myModel
• Support adaptation and change without myControllers myView
init() init()
affecting the application’s functional core. makeCtrls() handleEvent()
activate() update()
• Display the current state of computation display() *
and respond to state changes immediately. update()
*
Solution Model
myObservers
Divide an interactive application into three coreData
loosely coupled parts: attachObs()
detachObs()
• A model object encapsulates an entity from notify()
getData()
the application's functional core. service()
• Views present data and information to the user.
• Controllers are associated with views and allow manipulation of the
presented data and information.
Pattern-Oriented Software Architecture 50 © Frank Buschmann, Kevlin Henney, all rights reserved
25
ARCHITECTURE
Use a Model-View-Controller
PATTTERN–ORIENTED SOFTWARE
arrangement to minimize
the coupling between
domain objects in the
presentation layer and
domain objects in the
business layers, and
ensure their efficient
cooperation and
mutual consistency.
Pattern-Oriented Software Architecture 51 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 52 © Frank Buschmann, Kevlin Henney, all rights reserved
26
ARCHITECTURE
Realize the domain object as a Half-Object plus Protocol that splits its
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 54 © Frank Buschmann, Kevlin Henney, all rights reserved
27
ARCHITECTURE
ERP
How can we provide concurrent
access to a shared domain Warehouse
Management
object such that clients can H
Warehouse DB
C
always issue their requests I
Representation Access
Material Flow
without blocking? Control
Fault
Mgr
User
Mgr
Base Automation
Pattern-Oriented Software Architecture 55 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Problem
PATTTERN–ORIENTED SOFTWARE
Activation
How can we provide access to large Proxy Scheduler
List
concurrent components such that: method_1() insert() insert()
method_N() dispatch() remove()
• Clients are not blocked if their request
cannot be executed immediately.
creates creates * maintains
Future MethodRequest Servant
Solution guard() method_1()
call() method_N()
Decouple method invocation from method
execution in both space and time:
• A proxy allows clients a thread-local access Concrete Concrete
to the component, a servant implements MethodRequest1 MethodRequest2
the component in a separate thread.
• Service requests are objectified as method requests, maintained in an
activation list, and invoked on the servant by a scheduler once they
become executable.
Pattern-Oriented Software Architecture 56 © Frank Buschmann, Kevlin Henney, all rights reserved
28
ARCHITECTURE
Pattern-Oriented Software Architecture 57 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
management system can generate, for instance, errors and traces, are
logged for later evaluation.
However, using the logging functionality
should only have a minimal impact event
on the system’s operational qualities.
event
event
event
event
event
event
event event
How can we avoid having logging event event
event
become a performance
bottleneck, especially when
a high number of logging
records must be processed?
Logging Service
Pattern-Oriented Software Architecture 58 © Frank Buschmann, Kevlin Henney, all rights reserved
29
ARCHITECTURE
Leader/Followers at a Glance
follower
threads
Problem processing
PATTTERN–ORIENTED SOFTWARE
threads Event
How can we design an event-driven Handler
Event
component such that:
Handler
• A high-volume of events can be
processed concurrently.
Event Event
Handler Handler
Solution
Introduce a thread pool in which multiple Event Event
threads share a common event source: Handler Handler
Pattern-Oriented Software Architecture 60 © Frank Buschmann, Kevlin Henney, all rights reserved
30
ARCHITECTURE
Pattern-Oriented Software Architecture 61 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
31
ARCHITECTURE
Pattern-Oriented Software Architecture 63 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 64 © Frank Buschmann, Kevlin Henney, all rights reserved
32
ARCHITECTURE
The End
ERP
Warehouse
Management
H
Warehouse DB
C Representation Access
I Material Flow
Control
Fault
Mgr
User
Mgr
Base Automation
Pattern-Oriented Software Architecture 65 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern Sequences
Pattern Sequences
PATTTERN–ORIENTED SOFTWARE
• Remove the story from a pattern story and describe how a type of software
system, subsystem, or component can be developed with patterns using a
particular solution approach or architectural style.
They discuss: Layers
→ Domain Object
• What type of problems are → Explicit Interface
to be resolved in what → Encapsulated Implementation
→ Broker creates
typical order. → Model-View-Controller
→ Half-Object plus Protocol
• How the selected patterns → Active Object
are typically integrated with → Leader / Followers
one another according to → Database Access Layer
ERP
approach. H
C Warehouse
Representation
DB
Access
I
Material Flow
Control
Fault
Mgr
User
Mgr
Base Automation
Pattern-Oriented Software Architecture 66 © Frank Buschmann, Kevlin Henney, all rights reserved
33
ARCHITECTURE
Pattern Stories:
☺ Describe the pattern-based software
development of a specific system (part).
Describe one system instance only.
Pattern Sequences:
☺ Describe the pattern-based software
development of a type of system (part).
Cover one architectural style only.
Pattern-Oriented Software Architecture 67 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Warehouse
Management
H
Warehouse DB
C Representation Access
I
Material Flow
Control
Fault
Mgr
User
Mgr
Base Automation
Pattern-Oriented Software Architecture 68 © Frank Buschmann, Kevlin Henney, all rights reserved
34
ARCHITECTURE
Warehouse
Topology
Pattern-Oriented Software Architecture 69 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Messaging at a Glance
35
ARCHITECTURE
• Design the explicit interfaces of services so that they can receive request
messages asynchronously.
• Realize encapsulated implementations of the services so that they
dispatch messages on concrete functions and deliver response messages
asynchronously to message senders.
Pattern-Oriented Software Architecture 71 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 72 © Frank Buschmann, Kevlin Henney, all rights reserved
36
ARCHITECTURE
Presentation-Abstraction-Control at a Glance
TopLevelAgent
Problem
PATTTERN–ORIENTED SOFTWARE
Use a Presentation-Abstraction
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 74 © Frank Buschmann, Kevlin Henney, all rights reserved
37
ARCHITECTURE
Pattern-Oriented Software Architecture 75 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Problem Replicas
PATTTERN–ORIENTED SOFTWARE
Solution
Client Synchronization
• Split a component into multiple replicas – Protocol
one half per address space from
which the object is accessed.
• Synchronize the state of the replicas via a protocol.
Pattern-Oriented Software Architecture 76 © Frank Buschmann, Kevlin Henney, all rights reserved
38
ARCHITECTURE
Pattern-Oriented Software Architecture 77 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
management system can generate, for instance, errors and traces, are
logged for later evaluation.
However, using the logging functionality
should only have a minimal impact event
on the system’s operational qualities.
event
event
event
event
event
event
event event
How can we avoid having logging event event
event
becomes a performance
bottleneck, especially when
a high number of logging
records must be processed?
Logging Service
Pattern-Oriented Software Architecture 78 © Frank Buschmann, Kevlin Henney, all rights reserved
39
ARCHITECTURE
Half-Sync/Half-Async at a Glance
Problem
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 79 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 80 © Frank Buschmann, Kevlin Henney, all rights reserved
40
ARCHITECTURE
Pattern-Oriented Software Architecture 81 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 82 © Frank Buschmann, Kevlin Henney, all rights reserved
41
ARCHITECTURE
Pattern-Oriented Software Architecture 83 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
42
ARCHITECTURE
Pattern-Oriented Software Architecture 85 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Where we are
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 86 © Frank Buschmann, Kevlin Henney, all rights reserved
43
ARCHITECTURE
Pattern-Oriented Software Architecture 87 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern Languages
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 88 © Frank Buschmann, Kevlin Henney, all rights reserved
44
ARCHITECTURE
Pattern Languages
PATTTERN–ORIENTED SOFTWARE
An Example
Pattern-Oriented Software Architecture 89 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Four observations:
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 90 © Frank Buschmann, Kevlin Henney, all rights reserved
45
ARCHITECTURE
Pattern-Oriented Software Architecture 91 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Audience
Pattern-Oriented Software Architecture 92 © Frank Buschmann, Kevlin Henney, all rights reserved
46
ARCHITECTURE
Structure
Content
Pattern-Oriented Software Architecture 94 © Frank Buschmann, Kevlin Henney, all rights reserved
47
ARCHITECTURE
Presentation (1)
Pattern-Oriented Software Architecture 95 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Presentation (2)
Alexandrian form
• Stars rating the maturity of the
pattern
• General context and "inbound"
patterns – those patterns in
whose realizations the pattern
can be of use
• Problem and forces
• Solution description and visual
sketch
• Discussion of consequences,
core implementation hints, and
"outbound" patterns that can help
realizing the solution
Pattern-Oriented Software Architecture 96 © Frank Buschmann, Kevlin Henney, all rights reserved
48
ARCHITECTURE
Known Uses
Pattern-Oriented Software Architecture 97 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
management system:
• Reactor to dispatch logging records
that can arrive currently to multiple
(concurrent) handlers that process
the records
• Component Configurator to support
(re-)configuration and deployment
without degrading availability
• Application Controller to provide
workflow support ERP
Warehouse
Management
Base Automation
Pattern-Oriented Software Architecture 98 © Frank Buschmann, Kevlin Henney, all rights reserved
49
ARCHITECTURE
Pattern-Oriented Software Architecture 99 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Reactor at a Glance
Reactor Event Handler
unregister()
How can we provide an event handle_events() owns
as Event Handlers. }
Pattern-Oriented Software Architecture 100 © Frank Buschmann, Kevlin Henney, all rights reserved
50
ARCHITECTURE
Run-Time Configurability
Pattern-Oriented Software Architecture 101 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Component Component
Problem Configurator Repository
PATTTERN–ORIENTED SOFTWARE
*
Solution
Configuration
Interface
Provide an infrastructure for run-time init()
lifecycle control of components. fini()
suspend()
• Components provide Configuration Interfaces resume()
separated from their operational interfaces info()
service()
• A Component Repository maintains the
component (to be) used in a specific
system configuration.
• A Component Configurator controls and Concrete Concrete
Component1 Component2
monitors the deployment and configuration
of components.
Pattern-Oriented Software Architecture 102 © Frank Buschmann, Kevlin Henney, all rights reserved
51
ARCHITECTURE
Workflow Support
Pattern-Oriented Software Architecture 103 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
displays executes
How can we design workflow-oriented gets views
user interfaces so that: & commands
52
ARCHITECTURE
Pattern Languages
PATTTERN–ORIENTED SOFTWARE
The Concept
Pattern-Oriented Software Architecture 105 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Database
Acccess
From Mud
Language to Structure Application
Entry Control
Object
Interaction
Distribution
Infrastructure
Interface
Partitioning
Component
Partitioning generates
Adaptation & Modal
Extension Behavior
Resource
Synchronization Management
Pattern-Oriented Software Architecture 106 © Frank Buschmann, Kevlin Henney, all rights reserved
53
ARCHITECTURE
Proxy Proxy
Broker
Request Logging
ThreadPool
Handler
Service Service *
Request Request
Database
Acccess WarehouseRepHalfX
From Mud
Language To Structure Application
Entry Control
Object ERP
Interaction
Fault
Event Handling Concurrency Mgr
User
Resource
Many more...
Mgr
Synchronization Management Base Automation
Pattern-Oriented Software Architecture 107 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
The Things
Pattern-Oriented Software Architecture 108 © Frank Buschmann, Kevlin Henney, all rights reserved
54
ARCHITECTURE
Pattern-Oriented Software Architecture 109 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 110 © Frank Buschmann, Kevlin Henney, all rights reserved
55
ARCHITECTURE
Quality
Resource
Synchronization Management
Pattern-Oriented Software Architecture 111 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Forces
Database
Acccess
Resource
Synchronization Management
Pattern-Oriented Software Architecture 112 © Frank Buschmann, Kevlin Henney, all rights reserved
56
ARCHITECTURE
Context
Language-specific Context
Half-Sync/Half-Async **
When developing a concurrent
Encapsulated Implementation or a
network server that employs a Reactor or
Proactor event handling infrastructure ... Language
... we need to make performance efficient Topology
and scalable while also ensuring that any
use of concurrency simplifies programming.
General Context
Pattern-Oriented Software Architecture 113 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern Sequences
Pattern-Oriented Software Architecture 114 © Frank Buschmann, Kevlin Henney, all rights reserved
57
ARCHITECTURE
Genericity (1)
Pattern-Oriented Software Architecture 115 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Genericity (2)
AdminClient PickingClient
Admin
Controllres
Admin
Views
Picking
Controllres
Picking
Views Genericity implies that a pattern
PATTTERN–ORIENTED SOFTWARE
Proxy Proxy
Broker language can "be implemented a
Distribution
Infrastructure
Broker
OS-Access
Layer
Component
Configurator
million times over without ever
Communication Component
Services Configurator being twice the same".
Broker Broker Christopher Alexander
Scheduler/
Reactor
ActivationList
Service
Request Logging
ThreadPool
Handler
Scheduling
Service Service * Client
FIFO
Strategy
Request Request Database
Service
Acccess Future
Interface
Scheduler
WarehouseRepHalfX
Language From Mud
Application Activation
to Structure
Entry Control
*
List
Object A. Method
Memento
Request
Interaction
Virtual_ Distribution Interface Component
LFU Evictor Macro Store Fetch
Filesystem
Infrastructure Partitioning Partitioning Command Item Item
Abstract_
LRU Guard Storage Leafs LoadIn Warehouse
Eviction Adaptation & Modal Capacity Only Layers Core
Extension Behavior
Storage Abstract Abstract Abstract
Thread_ Manager Visitor Iterator Strategy
Pool * *
Abstract
shares join() dispatches Event Handling Concurrency Storage Successor
leader() *
* SOC Atomic Composite
Event_ Resource
Reactor (de)
Factory Storage Storage
Handler
Synchronization Management *
*
maintains *
activates
owns Concurrent Hazardous
SOC
Bin Warehouse Aisle
*
select()
notifies
Handle
Event Handling Component Hazardous
Value
Real
Bin
HTTP_
Acceptor
HTTP_
Handler
Infrastructure
Pattern-Oriented Software Architecture 116 © Frank Buschmann, Kevlin Henney, all rights reserved
58
ARCHITECTURE
Maturity
Consequently:
• The arrangement of patterns in a language …
• The concrete patterns of a language …
• The pattern descriptions …
… are subject to continuous revision, improvement, and evolution!
Pattern-Oriented Software Architecture 117 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Smart Solutions
Pattern-Oriented Software Architecture 118 © Frank Buschmann, Kevlin Henney, all rights reserved
59
ARCHITECTURE
Understanding
ERP
Proxy Proxy
Broker
Broker
Warehouse
Fault Scheduler/
Reactor
Mgr ActivationList
WarehouseRepHalfX
Pattern-Oriented Software Architecture 119 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
construction.
A Telegram Handling Framework
Much of today's software is consciously Core-
Implementation
Core Architecture
Forwarder-
designed with pattern languages. Forwarder Receiver Receiver
}
Command Logging Strategy
• Real-Time (Tele-)
private:
void pack(Msg& m); Processor Strategy
void deliver(Msg& m);
Communication Applications
};
Log
• Power Distribution
• Warehouse Management
Command
• Middleware
• Media and News Distribution
Pattern-Oriented Software Architecture 120 © Frank Buschmann, Kevlin Henney, all rights reserved
60
ARCHITECTURE
How are they designed, how do they work, why are they how they are?
• CORBA / CCM Application Domain A Application Domain B
• Swing
• .NET Transparent Proxy .NET
Remoting
Real Proxy
Stack Builder Sinks
• … Envoy Sinks
Channels Network
Server Context Sinks
Channels
Formatters Formatters
Broker How can you structure a distributed system so that application developers don’t have to concern themselves
with the details of remote communication?
Implementing Broker with .Net Remoting How do you Implement Broker in .Net?
Singleton How do you make an instance of an object globally available and guarantee that only one instance of the
class is created?
Pattern-Oriented Software Architecture 121 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
• Product-Line Architectures
Pattern-Based Architecture
Style Selection
Code Framework
#include <iostream.h>
Generation Configuration
#include “FooS.h”
CORBA::Object_var obj =
orb->resolve_initial_references(“RootPOA”);
PortableServer::POA_var poa =
PortableServer::POA::_narrow(obj);
Pattern-based
PortableServer::POAManager_var mgr =
poa->the_POAManager();
mgr->activate();
Architecture Refinement
FooI_var foo = foo_servant._this();
CORBA::String_var str =
orb->object_to_string(foo);
cout << str.in() << endl;
Pattern-Oriented Software Architecture 122 © Frank Buschmann, Kevlin Henney, all rights reserved
61
ARCHITECTURE
pattern language:
• A common misconception that
the GOF never claimed.
• It is the map in the book that
causes this misconception.
But a map is not the territory!
• It is largely not about uses relationships.
• The uses shown are often not useful.
The map is sometimes misleading:
• What is the most important pattern?
• What are the most isolated patterns?
Pattern-Oriented Software Architecture 123 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Where we are
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 124 © Frank Buschmann, Kevlin Henney, all rights reserved
62
ARCHITECTURE
Observations (1)
Broker
Pattern-Oriented Software Architecture 125 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Observations (2)
}
private: Command Logging Strategy
• Patterns for flexibility and configuration void pack(Msg& m);
void deliver(Msg& m);
};
Processor Strategy
manner.
Do This Do That
Pattern-Oriented Software Architecture 126 © Frank Buschmann, Kevlin Henney, all rights reserved
63
ARCHITECTURE
Soft Benefits
Pattern-Oriented Software Architecture 127 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Hard Benefits*
Pattern-Oriented Software Architecture 128 © Frank Buschmann, Kevlin Henney, all rights reserved
64
ARCHITECTURE
Caveats
• Hype / Resistance
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 129 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Lessons Learned
• JUST DO IT!
Pattern-Oriented Software Architecture 130 © Frank Buschmann, Kevlin Henney, all rights reserved
65
ARCHITECTURE
Where we are
Introduction
PATTTERN–ORIENTED SOFTWARE
Stand-Alone Patterns
Pattern Languages
Outroduction
References
Pattern-Oriented Software Architecture 131 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
The Gang of Four book is the first, and still the most popular pattern
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 132 © Frank Buschmann, Kevlin Henney, all rights reserved
66
ARCHITECTURE
Pattern-Oriented Software Architecture 133 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
A System of Patterns
A System Of Patterns is the first volume of the POSA series and the
PATTTERN–ORIENTED SOFTWARE
Pattern-Oriented Software Architecture 134 © Frank Buschmann, Kevlin Henney, all rights reserved
67
ARCHITECTURE
Pattern-Oriented Software Architecture 135 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 136 © Frank Buschmann, Kevlin Henney, all rights reserved
68
ARCHITECTURE
Pattern Concept
• Stand-Alone Patterns
• Pattern Complements
• Pattern Compounds
• Pattern Stories
• Pattern Sequences
• Pattern Languages
Pattern-Oriented Software Architecture 138 © Frank Buschmann, Kevlin Henney, all rights reserved
69
ARCHITECTURE
Security Patterns
Pattern-Oriented Software Architecture 139 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 140 © Frank Buschmann, Kevlin Henney, all rights reserved
70
ARCHITECTURE
Pattern-Oriented Software Architecture 141 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Remoting Patterns
31 patterns:
• Basic Remoting: patterns that detail the Broker architecture
underlying remoting infrastructures.
• Identification: patterns that help finding and accessing
remote objects.
• Lifecycle Management: patterns that address the lifecycle
of remote objects and support resource management.
• Extension: patterns that allow to add out-of-band
and QoS functionality to remote objects.
• Invocation Asynchrony: patterns that support asynchronous
access to remote objects.
• The book also includes technology projections of the
language onto .NET, CORBA, and Web Services.
It thus provides a vendor-independent view onto remoting.
Pattern-Oriented Software Architecture 142 © Frank Buschmann, Kevlin Henney, all rights reserved
71
ARCHITECTURE
Pattern-Oriented Software Architecture 143 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 144 © Frank Buschmann, Kevlin Henney, all rights reserved
72
ARCHITECTURE
Pattern-Oriented Software Architecture 145 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 146 © Frank Buschmann, Kevlin Henney, all rights reserved
73
ARCHITECTURE
Pattern-Oriented Software Architecture 147 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 148 © Frank Buschmann, Kevlin Henney, all rights reserved
74
ARCHITECTURE
PLoPD Series
Pattern-Oriented Software Architecture 149 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
J2EE Patterns
Pattern-Oriented Software Architecture 150 © Frank Buschmann, Kevlin Henney, all rights reserved
75
ARCHITECTURE
.NET Patterns
Cluster Problem
Web Presentation How do you create dynamic Web applications?
Pattern-Oriented Software Architecture 151 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Programming Patterns
Pattern-Oriented Software Architecture 152 © Frank Buschmann, Kevlin Henney, all rights reserved
76
ARCHITECTURE
Analysis Patterns
Pattern-Oriented Software Architecture 153 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Domain-Driven Design
Pattern-Oriented Software Architecture 154 © Frank Buschmann, Kevlin Henney, all rights reserved
77
ARCHITECTURE
Pattern Almanac
Pattern-Oriented Software Architecture 155 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
Pattern-Oriented Software Architecture 156 © Frank Buschmann, Kevlin Henney, all rights reserved
78
ARCHITECTURE
References (1)
Pattern-Oriented Software Architecture 157 © Frank Buschmann, Kevlin Henney, all rights reserved
ARCHITECTURE
References (2)
Pattern-Oriented Software Architecture 158 © Frank Buschmann, Kevlin Henney, all rights reserved
79
ARCHITECTURE
References (3)
Pattern-Oriented Software Architecture 159 © Frank Buschmann, Kevlin Henney, all rights reserved
80