1. SA Styles, Patterns, and Tactics
Henry Muccini
DISIM, University of L’Aquila henry.muccini@univaq.it,
@muccinihenry
DISIM
Dep.nt of Information Engineering, Computer Science and Mathematics
University of L’Aquila, Italy
2. The material in these slides may be freely reproduced
and distributed, partially or totally, as far as an explicit
reference or acknowledge to the material author is
preserved.
SEA Group
Henry Muccini
6. SEA Group
“A set of design rules that identify the kinds of components
and connectors that may be used to compose a system
or subsystem, together with local or global constraints on
the way the composition is done” (Shaw & Clements, 1996)
A set of constraints you put on your development to elicit desirable
properties from your software architecture.
Topological
Behavioral
Communication-oriented
etc. etc.
IMP
9. Many similarities between patterns and styles
But they have come from different communities
Differences
SEA Group
Architectural Styles Design Patterns
Few Many
Large-scale system
organization
Localized, small-scale
design solutions
10. 1. The top of a component may be connected to the
SEA Group
bottom of a single connector.
2. The bottom of a component may be connected to
the top of a single connector.
3. There is no bound on the number of components
or connectors that may be attached to a single
connector.
4. When two connectors are attached to each other,
it must be from the bottom of one to the top of
the other.
5. Components can communicate only through
connectors
11. The communication between components and connectors is
achieved solely exchanging messages
The communication is based on notifications and requests
Both component top domain and bottom domain can notify or
request messages
SEA Group
Comp2
Comp1
Top
Bottom
Top
Requests Notifications
Comp2 receives a request Comp2 sends a notification
Comp1 sends a request
Bottom Comp1 receives a request
Comp1 receives a notification
Comp1 sends a notification
14. 1. The top of a component may be connected to the bottom
SEA Group
of a single connector.
Comp1 NOT Permitted
Connector Bottom
Comp1
Connector Top
15. 2. The bottom of a component may be connected to the top
SEA Group
of a single connector.
Comp1
NOT Permitted
Comp1
Connector Bottom
Connector Top
16. 3. There is no bound on the number of components or
SEA Group
connectors that may be attached to a single connector.
Comp1 Comp2 Comp3
Permitted
17. 4. When two connectors are attached to each other, it must
SEA Group
be from the bottom of one to the top of the other.
Connector Bottom
Connector Top
Connector Bottom
Connector Top
Connector Bottom
Connector Top
Permitted
Connector Bottom
Connector Top
Connector Bottom
Connector Top
NOT Permitted
18. 5. Components can communicate only through
SEA Group
connectors
Comp1
Comp2
NOT Permitted
Permitted:
Following rule 4
19. SEA Group
ADL TOOLS DATE SUPPORT FOR ARCHITECTURAL STYLES
AADL Osate 2001
Descrizione di proprietà ed interfacce relative a componenti
+
configurazioni di intercambio XML/XMI
ACME Acme Studio+Armani 1995 Interscambio architetturale prevalentemente a livello strutturale
ArchiTrio Trident 1990 Unisce lo stile delle notazioni standard UML 2.0 ai formalismi logico-temporali di TRIO
ArchJava AcmeArchJava 2002 Supporta uno stile di programmazione flessibile orientato agli oggetti
CommUnity
CommUnity
WorkBench
2002 Linguaggio che si rispecchia negli stili UNITY ed IP
DARWIN LTSA-WS + SAA 1991 Architetture di sistemi distribuiti il cui dinamismo è guidato da un supporto severo e formale
EAST-ADL AutoFocus2 2001/2004 La descrizione degli elementi del linguaggio è suddivisa in sei parti (domini)
Ménage/xAD
L
ArchStudio+Ménage 2000 Introduce la distinzione tra prescription e description della SA
PRISMA PrismaCase 2002 Definizione di elementi architetturali a due diversi livelli di astrazione
xArch/xAcm
e
Acme Studio 2001
Versione recente del linguaggio Acme che ne mantiene le caratteristiche di base, specificate
però in XML
xArch/xADL ArchStudio+Apigen 2000 Introduce la distinzione tra prescription e description della SA
21. SEA Group
C2 Style
Pipes and filters
Layered systems
Blackboard style
Implicit Invocation
Idealized FT Component Model
Peer to peer
Hypertext style (!)
MVC
RUP
23. Layered Style
SEA Group
Java Virtual Machine
Java
Java
Operating
Processor
System
Virtual Machine
Application
(Virtual Machine Style)
24. The Layered System Style
A layered system is organized hierarchically, each layer providing service
to the layer above and below
Components
Connectors
SEA Group
Procedure calls or system calls
Stylistic invariants
25. Application
Presentation
SEA Group
Session
Transport
Network
Data Link
Physical
Application
Presentation
Session
Transport
Network
Data Link
Physical
Network
Data Link
Physical
Network
Data Link
Physical
30. The Blackboard Style
This style is characterized by a central data structure and a collection of components
operating on the central data store
The Blackboard is characterized by three main types of components
(Corkill, 1991):
Connector
Property
SEA Group
34. SEA Group
HTTP
Browser Clients
(asynchronous RPC)
www.sitoweb.it
www.website.com
Netscape
Navigator
Microsoft
IE
Web
Servers
www.laudaweb.it
• Load balancing
• Cooperative caching
• Use of geographic distribution of the server machines.
35. Client/Server Systems
Client/Server systems are the most common specialization (restriction) of
SEA Group
the peer-to-peer style
One component is a server offering a service
The other components are clients using the service
Server implementation is transparent but can be centralized or distributed,
single-threaded or multi-threaded
37. 3-Tier Client/Server Systems
3-Tier Client/Server systems are a common class of distributed business
SEA Group
systems
First tier: Client (user interface) tier
Second (middle, “business logic”) tier: Servers acting as “business objects”,
encapsulating abstract, integrated models of multiple, disparate data
sources
Third (back-end, database) tier: Legacy business applications providing data
services
38. SEA Group
WHAT IS P2P?
There are 3 types of P2P System:
1st: Napster
42. Advantages
Disadvantages
SEA Group
Distributed state
Potential for deadlock, starvation, race conditions, service outages
Data marshalling and unmarshalling
Proxies and stubs for RPC
Legacy wrappers
44. SEA Group
Program unit (object, process, block, module, method,
class, component, etc.)
Interface Exception Failure Exception
Local Exception
Reply
Normal Processing Error Processing
Return to normal
Service Request
Service Request Reply
Interface Exception Failure Exception
45. •The normal part implements the component’s normal services
•The exceptional part implements the responses of the
component to exceptional situations, by means of exception-handling
SEA Group
techniques.
•When the normal behavior of a component raises an exception
(local exception) its exception handling part is automatically
invoked. If the exception is successfully handled the component
resumes its normal behavior, otherwise an external exception is
signalled.
•External exceptions are signalled to the enclosing context when
the component realizes that is not able to provide the service.
50. There is some smoke on the first apartment in the 4th floor, on Avenue de Fortune
26. A smoke sensor detects the smoke, potential source of a fire, and informs a local
server. The local server posts the information on-line, and this information is
accessible from the fire station. The fire station has a view on all the alarms and
warnings happening at the all time. The system monitors the status of alarms and
informs the fire fighters about the entity of the fire, the time it started, the area
covered by it, and other sensitive information. Based on such information, the
system decides where to send the fire trucks (in case only a limited set of fires can
be managed in parallel). The fire fighters jump into the fire truck, turn in their
onboard computing system, and get information about the fastest way to get to
destination. During the trip, they get all possible updates about the state of the fire.
Based on this information, they may decide that a second truck is needed, or one is
closer to Avenue de Fortune, or that their service is not needed anymore. When the
fire fighters arrive to Avenue de Fortune 26, the entire 4th floor is on fire. By using
other sensors, they may know how many people is trapped inside the building: this
information is displayed on their devices. Fortunately, nobody is inside the building
at this time. Before starting extinguishing the fire, the system discovers that there
are some gas cylinders on the 6th floor. They first start securing those devices, and in
parallel extinguishing the fire on the 4th floor.
SEA Group
52. Patterns are constructed from different tactics
A tactic promotes a specific quality attribute
Tactics can be used to enhance existing patterns
SEA Group
53. What you shall have learned
You shall:
SEA Group
Layered systems
Blackboard style
Peer to peer
…
54. Software Architecture in Practice, chapter 13
[SC97] A Field Guide to Boxology: Preliminary Classification
of Architectural Styles for Software Systems, M. Shaw and
P. Clements, In Proc. COMPSAC97, 21st Int'l Computer
Software and Applications Conference, August 1997, pp. 6-
13.
SEA Group