Chapter3.1 SOFT ARCH
Chapter3.1 SOFT ARCH
Software Architecture
Lecture 3
A Software Architecture
is an Abstraction
• An architecture is an abstraction of a system that
suppresses details of components that do not affect
how they:
– Use
– Are used by
– Relate to
– Interact with
…other components.
1
8/15/2022
Externally Visible
Properties of Components
• Externally visible properties refers to those
assumptions other components can make of
a component, such as:
– Provided services
– Performance characteristics
– Fault handling
– Shared resource usage
– Etc.
2
8/15/2022
3
8/15/2022
4
8/15/2022
10
5
8/15/2022
Considerations in Architectural
Structures
• Conceptual and logical structures:
Abstractions of the system’s functional
requirements. - shares-data-with. It is important for
understanding the interactions between units.
• Process or Coordination Structure: Modeling
dynamic aspects of a running system.
Synchronizes-with, Can’t-run-without and Can’t-run-
with. Processes and threads
11
Architectural Structures …
Cont..
• Physical Structure: Hardware (computers,
networks, etc.). “communicates-with”. Create
models to reason about performance,
availability, security, etc.
• Uses Structure: procedures or modules. “assumes-
the-correct-presence-of ”. For modeling system
extendibility and incremental system building
(e.g., Makefile dependencies).
12
6
8/15/2022
Architectural Structures ..
• Cont.. Used to model trace
Calls Structure. “Procedures”.
of execution in a program.
• Data Flow Structure Programs or modules. “
transmits-data-to”. Used to model data transmission
which can aid requirements traceability.
• Class Structure. classes and interfaces. “inherits-from,
implements”. Used to model collections of similar
behavior and parameterizes differences.
13
14
7
8/15/2022
Abstraction
15
Modeling Views
• Modeling system architectures is best done
using multiple concurrent views
16
8
8/15/2022
17
Abstraction (Cont’d)
18
9
8/15/2022
19
Programming Languages
20
10
8/15/2022
Development
Logical View
View
Business
Scenarios Analysts
Integrators Infrastructure
Engineers
21
22
11
8/15/2022
23
12
8/15/2022
Logical View
The Logical View
• This view expresses the key abstractions from the problem
domain
– Classes, Components
• Think in terms of the services that the system will provide to
the user
• Express the relationships between the logical components
– Use, generalize, aggregate
• Define the important interfaces of the components and
connectors associated with this view
25
Logical View
The Logical View
• Choose a “style” for the logical view
– Object-oriented style
– Component style
– Service-oriented style
• The style helps define the structure and
semantics of the elements captured in the
logical view
26
13
8/15/2022
Process View
The Process View
• The process view takes into account non-
functional requirements such as performance,
availability
• This view also deals with concurrency,
showing the different threads of control
– Intra-process threads
– Inter-process coordination (messages to and
from different servers)
27
Process View
The Process View
• A “process” in the process view groups tasks
into logical execution units. Execution units
have a:
– Well defined point where they start and stop as
well as rule for dealing with exceptions to the
normal course of operation
• Possible styles for the process views:
– Client/Server, MVC, pipe and filter.
28
14
8/15/2022
Process View
The Process View
• Components for the process view include:
– Processes and threads
• Connectors include
– Messages, shared memory, pipes
29
Development
The Development View View
30
15
8/15/2022
Development
The Development View View
31
32
16
8/15/2022
• Why scenarios:
– A mechanism to discover the key architectural
elements and connectors
– Validation of the architecture design after the
other views are created
– Addresses the concerns of both the functional
and non-functional requirements
33
State of Practice
34
17
8/15/2022
Architectural Styles
of Software Systems
Style
An architectural style represents a family of
related systems
Defines the design vocabulary (and
constraints) for the components, connectors,
ports, roles, bindings and properties.
35
Architectural Styles of
Software Systems
• An Architectural Style defines a family of
systems in terms of a pattern of structural
organization. It determines:
– the vocabulary of components and connectors
that can be used in instances of that style
– a set of constraints on how they can be
combined. For example, one might constrain:
• the topology of the descriptions (e.g., no cycles).
• execution semantics (e.g., processes execute in
parallel).
36
18
8/15/2022
37
Repository Style
38
19
8/15/2022
• Components:
– A central data structure representing the current
state of the system.
– A collection of independent components that
operate on the central data structure.
• Connectors:
– Typically procedure calls or direct memory
accesses.
39
Memory Access
Computation
Shared Data
Memory
40
20
8/15/2022
41
• Information Systems
• Programming Environments
• Graphical Editors
• AI Knowledge Bases
• Reverse Engineering Systems
42
21
8/15/2022
43
44
22
8/15/2022
Object-Oriented Style
45
object
obj obj
obj
obj
obj
obj
obj
obj
46
23
8/15/2022
Object-Oriented Invariants
47
Object-Oriented Specializations
• Distributed Objects
• Objects with Multiple Interfaces
48
24
8/15/2022
Object-Oriented Advantages
49
Object-Oriented Disadvantages
• In order for one object to interact with another
object (via a method invocation) the first object
must know the identity of the second object.
– Contrast with Pipe and Filter Style.
– When the identity of an object changes, it is necessary to
modify all objects that invoke it.
• Objects cause side effect problems:
– E.g., A and B both use object C, then B’s effects on C
look like unexpected side effects to A.
50
25
8/15/2022
51
52
26
8/15/2022
pipes
53
54
27
8/15/2022
55
56
28
8/15/2022
57
Client-Server Style
• Suitable for applications that involve distributed data
and processing across a range of components.
• Components:
– Servers: Stand-alone components that provide specific
services such as printing, data management, etc.
– Clients: Components that call on the services provided
by servers.
• Connector: The network, which allows clients to
access remote servers.
58
29
8/15/2022
Client-Server Style
Network
59
• File Servers:
– Primitive form of data service.
– Useful for sharing files across a network.
– The client passes requests for files over the
network to the file server.
60
30
8/15/2022
Client-Server Style
Examples (Cont’d)
• Database Servers:
– More efficient use of distributing power than file
servers.
– Client passes SQL requests as messages to the
DB server; results are returned over the network
to the client.
– Query processing done by the server.
– No need for large data transfers.
– Transaction DB servers also available.
61
Client-Server Style
Examples (Cont’d)
• Object Servers:
– Objects work together across machine and
network boundaries.
– ORBs allow objects to communicate with each
other across the network.
– IDLs (Interactive Data Language) define interfaces
of objects that communicate via the ORB.
– ORBs are the evolution of the RPC.
62
31
8/15/2022
Client Server
Client Server
Object X Object Y
Code Data call foo call foo Data Data
call foo on on
Object X Object Y Code Code
execute foo
63
Client-Server Advantages
64
32
8/15/2022
Client-Server Disadvantages
65
Reading
• Implicit Invocation Style
• Layered Style
• Interpreter Style
• Process-Control Style
66
33
8/15/2022
67
68
34
8/15/2022
Broadcasting System
69
70
35
8/15/2022
Implicit Invocation
Specializations
• Often connectors in an implicit invocation
system include the traditional procedure
call in addition to the bindings between event
announcements and procedure calls.
71
72
36
8/15/2022
Implicit Invocation
Examples (Cont’d)
• Used to enforce integrity constraints in
database management systems (called
triggers).
• Used in user interfaces to separate the
presentation of data from the applications
that manage that data.
73
74
37
8/15/2022
Implicit Invocation
Disadvantages
• When a component announces an event:
– it has no idea what other components will
respond to it,
– it cannot rely on the order in which the responses
are invoked
– it cannot know when responses are finished
75
Layered Style
76
38
8/15/2022
77
Useful System
sets of
procedures
Basic Utilities
Core Layer
procedure
calls
78
39
8/15/2022
79
80
40
8/15/2022
Plain Cooked
Socket
File Cooked Raw Raw TTY
Block Block TTY
File Interface Interface Interface Line
Protocols
System Disc.
Network
Block Device Driver Character Device Driver
Interface
Hardware
81
82
41
8/15/2022
83
Interpreter Style
84
42
8/15/2022
85
Current State
inputs Program
of
Being
Program Being
Interpreted
Interpreted
Computation
State Machine store
selected
outputs instruction Current
Execution State of
Engine Execution
Selected Engine
data (fetch)
86
43
8/15/2022
87
88
44
8/15/2022
Java Architecture
Java Bytecode
Source Verifier
Code
Class
Loader
Java Interpreter
Compiler
INTERNET Run-time
Environment
Java Hardware
Bytecode
89
90
45