Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture...

133
Software Architecture Software Engineering - 2017 Alessio Gambi - Saarland University These slides are based the slides from Cesare Pautasso and Christoph Dorn, and updated from various sources.

Transcript of Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture...

Page 1: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Software ArchitectureSoftware Engineering - 2017

Alessio Gambi - Saarland University

These slides are based the slides from Cesare Pautasso and Christoph Dorn, and updated from various sources.

Page 2: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architecture

Page 3: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Design in the Large• Objects and methods

• Modules and components

• Large and complex systems

• Systems of systems

Page 4: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Design in the Large

• Size of the team

• Lifetime of the project

• Cost of development

• Objects and methods

• Modules and components

• Large and complex systems

• Systems of systems

Page 5: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Building software as we build buildings ?

• Software is complex, so are buildings (blueprint)

• Architecture implies a systematic process for design and implementation

• Architects put together pieces and materials, they usually do not invent new materials

Page 6: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

It’s just an analogy !• We know a lot about buildings

(2000+ years), much less about software

• Software systems do not obey to physical laws

• Software deployment has no counterpart in building architecture

Page 7: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Software Architecture

A software system’s architecture is the set of principal design decisions made

about the system.

N. Taylor et al.

Page 8: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Software Architecture

A software system’s architecture is the set of principal design decisions made

about the system.

N. Taylor et al.

Where do the pillars go? Where do the chairs go?

Page 9: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Abstraction

Manage complexity in the design

Page 10: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Communication

Document, remember and share design decisions among the team

Page 11: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Visualization

Depict and highlight important aspects

Page 12: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Representation

Characterize components and behaviors

Page 13: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Quality Analysis

Understand, predict, and control

Page 14: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

When SW Architecture Start ?

Since the beginning ofdesign!

Page 15: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

When SW Architecture Stop ?

Page 16: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Never!When SW Architecture Stop ?

Page 17: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architecture is NOT a development phase

Architecture is NOT only “high-level” design

Page 18: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Every System an Architecture has

Page 19: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Every System an Architecture has

Page 20: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Every System an Architecture has

Page 21: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Evolution

Decisions are added and changed by multiple actors… sometimes without knowing it

Page 22: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Degradation

P

Page 23: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Degradation

PDIdeal P=D

Page 24: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Degradation

P DIdeal P=D

Drift P !=D and D does not violate P

Page 25: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Degradation

P DIdeal P=D

Drift P !=D and D does not violate P

Erosion P !=D and D violates P

Page 26: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Summary• Blueprint for construction and evolution

abstraction • principal design decisions

• Not only about design communicate • visualize • represent • assess

• Every system has (an evolving) one descriptive • prescriptive • drift • erosion

• Not a phase, not only “high-level” design

Page 27: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Design

Page 28: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

How to DesignEven the best architects copy solutions that have proven themselves in practice, adapt them to the

current context, improve upon their weaknesses, and then assemble them in novel ways

Page 29: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

How to DesignEven the best architects copy solutions that have proven themselves in practice, adapt them to the

current context, improve upon their weaknesses, and then assemble them in novel ways

Page 30: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

How to DesignEven the best architects copy solutions that have proven themselves in practice, adapt them to the

current context, improve upon their weaknesses, and then assemble them in novel ways

Page 31: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Hoisting

George Fairbanks - http://georgefairbanks.com/blog/architectural-hoisting-original/

Design the architecture with the intent to guarantee a certain quality of the system.

Page 32: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Hoisting

George Fairbanks - http://georgefairbanks.com/blog/architectural-hoisting-original/

Design the architecture with the intent to guarantee a certain quality of the system.

Security place sensitive data behind the firewall

Scalability make critical components stateless

Persistence use a database

Extensibility use a plug-in framework

Page 33: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

What makes a “good” SW Architecture?

• No such things like perfect design and inherently good/bad architecture

• Fit to some purpose, and context-dependent

Page 34: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

What makes a “good” SW Architecture?

• No such things like perfect design and inherently good/bad architecture

• Fit to some purpose, and context-dependent

• Principles, guidelines and the use of collective experience (method)

Page 35: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Design Principles

Architectural Patterns

Architectural Styles

Page 36: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Design Principles• Abstraction

• Encapsulation - Separation of Concerns

• Modularization

• KISS (Keep it simple, stupid)

• DRY (Don’t repeat yourself)

Page 37: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural PatternsSet of architectural design decisions that are

applicable to a recurring design problem, and are parameterized to account for the development

contexts in which that problem appears.

Page 38: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural PatternsSet of architectural design decisions that are

