Software Architecture Software Engineering Alessio Gambi - Saarland - - PowerPoint PPT Presentation

software architecture
SMART_READER_LITE
LIVE PREVIEW

Software Architecture Software Engineering Alessio Gambi - Saarland - - PowerPoint PPT Presentation

Software Architecture Software Engineering Alessio Gambi - Saarland University These slides are based the slides from Cesare Pautasso and Christoph Dorn, and updated from various sources. References and Readings Textbooks R. N. Taylor,


slide-1
SLIDE 1

Software Architecture

Software Engineering Alessio Gambi - Saarland University

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

slide-2
SLIDE 2

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
slide-3
SLIDE 3

Intro and Motivation

slide-4
SLIDE 4

Design in the Large

  • Objects and methods
  • Modules and components
  • Large and complex systems
  • Systems of systems
slide-5
SLIDE 5

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
slide-6
SLIDE 6

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

slide-7
SLIDE 7

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 is a machine; a building is not
  • Software deployment has no counterpart in building

architecture

slide-8
SLIDE 8

Basic Concepts and Definitions

slide-9
SLIDE 9

Software Architecture

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

  • N. Taylor et al.
slide-10
SLIDE 10

Abstraction

Manage complexity in the design

slide-11
SLIDE 11

Communication

Document, remember and share design decisions among the team

slide-12
SLIDE 12

Visualization

slide-13
SLIDE 13

Representation

slide-14
SLIDE 14

Quality Analysis

Understand, predict, and control

slide-15
SLIDE 15

When Sw. Architecture Start ?

Since the beginning of design!

slide-16
SLIDE 16

Never!

Architecture is NOT a phase of development

When Sw. Architecture Stop ?

slide-17
SLIDE 17

Every system has a Software Architecture

Descriptive vs Prescriptive

slide-18
SLIDE 18

Every system has a Software Architecture

Descriptive vs Prescriptive

slide-19
SLIDE 19

Architectural Evolution

Decisions are made over time Decisions are changed over time Decision are made by more than one person

The system architecture changes over time

slide-20
SLIDE 20

Architectural Degradation

P D

Ideal P=D

slide-21
SLIDE 21

Architectural Degradation

P D

Ideal P=D Drift P !=D and D does not violate P

slide-22
SLIDE 22

Architectural Degradation

P D

Ideal P=D Drift P !=D and D does not violate P Erosion P !=D and D violates P

slide-23
SLIDE 23

Software Architecture

  • Blueprint for construction and evolution

abstraction • principal design decisions

  • Not only about design

communicate • visualize • represent • quality

  • Every application has one, which evolves

descriptive • prescriptive • drift • erosion


  • Not a phase of development
slide-24
SLIDE 24

The Software Architect

Is the one that takes strategic design decision

slide-25
SLIDE 25

The Software Architect

Is the one that takes strategic design decision

Development Leader Technology Expert Communicator Risk Manager

slide-26
SLIDE 26

Architects as …

  • Software Development Experts
  • Consultants
  • Domain Experts
  • Strategists
  • Cost Estimators

Skills and experience: The best architects are grown, not born

slide-27
SLIDE 27

Design

slide-28
SLIDE 28

How to Design

Even 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 with incremental improvements.

slide-29
SLIDE 29

Architectural Hoisiting

George Fairbanks

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: design/reuse a plug-in framework
slide-30
SLIDE 30

What makes a “good” 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)

Design principles - Arch. Patterns - Arch. Styles

slide-31
SLIDE 31

Design Principles

  • Abstraction
  • Encapsulation - Separation of Concerns
  • Modularization
  • KISS (Keep it simple, stupid)
  • DRY (Don’t repeat yourself)
slide-32
SLIDE 32

Architectural Patterns

An architectural pattern is a set of architectural design decisions that are applicable to a recurring design problem, and parameterized to account for different software development contexts in which that problem appears.

slide-33
SLIDE 33

Architectural Patterns

An architectural pattern is a set of architectural design decisions that are applicable to a recurring design problem, and parameterized to account for different software development contexts in which that problem appears.

Layered - Component - Events - Composition

slide-34
SLIDE 34

Model-View-Controller

separate content (model) from presentation (output) and interaction (input) Layered

slide-35
SLIDE 35

Dependency Injection

use a container which updates components with bindings to their dependencies Components

slide-36
SLIDE 36

Half-Synch/Half-Asynch

Add a layer hiding asynchronous interactions behind a synchronous interface Events

slide-37
SLIDE 37

Master/Slave

split a large job into smaller independent partitions which can be processed in parallel Composition

slide-38
SLIDE 38

Architectural vs Design Patterns

Express fundamental structural organizations Specify relationships among (sub-)systems Capture roles in solutions that occur repeatedly Define the relationships among roles

slide-39
SLIDE 39

Architectural Styles

Named collections of architectural decisions that are applicable in a development context. They constrain architectural design decisions, 
 are specific to the system within that context, and elicit beneficial qualities in each resulting system

slide-40
SLIDE 40

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

slide-41
SLIDE 41

Monolithic

Client/Server

