SALecture5 PDF
SALecture5 PDF
Lecture 5
10.2.2010
SA definition
Software architecture of a program or computing
10.2.2010
What is a view?
Modern software systems are complex
We focus at any time on a small number of structures of the
system (view)
View representation of a coherent set of architectural
elements, as read/written by system stakeholders (plus
relations)
Structure set of architectural elements as they exist in
software or hardware
10.2.2010
Architectural structures
Module structures
Component-and-connector structures
Allocation structures
10.2.2010
SA structures
Module
Component-and-connector
Concurrency
Decomposition
Allocation
Work
Assignment
Class
Uses
Shared data
Deployment
Client-server
Process
Layered
10.2.2010
Implementation
Module structures
Elements:
Modules units of implementation
Code-based way of considering the system
Assigned areas of functional responsibility
Less emphasis on how resulting SW manifests at runtime
Questions answered here:
Primary functional responsibility of each module
What other SW elements can this module use
Hierarchies
10.2.2010
Component-and-connector structures
Elements:
Runtime components main units of computation
Connectors communication vehicles between components
Questions answered here:
Major executing components and their interactions
Major shared data stores
Replicated parts, data flows, parallel system parts
Changes in system structure as it executes
10.2.2010
Allocation structures
Show the relationship between software elements and
10.2.2010
(modules)?
How is the system to be structured as a set of elements with
running behavior (component) and interactions (connectors)?
How is the system to relate to non-SW structures in the
environment
CPUs, file systems, networks, development teams
10
10.2.2010
Module-based structures
Decomposition
Shows how larger modules are decomposed into smaller ones
Units: modules related by is a submodule of
Recursive decomposition
Common starting point of design
Architect enumerates what the SW units will do
Assigns each item to a module for subsequent detail or implementation
11
10.2.2010
Module-based structures, 2
Decomposition
Modules often have associated products
Interface specs, code, test plans
Provides for system modifiability
Often used as basis for project organization
Structure of documentation, integration, test plans
Units often have organization-specific names
12
10.2.2010
Module-based structures, 3
Uses
Important, often overlooked structure
Units: modules, procedures, resources on the interface of
modules
Units related by uses relation
correct version of B
As opposed to a stub
13
10.2.2010
Module-based structures, 4
Layered
Uses relation controlled in a particular way
Layer: coherent set of related functionality
Layer n may only use services of layer n-1
Many variations occur in practice
Relaxing this structural restriction
Layers designed as abstractions that hide implementation
14
10.2.2010
Module-based structures, 5
Class/generalization
Units: classes
Relation: inherits-from, is-an-instance-of
Supports reasoning about
Collections of similar behaviors or capabilities
Parameterized differences (sub-classing)
Reuse, incremental addition of functionality
15
10.2.2010
Component-and-connector-based
structures
Process (communicating processes)
Orthogonal to module-based structures
Deals with dynamic aspects of a running system
Units: processes or threads
Connected by communication, synchronization, exclusion operations
Relation: attachment
Describes how component and connector related to each other
Important to systems execution performance and availability
16
10.2.2010
Component-and-connector-based
structures, 2
Concurrency
Units: components connected by logical threads
Sequence of computation
Can be allocated to a physical thread later
Allows architect to determine
Opportunities for parallelism
Location where resource contention may occur
Used early in design to identify concurrent execution issues
17
10.2.2010
Component-and-connector-based
structures, 3
Shared data, repository
Comprises components and connectors that
Create, store, access persistent data
Useful for systems structured around shared data repositories
Shows how data is produced and consumed by runtime SW
elements
Can be used to ensure performance and data integrity
18
10.2.2010
Component-and-connector-based
structures, 4
Client-server
Useful for systems built as cooperation of clients and servers
Components: clients and servers
Connectors: protocols, messages between them, for carrying
19
10.2.2010
Allocation-based structures
Deployment
Shows how SW is assigned to HW-processing and
communication elements
Elements
20
10.2.2010
Allocation-based structures, 2
Deployment, 2
Relations
Allocated-to: shows on which physical units the SW elements reside
Migrates-to: if allocation is dynamic
Allows engineer to reason about
Performance, data integrity, availability, security
Of particular interest in distributed or parallel systems
21
10.2.2010
Allocation-based structures, 3
Implementation
Shows how SW elements (modules) are mapped to the file
structure(s) in
22
10.2.2010
Allocation-based structures, 4
Work assignment
Assigns responsibility for implementing and integrating the
modules to appropriate teams
Emphasizes that decision about who does what has architectural
and management implications
Architect knows expertise required of each team
Large, multi-sourced distributed development projects
This structure allows to have units of functional commonality
23
10.2.2010
a system
Structures not independent
We need to reason about the relations
Typically many-to-many
24
10.2.2010
Structures
Main engineering leverage points of an architecture
Bring with them the power to manipulate one/more quality attributes
Powerful separation of concerns approach
Useful for architecture documentation
25
10.2.2010
26
10.2.2010
Which structures?
Among architects obligations
Understand how the various structures lead to quality attributes
Choose the structures that will best deliver those attributes
27
10.2.2010
Relations
Useful for
Decomposition
Is a submodule of;
shares secret with
Uses
Layered
Class
Relations
Useful for
Client-server
Communicates with;
depends on
Process
Concurrency
Shared data
Produces data;
consumes data
Relations
Useful for
Deployment
Allocated-to; migratesto
Implementation
Stored in
Work
assignment
Assigned to
10.2.2010
30
system
31
10.2.2010
32
Batch sequential
Pipes and filters
Call-and-return systems
Main program & subroutines
Hierarchical layers
OO systems
Virtual machines
Interpreters
Rule-based systems
Independent components
Communicating processes
Event systems
Data-centered systems (repositories)
Databases
Blackboards
20-Jan-10
Using SA
Blueprint for system and project developing it
Defines work assignments
Primary carrier of system qualities
Artifact for early analysis
Post-deployment system understanding, maintenance,
mining efforts
Conceptual glue
33
10.2.2010
Documenting SA
Crowning step to crafting it
Good architecture is useless if not understood or wrongly
understood
Architecture should be described
in sufficient details
without ambiguity
organized for information retrieval
34
10.2.2010
Uses of SA documentation
one size fits all does NOT work
Documentation depends on how SA will be used
Documentation should be
Abstract enough for new employees
Detailed enough as analysis blueprint
Specific for specific stakeholders
Security analysis, programmers
Experienced, new
35
10.2.2010
SA documentation
Prescriptive
Prescribes what should be true by placing constraints on
decisions to be made
Descriptive
Describes what is true by recounting decisions already made
about system design
Different stakeholders have different needs
For information kinds, levels, treatments
Stakeholder should quickly find the relevant documentation
36
10.2.2010
SA documentation 2
Single documentation suite and a roadmap
Different stakeholders can navigate through it
Easy to read
One important user of the documentation
The architect in the projects future
Same architect: repository of thought, storehouse of design decisions
Different architect: check how predecessors tackled difficult tasks, why
some decisions made
37
10.2.2010
Parts in documenting
Choosing relevant views
2. Documenting each relevant view
3. Documenting info that applies to more than one view
1.
38
10.2.2010
Different views
Support different goals and users
Highlight different elements and relationships
May be specific to the system
39
10.2.2010
40
10.2.2010
41
10.2.2010
Documenting a view
Need for standard organization
Allocating specific info to specific sections =>
Documentation writer can approach the task
Documentation writer can recognize completion
Documentation reader finds info of interest
42
10.2.2010
Example of table
Other info
44
10.2.2010
Primary presentation
Elements and relationships among them that populate the
view
documentation
45
10.2.2010
Element catalog
Details at least the elements and relationships shown in primary
presentation
Backup for primary presentation
Elements and relations omitted from primary presentation
Belong here
Introduced and explained
Describes
The behavior of elements
The interfaces of elements
47
10.2.2010
Context diagram
Shows how system in the view relates to environment in
vocabulary of view
Exp: C&C view
48
10.2.2010
Variability guide
Shows how to exercise any variation points part of the
10.2.2010
Architecture background
Explains why the design reflected in the view came to be
Why it is as it is
Provides convincing argument that it is sound
Includes
Rationale: why decisions reflected in view were made and why
alternatives were rejected
Analysis results: justifies design or explain what would have to change
in case of modification
Assumptions reflected in the design
50
10.2.2010
Other information
Contents of this section vary according to standard practice
of the organization
Non-architectural info can come here
May include
Management information
Authorship, change histories, configuration control data
References to specific sections of a requirements document for
traceability
By the architect
51
10.2.2010
Documenting behavior
Structural information (views) not enough
Exp. deadlock not captured
52
10.2.2010
Banking system
Event sequence more important than actual time
Atomic transaction
Rollback procedure
53
10.2.2010
Behavior notations
Statechart diagrams
Sequence diagrams
54
10.2.2010
Documenting interfaces
Interface: boundary between entities
Over boundary elements interact and communicate
Consists of
Naming and identifying interface: signature
Document its syntax and semantics
55
10.2.2010
Signature
Exp: interface resources are invokable programs
Signature names the programs
Signature defines their parameters
program
56
10.2.2010
Signature use
Can enable automatic build-up checking
Signature matching
Guarantees a system compiles or links successfully
Does not guarantee if the system operates successfully
We need semantics of interface for that
What happens when resources are brought into play
57
10.2.2010
make known
Architect should choose:
58
10.2.2010
59
10.2.2010
Interface identity
Resources provided
3.
4.
5.
6.
7.
8.
9.
60
61
10.2.2010
Interface identity
For elements with multiple interfaces
Identify individual interfaces to distinguish them
Naming, version number
62
10.2.2010
Resources provided
Heart of an interface document: resources that the element
provides
63
10.2.2010
Resource semantics
In natural language, or Boolean algebra, or traces
What:
Assignment of values to data accessible by the actor invoking the
resource
Signaled events, sent messages
Future behavior of other resources as result of using the
resource
Humanly observable results
Resource execution: atomic/suspended/interrupted
64
10.2.2010
65
10.2.2010
66
10.2.2010
Exception definition
Exceptions raised by the interface resources
Same exception may be raised by more than one resource
List each resource exceptions
Define them in a dictionary collected separately
Common exception handling also defined here
67
10.2.2010
algorithms
What
68
10.2.2010
69
10.2.2010
Element requirements
Specific, named resources provided by other elements
Syntax, semantics, any usage restrictions
70
10.2.2010
interface design
71
10.2.2010
Usage guide
Semantics of resource:
Provided resources + element requirements
Sometimes not enough
Semantics needs to be reasoned about in terms of HOW a broad
number of individual interactions interrelate
Protocol: sequence of interactions documented
Complete behavior of interaction, or
Patterns of usage the element designer expects to come up repeatedly
72
10.2.2010
3 major aspects
1.
2.
3.
Short system overview informing about purpose of system, the way views
relate to each other; list of elements and where they appear; project glossary
73
10.2.2010
74
10.2.2010
suit
Using documentation suit as basis for
particular info is
Analysis: necessary to know which views contain the info needed for a
particular analysis
75
10.2.2010
76
10.2.2010
do
77
10.2.2010
78
10.2.2010
79
10.2.2010
Project glossary
Lists and defines terms unique to the system that have special
meaning
List of acronyms, their meaning
Reference to an already existing glossary
80
10.2.2010
requirements/satisfying constraints
Effect on architecture when adding foreseen new requirement, or
changing existing one
Constraints on developer in implementing a solution
Rejected design alternatives: why?
81
10.2.2010
UML notation
Interfaces
82
10.2.2010
UML notation
Modules
83
10.2.2010
UML notation
Relations
84
10.2.2010
UML notation
Decomposition
85
10.2.2010
UML notation
Generalization
86
10.2.2010
UML notation
Layers
87
10.2.2010
UML notation
Instantiation
88
10.2.2010
UML notation
Ports
89
10.2.2010
UML notation
Deployment
90
10.2.2010