2 Description of Software Architectures 2.1 Significance of architectural descriptions 2.2 Context of architectural descriptions 2.3 Levels of architectural descriptions 2.4 Viewpoints and types in architecture descriptions 2.5 Describing design slices 2.6 Architectural documents 2.7 Stereotypes and profiles in UML 2.8 Conclusions 1
2.1 Significance of architectural descriptions Assume that a system and its architectural documents disagree. What is the architecture of the system? Architecture is an explanation of a system, rather than a property extracted from a system Pragmatic approach: architecture exists only to the extent it is documented Architectural description is central means of communication between stakeholders 2
2.2 Context of architectural descriptions (IEEE) Mission fulfills 1..* has an Architecture Rationale Environment System identifies 1 described by Architectural description provides selects has 1..* 1..* 1..* organized by Stakeholder 1..* View has 1..* 1..* is addressed to conforms to Concern Viewpoint 1..* 3
2.3 Levels of architectural descriptions Reference architecture Metaarchitecture is based on is a Concrete architecture Detailed design Product architecture Product-line architecture Source code 4
Views: 2.4 Views and types in architecture descriptions Scenario views Interaction with external actors Logical views Assigning responsibilities to software units Process views Processes and their interaction "4+1" (Kruchten) Development views Managing development process UML? Physical views Assigning software to processing units Variability views Extending the system 5
Architectural description types Structural - Behavioral Static - Dynamic Example - Specifying 6
Exercise: Using UML in architectural descriptions Structure Behavior Static Dynamic Exemplary Specifying Sequence diagram Class diagram Statechart diagram X X X 4 X X X X X X? X 7
2.5 Describing architectural slices An architectural slice: parts of the architecture related to a particular concern cross-cutting the component structure Examples: Architectural & design patterns Features Global concerns Extension points... 8
Architectural slices Slice role software unit element bound to role 9
Describing architectural slices Identification (e.g., "Copy and paste") Type (e.g., feature) Purpose Stakeholders Roles Relationships Bindings Compare with design pattern descriptions 10
2.6 Architectural documents Document types: Initial architecture document emphasizes most critical solutions, alternative solutions, trade-offs used for initial work estimations, business decisions starting point for architectural design System architecture document top-level system architecture used for project planning, refined work estimations, system test planning starting point for subsystem architecture design Subsystem architecture document subsystem architecture used for task planning, refined work estimations, module test planning starting point for subsystem detailed design & implementation 11
Document types (cont.) Product-line architecture document platform architecture + rules for building applications on top of the platform used as an architecture document, as a guide for application development Product architecture document usage of platform + product-specific architectural decisions used as an architecture document for detailed design, testing, maintenance etc. Interface specification document specification of some part of a system's interface to other systems, usually an API supplements other architectural documents used for designing and implementing components 12
Contents of architectural documents The following topics should be covered in some form (not necessarily in this order): Identification General context Requirements, starting points Environment Views Architectural slices Analysis Rationale 13
2.7 UML as architecture description language 14
Stereotypes and profiles in UML Stereotype Extension of a metaclass in UML metamodel Profile A collection of stereotypes and constraints on them, specializing UML for a particular purpose (e.g. certain architectural styles) 15
Four-layer modeling architecture of UML Meta-metamodel (MOF) Class Association UML metamodel <<stereotype>> bean Operation is instance of Class Association System model <<bean>> Account mycar(): Car has Person mycar(): Car is instance of owns Car owner(): Person System Kai is instance of Opel SEG-399 16
Profile specification: stereotypes 17
Profile specification: constraints 18
Profile specification: a model-based approach <<metaclass>> Class <<metaclass>> Interface <<stereotype>> Sensor <<stereotype>> Actor <<stereotype>> ControlUnit <<stereotype>> FieldUnit <<FieldUnit>> afieldunit <<ControlUnit>> acontrolunit 1 <<Sensor>> asensor * <<Actor>> anactor * 19
Example UML model following the profile <<FieldUnit>> DeviceInterface <<ControlUnit>> UnitManager <<Sensor>> ThermDetector <<Sensor>> FaultDetector <<Actor>> AdjustingUnit 20
MDA: Model-Driven Architecture CIM (Computation Independent Model) Model transformations PIM (Platform Independent Model) PSM (Platform Specific Model) Code generation Implementation 21
2.8 Conclusions Architectures are high-level models of systems Architecture cannot be automatically inferred from source code Architectural descriptions are central means of communication Architectural descriptions can be categorized according to viewpoints and types Architectural slices have to be taken into account in architectural descriptions UML is de facto standard notation for architectural modeling UML profiles can be used to express and enforce architectural rules 22