slide-42
SLIDE 42

Layered Plug-in

slide-43
SLIDE 43

Styles vs Patterns

Usually there is one dominant style The same pattern can be used many times Many patterns are usually combined General constraints Fine-grained constraints Architecture with
 superior properties Specific to recurrent problems Styles must be refined and adapted

slide-44
SLIDE 44

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 not stop at the choice of patterns and


styles: further refinement is needed

slide-45
SLIDE 45

Modeling

slide-46
SLIDE 46

Why modeling?

  • Record decisions
  • Communicate decisions
  • Evaluate decisions
  • Generate artifacts
slide-47
SLIDE 47

What do we model ?

  • The system-to-be (Design model)
  • Static architecture
  • Dynamic architecture
  • Quality attributes and non-functional properties
  • The problem (Domain model)
  • The environment (System context and stakeholders)
  • The design process
slide-48
SLIDE 48

Design Model

Software Components Software Connectors Component assembly System Context Interfaces/API Quality Attributes

Boundary Model Internal Model

Internal behavior Externally visible behavior

slide-49
SLIDE 49

Reusable unit of composition Can be composed into larger systems

State in a system

Software Components

Application-specific — Infrastructure

Media Player Math Library Web Server Database Locus of computation

slide-50
SLIDE 50

Composition and Distribution

slide-51
SLIDE 51

Component Roles

slide-52
SLIDE 52

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

slide-53
SLIDE 53

Component Interfaces

slide-54
SLIDE 54

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
slide-55
SLIDE 55

Required Interface

  • Specify the conditions upon which a component

can be reused

  • The platform is compatible
  • The environment is setup correctly
slide-56
SLIDE 56

Compatible Interfaces

Component interfaces must match perfectly to be connected Adapter Wrapper

slide-57
SLIDE 57

Software Connectors

Model static and dynamic aspects of the
 interaction between component interfaces

slide-58
SLIDE 58

Connector Roles

  • Communication

deliver data and transfer of control, support different communication mechanisms, quality of the delivery

  • Coordination

control the delivery of data, separate control from computation

  • Conversion

enable interaction of mismatched components

  • Facilitation

mediate the interaction among components, govern access to shared information, provide synchronization

slide-59
SLIDE 59

Connectors, not Components!

Connectors are not usually directly visible in the code, which is not true for components Connectors are mostly application-independent, while components can be both application- dependent or not

slide-60
SLIDE 60

Connectors are abstractions

When to hide components inside a connector ?

slide-61
SLIDE 61

Remote Procedure Call Stream

slide-62
SLIDE 62

Message Bus The Web

slide-63
SLIDE 63

Views and Viewpoints

slide-64
SLIDE 64

Viewpoint View

A subset of related architectural design decisions The common concerns shared by a view

slide-65
SLIDE 65

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

Consistency

slide-66
SLIDE 66

How many views?

  • 4+1 by Kruchten: Logical, Physical, Process,

Development, and Scenarios

  • 5 by Taylor et al.: Logical, Physical, Deployment,

Concurrency, Behavioral

  • 3 by Bass et al.: Component & Connector, Module

View, Behavior

slide-67
SLIDE 67

How many views?

  • 4+1 by Kruchten: Logical, Physical, Process,

Development, and Scenarios

  • 5 by Taylor et al.:

Concurrency, Behavioral

  • 3 by Bass et al.:

View, Behavior

slide-68
SLIDE 68

4+1

Philippe Kruchten

Logical View Development View Physical View Process View Use Case Scenarios

slide-69
SLIDE 69

Use Case Scenarios

  • Unify and link the elements of the other 4 views
  • Scenarios help to ensure that the architectural model

is complete with respect to requirements

  • The architecture can be broken down according to

the scenarios and illustrated using the other 4 views

slide-70
SLIDE 70

Music Player Scenarios

  • Browse for new songs
  • Pay to hear the entire song
  • Download the purchased song on the phone
  • Play the song
slide-71
SLIDE 71

Logical View

  • Decompose the system structure into software

components and connectors

  • Map functionality (use cases) onto the components
  • Concern: Functionality
  • Target Audience: Developers and Users
slide-72
SLIDE 72
slide-73
SLIDE 73

Process View

  • Model the dynamic aspects of the architecture and

the behavior its parts

  • active components
  • concurrent threads
  • Describe how processes/threads communicate
  • RPC
  • Message bus
  • Concern: Functionality, Performance
  • Target Audience: Developers
slide-74
SLIDE 74

Use Cases: Browse, Pay and Play For Songs

slide-75
SLIDE 75

Development View

  • Static organization of the software code artifacts
  • packages
  • modules
  • binaries
  • Mapping between the elements in the logical view

and the code artifacts

  • Concern: Reuse, Portability, Build
  • Target Audience: Developers
slide-76
SLIDE 76
slide-77
SLIDE 77

Physical View

  • Hardware environment where the software will be

deployed

  • hosts
  • networks
  • storage
  • Mapping between logical and physical entities
  • Concern: Quality attributes
  • Target Audience: Operations
slide-78
SLIDE 78