Professional Documents
Culture Documents
Architecture
Topics
• Software Architecture Definition
• Architectural Decisions & Key Concerns
• Architecture Styles
• Documenting Architecture: Views
• Problem Structure vs. Solution Structure
2
Hierarchical Organization of Software
Product line (or product family) highest abstraction level
System or product
Subsystems/Modules
Packages
Classes/Objects
Source code
4
Principal decisions
made throughout
Software Architecture = the development
a set of high-level decisions and evolution of a
software system
that determine the structure of
made early and
the solution affect large parts of
(parts of system-to-be and their the system (“design
relationships) philosophy”) —
such decisions are
hard to modify later
Software
Architecture Decisions to use well-known solutions that are
proven to work for similar problems
Definition
Does not refer to a
specific product of a
Software Architecture is not a particular phase of
the development
phase of development process (labeled
“high-level design”
or “product design”)
5
Example Architectural Decisions
Example decisions:
Safe Home Access System
Decision on development
platform or operating system
(Android vs. iOS, etc.)
Subsystem scope
local impact
Class scope
• System decomposition
• how do we break the system up into pieces?
Software • what functionality/processing or behavior/control
to include?
Architecture • do we have all the necessary pieces?
• do the pieces fit together?
Key Concerns • how the pieces interact with each other and with
the runtime environment
• Cross-cutting concerns
• broad-scoped qualities or properties of the system 8
• tradeoffs among the qualities
• Conceptual integrity
• Software architecture provides a set of
well-known solutions that are proven to work for similar
problems
Architectural Decisions Often Involve
Compromise
The “best” design for a
component considered in Additional
isolation may not be chosen considerations include
when components considered business priorities,
together or available resources, core
within a broader context competences, target
customers, competitors’
• Depends on what criteria are used to
decide the “goodness” of a design
moves, technology
• E.g., car components may be “best” for trends, existing
racing cars or “best” for luxury cars, investments, backward
but will not be best together compatibility, …
9
Module/Sub
system • Module Decomposition View
• Top-down refinement (e.g., simple “block
diagram”)
Views • Dependency View
• How parts relate to one another
• Layered View
• Special case of dependency view
• Class View
• “domain model” in OOA and “class diagram” in
OOD
Component and • Process View
• Defined sequence of activities?
Connector System represented as a series of
Views communicating processes
• Concurrency View
• Client/Server View
• E.g., in Web browsing
11
Method call Called method
dependency
from consumer implemented
component by provider
(“output port”) component
(“input port”)
“Consumer”
“Provider” component
UML component
accesses («use»)
functionality through
provides («realize»)
functionality through
Software «component»
Consumer
Required Provided
«component»
Provider
12
How to Fit • World Wide Web architecture style:
Known • Peer-to-Peer
• Microservices
Web vs. mobile app, etc.)
may dictate the architecture
style or vice versa…
Architecture
Styles
13
Real System is a Combination of Styles
Subsystem
Central Repository
for device Architecture Style
control
Subsystem
for remote
data access
- Valid keys
- Access history
Subsystem for - Tenant profiles
administration -…
Application Web
Web server
server browser
14
Components • Processing elements that “do the work”
15
Shared Database Connector
— Data Model for Restaurant
Entity-relationship diagram of the data model:
entity set relationship set
folder-name |
Pipe
Pipe
Pipe Pipe
Filter Filter
Pipe Pipe
Filter
Pipe Pipe
Filter Filter
Pipe
17
User Client Server
Connector
1: 4: 2: 3:
Packing a request Unpacking the response Unpacking the request Packing the response
for network transport for client use for server call for network transport
connector
• A client is a triggering process; a server is a reactive process. Clients make requests that
trigger reactions from servers.
Architecture • A server component, offering a set of services, listens for requests upon those services.
A server waits for requests to be made and then reacts to them.
Style: • A client component, desiring that a service be performed, sends a request at times of its
choosing to the server via a connector.
Client/Server • The server either rejects or performs the request and sends a response back to the
client
18
Architecture Style: Layered
a.k.a. Tiered Software Architecture
• A layered system is organized hierarchically, each layer providing services to the layer
above it and using services of the layer below it
• Layered systems reduce coupling across multiple layers by hiding the inner layers
from all except the adjacent outer layer, thus improving evolvability and reusability
Hypermedia representation
(webpage) of State S2 URI(S4)
HTTP Request State S4
20
Hypermedia as the • Web application:
• A network of Web resources (a virtual state-machine),
Engine of where the user by following the links requests the transfer of
Application State next resource (“state”).
Application state #1
Product Finding
Server resource:
hypermedia of
Application state #2 Application state #4
initial search page
Product Selecting Product Purchasing
Server resource:
Server resource:
State #1 representation: database record of
product catalog
hypermedia of search page Appl. state #3 billing/shipping options
21
Architecture Style:
Model-View-Controller
MODEL: HOLDS ALL THE DATA, STATE AND VIEW: GIVES USER A PRESENTATION OF CONTROLLER: TAKES USER INPUT AND
APPLICATION LOGIC. OBLIVIOUS TO THE THE MODEL. FIGURES OUT WHAT IT MEANS TO THE
VIEW AND CONTROLLER. PROVIDES API TO GETS DATA DIRECTLY FROM THE MODEL MODEL
RETRIEVE STATE AND SEND NOTIFICATIONS
OF STATE CHANGES TO “OBSERVER” display
5. I need your state (to display)
View
4. I have changed
input device 22
Model-View-Controller
User Interface
Model
Controller
Input Domain
Event Domain
device model
Interpreter Model
events action
Notification
Visual feedback
Model about the
User of the altered
Visualizer effects of the
model
action
View
31
26 14
Model: array of numbers [ 14, 26, 31 ] 14 31
versus
26
➔ Different Views for the same Model: 23
Problem Structure
REQ1, REQ2,
REQ3 REQ3, REQ4
PROBLEM DOMAIN
(5) Device
(6) Photosensor
preferences
(7) Light
Subsystem-2
(3) Key
REQ4
Subsystem-3 (8) Alarm bell (11) Log of
accesses
Software-to-be
(2) Landlord
(10) Tenant
Subsystem-4 (9) Desktop computer accounts
REQ5, REQ7,
REQ8, REQ9
3. Computer system intermediates between 3.a) System observes the problem domain and displays information
the user and the problem domain
REQ-5: Monitor and display
information about an object
User System Problem domain
User System Problem domain 3.b) System controls the problem domain as commanded by the user
(“Simple workpieces”)
Software
the problem space
Simple editing
problem
(“Required behavior”)
Autonomous control
to solve
• The “axis” projections represent
the degree to which the whole
problem contains a subproblem of
this type
• Each subproblem can be analyzed
independently and eventually
recombined into the whole
problem
• The structure of the solution should
be selected to fit the problem
structure
26
Software (i.e., Solution) Structure
REQ-1: Map input data to output data as said by given rules SYSTEM
Data
1.b) Simple editing: editor
User Data repository
REQ-3: Automatically control a physical object/device SYSTEM
Controlling Controlled
2. Required behavior: subsystem subsystem
Monitoring Monitored
3.a) Information display: subsystem subsystem
Display
REQ-4: Interactively control a physical object/device SYSTEM
Controlling Controlled
3.b) Commanded behavior: subsystem subsystem
Operator 27