applicable to a recurring design problem, and are parameterized to account for the development

contexts in which that problem appears.

Layered ComponentNotification Composition

Page 39: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Layered Patterns• State-Logic-Display

separate elements with different rate of change

• Model-View-Controller support many interaction and display modes for the same content

• Presenter-View keep a consistent look and feel across a complex UI

Page 40: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

State-Logic-Display

cluster elements that change at the same rate

Page 41: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Model-View-Controllerseparate content (model) from presentation (output) and

interaction (input)

Page 42: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Presenter-View

extract the content from the model to be presented from the rendering into screens/web pages

Page 43: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Component Patterns• Interoperability

enable communication between different platforms

• Directory facilitate location transparency (direct control)

• Dependency Injection facilitate location transparency (inversion of control)

Page 44: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Interoperabilitymap to a standardized intermediate representation and

communication style

Page 45: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Directoryuse a directory service to find service endpoints based on

abstract descriptions

Page 46: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Dependency Injectionuse a container which updates components with

bindings to their dependencies

Page 47: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Notification Patterns• Event Monitor

inform clients about events happening at the service

• Observer promptly inform clients about state changes of a service

• Publish/Subscribe decouple clients from services generating events

• Messaging Bridge connect multiple messaging systems

• Half Synch/Half Async interconnect synchronous and asynchronous components

Page 48: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Event Monitorpoll and compare state snapshots

Page 49: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Observerdetect changes and generate events at the service

Page 50: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Publish/Subscribefactor out event propagation and subscription management

into a separate service

Page 51: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Messaging Bridgelink multiple messaging systems to make messages

exchanged on one also available on the others

Page 52: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Half-Sync/Half-AsyncAdd a layer hiding asynchronous interactions behind a

synchronous interface

Page 53: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Composition Patterns• Scatter/Gather

send the same message to multiple recipients which will/may reply

• Canary Call avoid crashing all recipients of a poisoned request

• Master/Slave speed up the execution of long running computations

• Load Balancing speed up and scale up the execution of requests of many clients

• Orchestration improve the reuse of existing applications

Page 54: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Scatter/Gathercombine the notification of the request with

aggregation of replies

Page 55: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Canary Calluse an heuristic to evaluate the request

Page 56: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Master/Slavesplit a large job into smaller independent

partitions which can be processed in parallel

Page 57: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Load Balancingdeploy many replicated instances of the server

on multiple machines

Page 58: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Composition/Orchestrationbuild systems out of the composition of existing ones

Page 59: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Patterns, Patterns, PatternsArchitectural Patterns not Design Patterns

Architectural Design

Page 60: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Patterns, Patterns, Patterns

Express fundamental structural organizations

Specify relationships among (sub-)systems

Capture roles in solutions that occur repeatedly

Define the relationships among roles

Architectural Patterns not Design Patterns

Architectural Design

Page 61: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Architectural Styles

Named collections of architectural decisions and constrains for a specific development context that elicit

beneficial qualities in each resulting system

Page 62: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Why Styles?

A common vocabulary for the design elements improve communication by shared understanding

A predefined configuration and composition rules known benefits and limitations ensure quality attributes if constraints are followed

Style-specific analyses and visualizations

Page 63: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Styles and Patterns

One style is dominant

The same pattern can be used many times

Many patterns are combined

General constraints Fine-grained constraints

Architecture withsuperior properties

Specific to recurrent problems

Styles must be refined and adapted

Page 64: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Many (and Many More)

Page 65: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Monolithic• Lack of structure

• No Constraints

• Poor Maintainability

• Possibly Good Performance

Mainframe COBOL programs ∙ powerpoint ∙ many games

Page 66: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Layered• Communications 1 layer up/down

• Information hiding, no circular deps

• Possibly bad performance

• Good evolvability

Network protocol stacks ∙ Web applications ∙ Virtual Machines

Page 67: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Component Based• Encapsulation

• Information hiding

• Components compatibility problem

• Good reuse, independent development

CORBA ∙ Enterprise JavaBean ∙ OSGi

Page 68: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Service Oriented• Components might be outside control

• Standard connectors, precise interfaces

• Interface compatibility problem

• Loose coupling, reuse

Web Services (WS-*) ∙ Cloud Computing

Page 69: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Plugin• Explicit extension points

• Static/Dynamic composition

• Low security (3rd party code)

• Extensibility and customizability

Eclipse ∙ Photoshop ∙ Browsers’ extensions

Page 70: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Pipe & Filter• Clean separation: filter process, pipe

transport

• Heterogeneity and distribution

