Professional Documents
Culture Documents
Ics123 02 Architecture
Ics123 02 Architecture
Ics123 02 Architecture
Software Architecture
* with very special thanks to David S. Rosenblum for the use of his materials.
Software Architecture
Topic 2
Software
Architecture
(Perry & Wolf 92)
ICS 123
2
Software Architecture
Topic 2
Software
Architecture
(Garlan & Shaw 93)
ICS 123
3
Software Architecture
Topic 2
Software
Architecture
(Shaw & Garlan 96)
ICS 123
4
Analogies with
Topic 2
Software
Architecture
Civil Architecture
ICS 123
Civil Engineering and Civil Architecture
are concerned with the engineering and design of
civic structures (roads, buildings, bridges, etc.)
• Architecture vs. Construction
• Multiple views
– Civil: Artist renderings, elevations, floor plans, blueprints
– Software: Code, object design, boxes-and-arrows, GUI
• Architectural styles
– Civil: Classical, Romanesque, Gothic, Renaissance, Baroque, Art Deco
– Software: Pipe-and-filter, client/server, layered system
6
Elements of Software
Topic 2
Software
Architecture
Architecture
ICS 123
7
Topic 2
Software
Architecture
Components
ICS 123
8
The Difference Between
Topic 2
Software
Architecture
Components and Objects
ICS 123
• Lifecycle
– Objects are created and destroyed constantly
– Components are created and destroyed infrequently
• Purpose of use
– Graphics toolkit (component) vs. graphics widget (object)
– Data store (component) vs. data structure (object)
• Type system
– Objects are instances of a class, with classes arranged in hierarchies according
to inheritance relationships
– Components may have their own type system (may be trivial), often very few
components of the same type
• Size
– Objects tend to be small
– Components can be small (one object) or large (a library of objects or a
complete application)
9
Topic 2
Software
Architecture
Connectors
ICS 123
10
The Difference Between
Topic 2
Software
Architecture
Components and Connectors
ICS 123
• Task Performed
– Components focus on computational tasks
– Connectors focus on communication tasks
• Application Semantics
– Components generally implement most of the application semantics
– Connectors do not (they may change the form of the message, but do
not generally change its meaning)
• “Awareness”
– Components (should be) unaware of who is using them and for what
purpose
– Connectors are more aware of components connected to them so they
can better facilitate communication
12
Topic 2
Software
Architecture
Configurations
ICS 123
• A configuration is …
– The overall structure of a software architecture
– The topological arrangement of components and connectors
» Implies the existence of links among components/connectors
– A framework for checking for compatibility between interfaces,
communication protocols, semantics, …
13
Topic 2
Software
Architecture
Graphically…
ICS 123
Interfaces
Clock Component
Connector
Bus1
Interfaces
14
Topic 2
Software
Architecture
Graphically (cont).
ICS 123
Clock Configuration
Links
Bus1
LCD
Driver
15
Example:
Topic 2
Software
Architecture
Architectures for a Compiler
ICS 123
Semantic Code
Scanner Parser
Analyzer Generator
Semantic Code
Scanner Parser
Analyzer Generator
Parse Tree
16
What does architecture buy
Topic 2
Software
Architecture
you?
ICS 123
17
Topic 2
Software
Architecture
Architectural Styles
ICS 123
• An architectural style is …
– A set of constraints you put on your development to elicit desirable
properties from your software architecture.
– These constraints may be:
» Topological
» Behavioral
» Communication-oriented
» etc. etc.
– Working within an architectural style makes development harder
– BUT architectural styles help you get beneficial system properties that
would be really hard to get otherwise
18
The Classical Style of Civil
Topic 2
Software
Architecture
Architecture
ICS 123
The Pantheon
Rome, Italy
19
Topic 2
Software
Architecture
The Gothic Style
ICS 123
Nôtre-Dame Cathedral
Paris, France
20
Topic 2
Software
Architecture
The Mediterranean Style
ICS 123
Irvine, California
21
Topic 2
Common Software Architectural Software
Architecture
Styles (Shaw & Garlan 96)
ICS 123
• Dataflow Systems
– Batch sequential
– Pipes and filters
• Call-and-Return Systems
– Main program and subroutines
– Object-oriented systems
– Hierarchical layers (onion layers)
• Independent Components
– Communicating processes (client/server and peer-to-peer)
– Event systems
– Implicit invocation
22
Common Software
Topic 2
Software
Architecture
Architectural Styles (Cont.)
ICS 123
• Virtual Machines
– Interpreters
– Rule-based systems
23
Topic 2
Software
Architecture
Pipe and Filter Example
ICS 123
24
Topic 2
Software
Architecture
Pipe & Filter Constraints
ICS 123
26
The Vision: Architecture- Topic 2
Software
Architecture
Based Composition & Reuse
ICS 123
27
The Reality: Topic 2
Software
Architecture
Architectural Mismatch
ICS 123
28
Architectural Mismatch
Topic 2
Software
Architecture
(Cont.)
ICS 123
29
Topic 2
Software
Architecture
Standards: The Solution?
ICS 123
30
More Reality: Topic 2
Software
Architecture
“Architectural Drift”
ICS 123
• How are architectures implemented now?
Python 1.5.2 (#1, Apr 18 1999,
16:03:16) Copyright 1991-1995
Stichting Mathematisch Centrum,
Amsterdam >>> import asynchat #
create an instance >>> channel =
asynchat.async_chat() # access to
attributes from an instance >>>
channel.ac_in_buffer '' >>>
channel.ac_in_buffer_size 4096 # now
let's look at the name spaces >>>
channel.__dict__['ac_in_buffer'] ''
>>>
channel.__dict__['ac_in_buffer_size'
] Traceback (innermost last): File
"<pyshell#11>", line 1, in ?
channel.__dict__['ac_in_buffer_size'
] KeyError: ac_in_buffer_size # not
found in the instance's namespace! #
check the class namespace >>>
asynchat.async_chat.ac_in_buffer_siz
e 4096
31
Topic 2
Software
Architecture
Why does drift happen?
ICS 123
32
Topic 2
Software
Architecture
Solutions for Drift
ICS 123
33
ICS 123
ICS 123
Richard N. Taylor and Eric M. Dashofy
UC Irvine
http://www.isr.uci.edu/classes/ics123s02/
Topic 2
Software
Architecture
Overview
ICS 123
• Architecture Frameworks
– c2.fw and others
35
Topic 2
Software
Architecture
The Vision
ICS 123
38
Holds architecture descriptions Topic 2
Software
ArchStudio 3 Today
Architecture
ICS 123
Manages open issues
Architecture-to-implementation mappings
39
Manages open files and tools
Architecture Description
Topic 2
Software
Architecture
Languages
ICS 123
40
What Goes in a Software
Topic 2
Software
Architecture
Architecture Description?
ICS 123
41
What people have put in
Topic 2
Software
Architecture
their descriptions
ICS 123
Distribute Product
d Systems Families Behaviora
l
Events Properties
Implementatio
n Mappings
Configuration
Management
Dynamic
Mobile,
Systems Dynamic
Architectures
42
Topic 2
Software
Architecture
What really goes in an ADL?
ICS 123
• Benefits
– Shared features may imply shared tools
– “Pick and choose” features that model aspects you care about
– Reuse other people’s modeling constructs and the effort therein
44
Topic 2
Software
Architecture
xADL 2.0: An Extensible ADL
ICS 123
45
How does extensibility work
Topic 2
Software
Architecture
in xADL 2.0?
ICS 123
Comp
Inst 3
Comp3 Constraints Machine = magister
Pid = 242
Invariant a{ CPU = 1
comp1.interface Port = 8080
.type = top -> …
comp1.interface
.link.type = Information about
bottom
} distributed components
47
Topic 2
Software
Architecture
Implementation Mappings
ICS 123
Comp1
Foo.class
Comp2
Baz.dll Conn1
Comp4
Comp3
.NET
Service
1.0
Component
With Variant Type
Comp1 1.1 Version Graph
for Type T
Comp2
2.0 1.1.1
Comp4
Comp3
1.1.2
Optional 3.0
Component & Link
Instances
Structure &
Types
Java Type
Implementation Relationships
50
Topic 2
Software
Architecture
xADL 2.0 Tool Support
ICS 123
51
Topic 2
Software
Architecture
xADL 2.0 Tool Relationships
ICS 123
Apache
Xerces
xADL 2.0 uses uses
Schemas
generates Data
Apigen
Binding Library
changes the
interface to
events
ArchEdit uses
xArchADT
use
Visio for uses
xADL Design
Critics
ArchStudio Components
52
Topic 2
Software
Architecture
Gratuitous Graphics: ArchEdit
ICS 123
53
Topic 2
Software
Architecture
Gratuitous Graphics: Visio
ICS 123
54
Topic 2
Software
Architecture
Gratuitous Graphics: Critics
ICS 123
55
Topic 2
Software
Architecture
Architecture Frameworks
ICS 123
58
A closer vision: architecture-
Topic 2
Software
Architecture
based evolution and reuse
ICS 123
Process
Support
Tools? Feedback
and
Planning
Analysis Tools
Implementation
Framework
Issues
ADL
Architecture
Evolution
59
Manager
ICS 123
ICS 123
Richard N. Taylor and Eric M. Dashofy
UC Irvine
http://www.isr.uci.edu/classes/ics123s02/
Topic 2
Software
Architecture
Recall…
ICS 123
61
Topic 2
Software
Architecture
A Quick Look at ADLs…
ICS 123
Koala
Darwin Distribute Product Wright
d Systems Families Behaviora
Rapide l
Events Properties
Mae Implementatio
n Mappings
Configuration
Management xADL 1.0
Dynamic Mobile,
Systems Dynamic
Darwin, Architectures
62
C2SADL ????
A Brief Look at Three Other
Topic 2
Software
Architecture
Approaches
ICS 123
63
Topic 2
Software
Architecture
Rapide
ICS 123
• Key foci
– Model behaviors of components, interactions
– Events are the method of communication
– Events organized in POSETs (Partially Ordered SETs)
– Specified systems can be simulated by Rapide toolset
– Simulations can be visualized in a graph format
64
Topic 2
Software
Architecture
POSETs
ICS 123
Pull Up Leave
66
Topic 2
Software
Architecture
A Rapide Configuration
ICS 123
architecture gas_station1() return root
is
O : Operator;
P : Pump;
C1, C2 : Customer;
connect
(?C : Customer; ?X : Dollars) ?C.Pre_Pay(?X) => O.Request(?X);
(?X : Dollars) O.Schedule(?X) => P.Activate(?X);
(?X : Dollars) O.Schedule(?X) => C1.Okay; -- change this
(?C : Customer) ?C.Turn_On => P.On;
(?C : Customer) ?C.Turn_Off => P.Off;
(?X : Gallons; ?Y : Dollars)P.Report(?X, ?Y) => O.Result(?Y);
end gas_station1;
67
Topic 2
Software
Architecture
The Result
ICS 123
69
Topic 2
Software
Architecture
Darwin
ICS 123
• Key foci
– Model distributed systems
– Model dynamic systems
70
Topic 2
Software
Architecture
Darwin Example
ICS 123
component filter{
provide output<stream char>;
require input<stream char>;
};
71
}
Topic 2
Software
Architecture
Darwin: Specifying Change
ICS 123
MERGE::
unlink pa[1] from pa[(1 mod N))+1], pa[(1 mod N))+1] from pa[1],
pb[1] from pb[(1 mod M))+1], pb[(1 mod M))+1] from pb[1];
link pa[1] to pb[1], pb[1] to pa[1];
pa[(1 mod N))+1] to pb[ (1 mod M))+1],
pb[ (1 mod M))+1] to pa[(1 mod N))+1];
72
Topic 2
Software
Architecture
Darwin: Tools
ICS 123
73
Topic 2
Software
Architecture
ACME
ICS 123
• Key Foci:
– Genericity (Usual Suspects + Name-Value Properties)
– Function as an “architecture interchange language”
• Later Developments
– Constraints on elements
– Constraint based type system
74
Topic 2
Software
Architecture
ACME Example*
ICS 123
System SimpleClientServer = {
Component viewer : ClientT;
Component database : ServerT;
Connector conn : RPCT;
viewer
Attachments = {
viewer.sendReq to conn.caller;
viewer.receiveReq to conn.callee;
}; database
};
75
*Slides From Bob Monroe’s ICSE’99 Tutorial
Topic 2
Software
Architecture
ACME Example (cont).
ICS 123
77