• Only batch processing, serializable data

• Composability, Reuse

UNIX shell ∙ Compiler ∙ Graphics Rendering

Page 71: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Black Board• Collective problem solving via shared data

• Asynchronous components interactions

• Requires common data format

• Loose coupling, implicit data flow

Database ∙ Tuple space ∙ Expert systems (AI)

Page 72: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Event Driven• Produce/React to events

• Asynchronous signals/messages

• Difficult guarantee performance

• Loose coupling, scalable

Sensor Monitoring ∙ Complex Event Processing

Page 73: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Event Driven• Produce/React to events

• Asynchronous signals/messages

• Difficult guarantee performance

• Loose coupling, scalable

Sensor Monitoring ∙ Complex Event Processing

Page 74: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Event Driven• Produce/React to events

• Asynchronous signals/messages

• Difficult guarantee performance

• Loose coupling, scalable

Sensor Monitoring ∙ Complex Event Processing

Page 75: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Publish/Subscribe• Event driven + opposite roles

• Subscription to queues or topics

• Limited scalability

• Loose coupling

Twitter ∙ RSS Feeds ∙ Email

Page 76: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Publish/Subscribe• Event driven + opposite roles

• Subscription to queues or topics

• Limited scalability

• Loose coupling

Twitter ∙ RSS Feeds ∙ Email

Page 77: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Publish/Subscribe• Event driven + opposite roles

• Subscription to queues or topics

• Limited scalability

• Loose coupling

Twitter ∙ RSS Feeds ∙ Email

Page 78: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Client/Server• Many clients, active, close to users

• One server, passive, close to data

• Single point of failure, scalability

• Security, scalability

Web Browser/server ∙ Databases ∙ File Servers ∙ Git/SVN

Page 79: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Client/Server• Many clients, active, close to users

• One server, passive, close to data

• Single point of failure, scalability

• Security, scalability

Web Browser/server ∙ Databases ∙ File Servers ∙ Git/SVN

Page 80: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Peer to Peer• Both server and client at the same time

• Dynamic join/leave

• Difficult administration, data recovery

• Scalability, dependability/robustness

File Sharing ∙ Skype (mixed style) ∙ Distributed Hash Tables

Page 81: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Data Centric• Persistence layer

• Black board like

• Single point of failure

• (Eventual) Consistency (BASE/ACID)

Relational DB ∙ Key-Value Stores

Page 82: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Rule Based• Rules dynamically triggered

• Layered

• Possibly hard to understand and maintain

• Evolvability

Business Rule Engines ∙ Expert Systems ∙ Prolog

Page 83: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Rule Based• Rules dynamically triggered

• Layered

• Possibly hard to understand and maintain

• Evolvability

Business Rule Engines ∙ Expert Systems ∙ Prolog

Page 84: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Mobile Code• Code migrates (weak)

• Code+execution state migrate (strong)

• Security

• Fault tolerance, performance

JavaScript ∙ Flash ∙ Java Applets ∙ Mobile Agents ∙ Viruses

Page 85: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

REST• Hybrid style

• Stateless interactions/Stateful resources

• Loose coupling, scalability, interoperability

World Wide Web ∙ RESTFul Web APIs

Page 86: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Summary• A great architecture likely combines aspects of

several other architectures

• Do no limit to just one pattern, but avoid the use of unnecessary patterns

• Different styles lead to architectures with different qualities, and so might do the same style

• Never stop at the choice of patterns and styles: further refinement is always needed

Page 87: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Modeling

Page 88: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Why modeling?

• Record decisions

• Communicate decisions

• Evaluate decisions

• Generate artifacts

Page 89: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 90: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

The problem (Domain model)

Page 91: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

The problem (Domain model)

The environment System context Stakeholders

Page 92: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

The system-to-be ( ) Static and dynamic architecture

The problem (Domain model)

The environment System context Stakeholders

Design Model

Page 93: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

The system-to-be ( ) Static and dynamic architecture

Quality attributes and non-functional propertiesThe problem (Domain model)

The environment System context Stakeholders

Design Model

Page 94: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

The system-to-be ( ) Static and dynamic architecture

Quality attributes and non-functional propertiesThe problem (Domain model)

The environment System context Stakeholders

The design processDesign Model

Page 95: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Design Model

System Context Interfaces/API Quality Attributes

Boundary Model

Externally visible behavior

Page 96: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Design Model

Software ComponentsSoftware ConnectorsComponent assembly

System Context Interfaces/API Quality Attributes

Boundary Model Internal Model

Internal behaviorExternally visible behavior

Page 97: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Reusable unit of compositionCan be composed into larger systems

State in a system

Software Components

Locus of computation

Page 98: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Reusable unit of compositionCan be composed into larger systems

State in a system

Software Components

Application-specific Media Player Math Library

Web Server Database

Locus of computation

Infrastructure

Page 99: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Composition vs Distribution

Page 100: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Component Roles

Page 101: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Components

Modules

Objects

Encapsulate state and functionality Coarse-grained Black box architecture elements Structure of architecture

Encapsulate state and functionality Fine-grained Can “move” across components Identifiable unit of instantiation

Rarely exist at run time May require other modules to compile Package the code

Page 102: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Component Interfaces

Page 103: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Provided Interfaces• Specify and document the externally visible

features (or public API) offered by the component

- Data types and model - Operations - Properties - Events and call-backs

Page 104: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Required Interface

• Specify the conditions upon which a component can be (re)used - The platform is compatible - The environment is setup correctly

Page 105: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Compatible Interfaces

Adapter Wrapper

Page 106: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Software Connectors

Model static and dynamic aspects of the interaction between component interfaces

Page 107: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Connector Roles• Communication

deliver data and transfer of control

• Coordination separate control from computation

• Conversion enable interaction of mismatched components

• Facilitation/Mediation govern access to shared information

Page 108: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

not always directly visible in the code

mostly application-independent

Page 109: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Connectors are abstractions

When to hide components inside a connector?

Page 110: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Remote Procedure Call

• Call

Page 111: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Remote Procedure Call

• Call

Page 112: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Message Bus

• Publish

• Subscribe

• Notify

Page 113: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

• Get

• Put

• Post

• Delete

Web

Page 114: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Views and Viewpoints

Page 115: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Viewpoint ViewA subset of related

architectural design decisionsThe common concerns

shared by a view

Page 116: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Views are not always orthogonal and might become inconsistent if design decision are not compatible (erosion)

Consistency

Page 117: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

4+1

Philippe Kruchten

Logical View Development View

Physical ViewProcess View

Use Case Scenarios

Page 118: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Use Case Scenarios

• Unify and link the elements of the other 4 views

• Help to ensure the architectural model addresses all the requirements

• Each scenario can be illustrated using the other 4 views

Page 119: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

MusicApp Example

Use Case Scenarios ✴ Browse for new songs

✴ Buy song

✴ Download the purchased song on the phone

✴ Play the song

Page 120: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Logical View

• Decompose the system structure into software components and connectors

• Map functionalities (use cases) onto the components

Page 121: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 122: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Process View

• Model the dynamic aspects of the architecture and the behavior of its parts

• Describe how components/processes communicate

Page 123: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Use Cases: Browse, Pay and Play For Songs

Page 124: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Development View

• Static organization of the software code artifacts

• Map elements in the logical view and the code artifacts

Page 125: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 126: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

Physical View

• Hardware environment where the software will be deployed

• Map logical and physical entities

Page 127: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 128: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 129: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 130: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 131: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 132: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.
Page 133: Software Architecture - uni-saarland.de · Software Architecture A software system’s architecture is the set of principal design decisions made about the system. N. Taylor et al.

References and Readings• Textbooks • R. N. Taylor, N. Medvidovic, E. M. Dashofy, Software Architecture: Foundations, Theory, and

Practice, Wiley, January 2009.• G. Fairbanks, Just Enough Software Architecture: A Risk-Driven Approach, Marshall & Brainerd,

August 2010.• Amy Brown and Greg Wilson (eds.) The Architecture of Open Source Applications, 2012.

• References • Mary Shaw and David Garlan, Software Architecture: Pespectives on an Emerging Discipline,

Prentice-Hall, 1996• Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, Michael Stal Pattern

Oriented Software Architecture: A System of Patterns, Wiley, 1996• William Brown, Raphael Malveau, Hays McCormick, Thomas Mowbray, Anti Patterns:

Refactoring Software, Architectures, and Projects in Crisis, Wiley, 1992• Clemens Szyperski, Component Software: Beyond Object-Oriented Programming, 2nd Edition,

Addison-Wesley, 2002• Len Bass, Paul Clements, Rick Kazman, Ken Bass, Software Architecture in Practice, 2nd

Edition, Addison-Wesley, 2003• Martin Fowler, Patterns of Enterprise Application Architecture, Addison Wesley, 2002• Luke Hohmann, Beyond Software Architecture: Creating and Sustaining Winning Solutions,

Addison-Wesley, 2003• Ian Gorton, Essential Software Architecture, Springer 2006