ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094...

18
10/27/2014 1 MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: [email protected] Fall 2014 MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014 Exams Date Time Place: Exam 1: Friday, 09-Jan-2015, 14:15-16:15, room 2-405 Exam 2: Friday, 16-Jan-2015, 14:15-16:15, room 2-405 Re-take Exam: Friday, 23-Jan-2015, 14:15-16:15, room 2-405 Capacity limit of 90 students You must register: First-come-first-serve (FIFO) principle MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014 Schedule of Lectures Week 01: Introduction to SE Week 02: Requirements Engineering I Week 03: Requirements Engineering II Week 04: Analysis Week 05: Dev. Infrastructure I Week 06: Dev. Infrastructure II Week 07: ICS Day / ATI Päev 2014 Week 08: Architecture and Design Week 09: Refactoring Week 10: Verification and Validation Week 11: Software Quality Management Week 12: Agile/Lean Methods Week 13: Measurement & Process Improvement Week 14: Course wrap-up, review and exam preparation Week 15: no lecture Week 16: no lecture MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014 Acknowledgements Textbooks/Slides: Ian Sommerville: Software Engineering, 9th edition, 2010 (http://www.softwareengineering-9.com/) Hans van Vliet: Software Architecture, Free University of Amsterdam, Lecture 2008 Richard Taylor et al.: Software Architecture, University of California at Irvine, Lecture 2011 Alexander Serebrenik: Software architecture: Domain-Specific Software Architecture and Architectural Patterns, TU Eindhoven, Lecture 2013 George Fairbanks: Just Enough Software Architecture, 2012 (Video: https://www.youtube.com/watch?v=x30DcBfCJRI) MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014 Structure of Lecture 07 What is it? Why bother? Terminology: Architect, Architecting, Architecture Viewpoints and View Models Notation Patterns, Styles and DSSAs Analysis/Assessment Wrap-up MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014 A tale of two systems

Transcript of ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094...

Page 1: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

1

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

MTAT.03.094

Software Engineering

Lecture 07: Architecture

and Design

Dietmar Pfahl

email: [email protected] Fall 2014

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Exams

Date – Time – Place:

• Exam 1: Friday, 09-Jan-2015, 14:15-16:15, room 2-405

• Exam 2: Friday, 16-Jan-2015, 14:15-16:15, room 2-405

• Re-take Exam: Friday, 23-Jan-2015, 14:15-16:15, room 2-405

• Capacity limit of 90 students

• You must register: First-come-first-serve (FIFO) principle

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Schedule of Lectures

Week 01: Introduction to SE

Week 02: Requirements Engineering I

Week 03: Requirements Engineering II

Week 04: Analysis

Week 05: Dev. Infrastructure I

Week 06: Dev. Infrastructure II

Week 07: ICS Day / ATI Päev 2014

Week 08: Architecture and Design

Week 09: Refactoring

Week 10: Verification and Validation

Week 11: Software Quality

Management

Week 12: Agile/Lean Methods

Week 13: Measurement & Process

Improvement

Week 14: Course wrap-up, review and

exam preparation

Week 15: no lecture

Week 16: no lecture

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Acknowledgements

Textbooks/Slides:

• Ian Sommerville: Software Engineering, 9th edition, 2010 (http://www.softwareengineering-9.com/)

• Hans van Vliet: Software Architecture, Free University of Amsterdam, Lecture 2008

• Richard Taylor et al.: Software Architecture, University of California at Irvine, Lecture 2011

• Alexander Serebrenik: Software architecture: Domain-Specific Software Architecture and Architectural Patterns, TU Eindhoven, Lecture 2013

• George Fairbanks: Just Enough Software Architecture, 2012 (Video: https://www.youtube.com/watch?v=x30DcBfCJRI)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Structure of Lecture 07

• What is it? Why bother?

• Terminology: Architect, Architecting, Architecture

• Viewpoints and View Models

• Notation

• Patterns, Styles and DSSAs

• Analysis/Assessment

• Wrap-up

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

A tale of two systems

Page 2: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

2

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Let’s design a system!

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

The system is real – Rackspace

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Rackspace: Architecture 1

CSR: Customer Service Request

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Rackspace: Architecture 2

CSR: Customer Service Request

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Rackspace: Architecture 3

CSR: Customer Service Request

(https://www.usenix.org/legacy/publications/library/proceedings/osdi04/tech/full_papers/dean/dean_html/index.html)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Rackspace: Quality Attribute Trade-offs

Page 3: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

3

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

What if you don’t think architecturally?

Remember: All programs have an architecture ... But not every architecture suits the program!

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Virtuosos and Roman Engineers

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Structure of Lecture 07

• What is it? Why bother?

• Terminology: Architect, Architecting, Architecture

• Viewpoints and View Models

• Notation

• Patterns, Styles and DSSAs

• Analysis/Assessment

• Wrap-up

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Terminology

• Architect – Person

• Architecting – Process

• Architecture – Product

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

The Role of the Architect

client,

usersarchitect developers

appearance,

behaviour

construction,

co-operation

architectural

design

visualises prescribes

requirements solutions

createsassess assess

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Pre-Architecture Life-Cycle

functionality

agreement

quality

development

stakeholders (few)

Characteristics:

• Iteration mainly on functional requirements

• Few stakeholders involved

• No balancing of functional and quality requirements

Page 4: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

4

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Adding Architecture: The Easy Way

architecture

detailed design

implementation

functionality

agreement

quality

development

stakeholders (few)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Architecture in the Life-Cycle

functionality

architecture

quality

agreement

stakeholders (many)

development

Characteristics:

• Iteration on both functional and quality requirements

• Many stakeholders involved

• Balancing of functional and quality requirements

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Architecture Drivers Importance

Difficulty

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Rational Architecture Decisions

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Design Issues, Options and Decisions

A designer is faced with a series of design issues

These are sub-problems of the overall design problem.

For example, a design issue can be the type and level of security.

Security can be decomposed into authentication, authorization, and privacy.

Each issue normally has several alternative solutions (or design options)

The designer makes a design decision to resolve each issue.

This process involves choosing the best option from among the alternatives.

Attribute-Driven Design (ADD)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

ADD Example Iterations

Top-level:

• usability separate UI 3-tier architecture

Lower-level, within user interface:

• security authenticate users

Lower-level, within data layer:

• availability active redundancy

Page 5: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

5

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Decision Space

• The space of possible designs that can be achieved by choosing different sets of alternatives.

Issues that can be relevant in the decision process could be: - level of flexibility; - outsourcing/external

acquisition of client technology (that mans need for separate presentation – also relevant for the budget);

- if using the Web/Internet; - performance; ...

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Tree or Graph?

• Issues and options are not independent ...

A number of options become invalid due to a desired NFR (quality). For example, flexibility could be achieved through certain architectural patterns, like MVC which facilitates separation of concerns and layered architecture restricting client-server interactions. If we choose any of the two, we exclude the 'monolithic' sub-tree and we need a separate GUI layer.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

More than just IT

• Technical and non-technical issues and options are intertwined

• Architects deciding on the type of database

versus

• Management deciding on new strategic partnership

or

Management deciding on budget

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Once again: Why is documenting design

decisions important?

• Prevents repeating (expensive) past steps

• Explains why this is a good (better: suitable) architecture

• Emphasizes qualities and criticality for requirements/goals

• Provides context and background

Design rationale example:

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Architecture in Construction of Buildings

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Software Architecture

• Architecture is conceptual.

• Architecture is about fundamental things.

• Architecture exists in some context.

Architectural descriptions are concrete, but the architecture itself is inherently conceptual, and cannot be captured in any (set of) views – nor in the code. Abstraction !!! We can only understand qualities in context. -> Views !!!

Page 6: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

6

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Software Architecture – Definition (1)

The architecture of a software system defines that system in terms of computational components and interactions among those components.

(from Shaw and Garlan, Software Architecture, Perspectives on an Emerging Discipline, Prentice-Hall, 1996)

statement

procedure

module

(design) pattern

architecture

2

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Software Architecture – Definition (2)

The software architecture of a system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them.

(from Bass, Clements, and Kazman, Software Architecture in Practice, SEI Series in Software Engineering. Addison-Wesley, 2003)

3

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Software Architecture – Definition (3)

Architecture is the fundamental organization of a system embodied in its components, their relationships to each other and to the environment and the principles guiding its design and evolution

(from IEEE Standard on the Recommended Practice for Architectural Descriptions, 2000)

4

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Architecture – Sloppy Definitions

• Architecture is high-level design

• Architecture is overall structure of the system

• Architecture is components and connectors

• Architecture is

• the structure,

• the behavior (properties),

• and the principles and guidelines governing its design and evolution over time

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Structure of Lecture 07

• What is it? Why bother?

• Terminology: Architect, Architecting, Architecture

• Viewpoints and View Models

• Notation

• Patterns, Styles and DSSAs

• Analysis/Assessment

• Wrap-up

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Analogy with Building Architecture

• Overall picture of building (client)

• Front view (client, “beauty” committee)

• Separate picture for water supply (plumber)

• Separate picture for electrical wiring (electrician)

• etc

Page 7: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

7

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

IEEE Model for Architectural Descriptions

Mission

Sy stemEnv ironment Architecture

RationaleArchitecture Description

Concern

Library Viewpoint

Viewpoint

Stakeholder

Model

View

Mission

Sy stemEnv ironment Architecture

RationaleArchitecture Description

Concern

Library Viewpoint

Viewpoint

Stakeholder

Model

View

System stakeholder: an individual, team, or organization (or classes hereof) with interests in, or concerns relative to, a system.

View: a representation of a whole system from the perspective of a related set of concerns.

Viewpoint: A viewpoint establishes the purposes (concerns) and audience (stakeholders) for a view and the techniques or methods employed in constructing a view.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Kruchten’s 4+1 View Model

Logical Viewpoint

Implementation Viewpoint

Process Viewpoint

Deployment Viewpoint

Scenarios

End-user Functionality

Programmers Software management

Integrators Performance Scalability

System engineers Topology

Communications

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Kruchten’s 4+1 View Model

Logical Viewpoint

Implementation Viewpoint

Process Viewpoint

Deployment Viewpoint

Scenarios

End-user Functionality

Programmers Software management

Integrators Performance Scalability

System engineers Topology

Communications

Supports the functional requirements, i.e., the services the system should provide to its end users. Typically, it shows the key abstractions (e.g., classes and associations amongst them).

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Kruchten’s 4+1 View Model

Logical Viewpoint

Implementation Viewpoint

Process Viewpoint

Deployment Viewpoint

Scenarios

End-user Functionality

Programmers Software management

Integrators Performance Scalability

System engineers Topology

Communications

Takes into account some nonfunctional requirements, such as performance and system availability. It addresses concurrency and distribution, system integrity, and fault-tolerance. The process view also specifies which thread of control executes each operation of each class identified in the logical view. So the process view describes the mapping of functions to runtime elements. It concerns the dynamics of the system. A process is a group of tasks which form a logical unit. A process can be started, stopped, resumed, etc., and there is communication between processes.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Kruchten’s 4+1 View Model

Logical Viewpoint

Implementation Viewpoint

Process Viewpoint

Deployment Viewpoint

Scenarios

End-user Functionality

Programmers Software management

Integrators Performance Scalability

System engineers Topology

Communications

Focuses on the organization of the actual software modules in the software-development environment. The software is packaged in small chunks (program libraries or subsystems) that can be developed by one or more developers.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Kruchten’s 4+1 View Model

Logical Viewpoint

Implementation Viewpoint

Process Viewpoint

Deployment Viewpoint

Scenarios

End-user Functionality

Programmers Software management

Integrators Performance Scalability

System engineers Topology

Communications

=> Physical view: Defines how the various elements identified in the logical, process, and implementation views (networks, processes, tasks, and objects) must be mapped onto the various nodes. Takes into account the system's non-functional requirements such as system availability, reliability (fault-tolerance), performance (throughput), and scalability.

Page 8: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

8

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

4 + 1: Scenario Viewpoint

• Consists of a small subset of important scenarios (e.g., use cases) to show that the elements of the four views work together seamlessly.

• This view is redundant with the other ones (hence the "+1"), but it plays two critical roles:

• Acts as a driver to help designers discover architectural elements during the architecture design;

• Validates and illustrates the architecture design, both on paper and as the starting point for the tests of an architectural prototype.

Logical Viewpoint

Implementation Viewpoint

Process Viewpoint

Deployment Viewpoint

Scenarios

End-user Functionality

Programmers Software management

Integrators Performance Scalability

System engineers Topology

Communications

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Structure of Lecture 07

• What is it? Why bother?

• Terminology: Architect, Architecting, Architecture

• Viewpoints and View Models

• Notation

• Patterns, Styles and DSSAs

• Analysis/Assessment

• Wrap-up

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Standard Notation: UML

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Architecture presentations in practice

• By and large two flavors:

• Powerpoint slides – for managers, users, consultants, etc

• UML diagrams, for technicians

• A small sample …

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Conceptual View Customer, Users

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

More technical view Developers (same system as on previous slide)

Page 9: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

9

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Runtime Component Deployment View Component clientArs User machine Search App. Server 1, App Server 2 (WebLogic 7.0) ReserveAndBuy App. Server 1, App Server 2 (WebLogic 7.0) Authenticate App. Server 1, App Server 2 (WebLogic 7.0) ArsStartup App. Server 1, App Server 2 (WebLogic 7.0) LocalRestart App. Server 1, App Server 2 (WebLogic 7.0) ARS Database DB Server (MS SQL Server) CreditCard Database DB Server (MS SQL Server) CreditCard Naming server & Replication mgr God Naming server & Replication mgr

Runtime View Deployment View

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Application layer This Application layer has all the boundary classes that represent the application screens that the user sees. Business Services layer The Business Services process layer has all the controller classes that represent the use case managers that drive the application behavior. This layer represents the client-to-mid-tier border. Middleware layer The Middleware layer supports access to Relational DBMS and OODBMS. Base Reuse package The Base Reuse package includes classes to support list functions and patterns.

High-level overview of the architecture (Logical view – Implementation view)

A University Course Catalogue System

(see doc on course wiki)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Process view of the architecture. Shows the tasks (processes and threads) involved in the system's execution, their interactions and configurations. Processes exist to support student registration, professor functions, registration closing, and access to the external Billing System and Course Catalog System.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Deployment view of the architecture. Shows the various physical nodes for the most typical platform configurations. Also shows the allocation of tasks (from the Process View) to the physical nodes.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

So, …

• Different representations

• For different people

• For different purposes

• These representations are both descriptive and prescriptive

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Structure of Lecture 07

• What is it? Why bother?

• Terminology: Architect, Architecting, Architecture

• Viewpoints and View Models

• Notation

• Patterns, Styles and DSSAs

• Analysis/Assessment

• Wrap-up

Page 10: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

10

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Learning from Others:

Patterns, Styles, and DSSAs

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John

Wiley & Sons, Inc. Reprinted with permission.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

How to solve a problem?

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Examples of Domains

• Compilers for programming languages

• Consumer electronics

• Electronic commerce system/Web stores

• Video game

• Business applications

• Basic/Standard/“Pro”

We can subdivide, too: • Avionics systems -> Boeing Jets -> Boeing 747-400

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Domain-Specific Software Architectures

• A DSSA is an assemblage of software components

• specialized for a particular type of task (domain),

• generalized for effective use across that domain, and

• composed in a standardized structure (topology) effective for building successful applications.

• DSSAs are the pre-eminent means for maximal reuse of knowledge and prior development.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Domain-Specific Software Architectures

A DSSA comprises:

• A reference architecture, which describes a general computational framework for a significant domain of applications

• A component library, which contains reusable chunks of domain expertise, and

• An application configuration method for selecting and configuring components within the architecture to meet particular application requirements

Examples:

• ADAGE for avionics, AIS for adaptive intelligent systems, and MetaH for missile guidance, navigation, and control systems

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Reference Architecture – Example

• Structural view of Lunar Lander DSSA

• Invariant with explicit points of variation

• Satellite relay

• Sensors

Page 11: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

11

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Reference Architecture

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Reference Architecture

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Reference Architecture

MURA: Microsoft Upstream Reference Architecture

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

DSSAs also include …

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Extreme Case of DSSA ...

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Product Line Architecture

Page 12: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

12

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Product Line Architecture – Why?

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

How do Product Lines come to be?

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Example: Lunar Lander Game

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Example: Lunar Lander Game

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Product Lines in the Lunar Lander Game

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Product Lines: Components, Features, Products

Page 13: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

13

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Better Representation: Variability Model

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

DSSAs vs. Product Lines

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Architectural Patterns

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

State-Logic-Display (a.k.a. Three-Tier Pattern)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

State-Logic-Display (a.k.a. Three-Tier Pattern)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

State-Logic-Display in Web Development

Page 14: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

14

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Tiers and Layers

Note: The middle tier might be multi-tiered (resulting in an n-tier architecture)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Model-View-Controller (MVC)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Model-View-Controller (MVC)

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Do you recall ...?

Boundary = View Entity = Model Control = Controller

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Two Flavors of MVC: Passive Model

• The passive model is employed when one controller manipulates the model exclusively.

• The controller modifies the model and then informs the view that the model has changed and should be refreshed.

• The model is completely independent of the view and the controller, i.e. there is no means for the model to report changes in its state.

• The HTTP protocol is an example of this. There is no simple way in the browser to get asynchronous updates from the server. The browser displays the view and responds to user input, but it does not detect changes in the data on the server.

• Only when the user explicitly requests a refresh is the server interrogated for changes.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Two Flavors of MVC: Active Model

Solution: Observer Design Pattern!

Page 15: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

15

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Two Flavors of MVC: Active Model

Figure shows the structure of the active MVC using Observer and how the observer isolates the model from referencing views directly.

Java code example: http://en.wikipedia.org/wiki/Observer_pattern

Observer Pattern:

The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Benefits and Liabilities of MVC

Benefits

Liabilities

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Patterns, Styles, and DSSAs

Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic, and Eric M. Dashofy; © 2008 John

Wiley & Sons, Inc. Reprinted with permission.

• Pipes and filters • Data abstraction and

object-oriented organization

• Layered systems • Repositories • Event-based, implicit

invocation • ... and many more

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Patterns – Styles – Patterns

• Architectural patterns <> Architectural styles <> Design patterns.

• While architectural styles define the components and connectors possible within the system (more asking ‘what?’), architectural patterns define the implementation strategies of those same components and connectors (a bit more on ‘how?’).

• Example: Model-View-Controller (MVC) pattern

• At the same time, a good architecture will make use of design patterns (on a more fine-granular level)

• Example: Observer pattern used to implement (active) MVC pattern

• Different architectural styles will find different architectural and design patterns more or less helpful.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Design Patterns

• A design pattern is a way of reusing abstract knowledge about a problem and its solution.

• A pattern is a description of the problem and the essence of its solution.

• It should be sufficiently abstract to be reused in different settings.

• Pattern descriptions usually make use of object-oriented characteristics such as inheritance and polymorphism.

ELEMENTS:

Name

A meaningful pattern identifier.

Problem description.

Solution description (might have an example)

Not a concrete design but a template for a design solution that can be instantiated in different ways.

Benefits and Consequences

The results and trade-offs of applying the pattern.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

The Observer Pattern

Name: Observer

Problem description

• Situations where multiple displays of state are needed.

Solution description

• Separates the display of object state from the object itself.

• See UML description.

Consequences

• Optimisations to enhance display performance are difficult.

Page 16: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

16

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Three Types of

Patterns

Creational patterns:

• Deal with initializing and configuring classes and objects

Structural patterns:

• Deal with decoupling interface and implementation of classes and objects

• Composition of classes or objects

Behavioral patterns:

• Deal with dynamic interactions among societies of classes and objects

• How they distribute responsibility

Observer

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Benefits of Design Patterns

• Design patterns enable large-scale reuse of software architectures and also help document systems

• Patterns explicitly capture expert knowledge and design tradeoffs and make it more widely available

• Patterns help improve developer communication

• Pattern names form a common vocabulary

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Structure of Lecture 07

• What is it? Why bother?

• Terminology: Architect, Architecting, Architecture

• Viewpoints and View Models

• Notation

• Patterns, Styles and DSSAs

• Analysis/Assessment

• Wrap-up

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Architecture Evaluation/Analysis

• Assess whether architecture allows system to meet certain quality goals

• e.g. regarding maintainability, modifiability, reliability, performance, ...

• Note: the architecture is assessed, while we hope the results will hold for a system yet to be built

Software architecture

System

Properties Qualities

implementation

properties ?

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Analysis Techniques and Scenarios

• Questioning techniques:

• how does the system react to various situations;

• often make use of scenarios

• Measuring techniques:

• rely on quantitative measures; architecture metrics, simulation, etc.

• Different types of scenarios, e.g. use-cases, likely changes, stress situations, risks, far-into-the-future scenarios

• Which stakeholders to ask for scenarios?

• When do you have enough scenarios?

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Exercise: Analyse of Alarm Clock Architectures

Consider standard alarm clocks that you have seen.

For this exercise, consider each of the following to be representative of an architectural style of alarm clocks:

• An LED alarm clock for a bedroom,

• A LCD travel alarm,

• An analog alarm clock (there are several varieties; choose one).

Page 17: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

17

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

List of Analysis Methods

• SAAM (Scenario-based Architecture Analysis Method)

• SAAMER (Software Architecture Analysis Method for Evolution and Reusability)

• ATAM (The Architecture Trade-Off Analysis Method)

• SBAR (Scenario-Based Architecture Reengineering)

• ... and many more ...

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Scenario-based Architecture Analysis

Method (SAAM)

• Describe architecture(s)

• Based on desired system qualities, develop scenarios for

• kinds of activities the system must support

• kinds of changes anticipated

• Classify scenarios in direct & indirect

• direct -- execution of scenario requires no change of architecture

• indirect – execution of scenario requires change of architecture

• Evaluate indirect scenarios: list changes and estimate cost

• Reveal scenario interaction

• Overall evaluation

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Scenario-based Architecture Analysis

Method (SAAM)

• List of scenarios

• Examples:

• User U1 wants to have added another feature

• Maintainer M1 wants to port the system to platform XYZ

• Maintainer M2 wants to change the look-and-feel of the GUI

U1 and M1 interact because they require changes to the same components

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Scenario-based Architecture Analysis

Method (SAAM)

Overview: SAAM inputs and activities

Goal: By analysing the extend and difficulty (cost) of required changes (indirect scenarios) as well as the extent of scenario interactions, SAAM allows an insight to the future product capabilities, if the given architecture is chosen.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Conditions for Successful Architecture

Analysis/Evaluation

• Clear goals and defined quality requirements for the architecture

• Controlled scope – focus on most important goals and quality requirements

• Cost-effectiveness

• Key personnel availability – e.g. for scenario dev.

• Competent evaluation team – ideally independent from developers/owners of architecture

• Managed expectations

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Structure of Lecture 07

• What is it? Why bother?

• Terminology: Architect, Architecting, Architecture

• Viewpoints and View Models

• Notation

• Patterns, Styles and DSSAs

• Analysis/Assessment

• Wrap-up

Page 18: ETSF01 - Lecture 1 · 10/27/2014 1 MTAT.03.094/ Lecture 07 / © Dietmar Pfahl 2014 MTAT.03.094 Software Engineering Lecture 07: Architecture and Design Dietmar Pfahl email: dietmar.pfahl

10/27/2014

18

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Why is Architecture Important?

• Architecture is the vehicle for stakeholder communication

• Architecture manifests the earliest set of design decisions

• Constraints on implementation

• Dictates organizational structure

• Inhibits or enables quality attributes

• Architecture is a transferable abstraction of a system

• Product lines share a common architecture

• Allows for template-based development

• Basis for training

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Further Reading

• Len Bass et al, Sofware Architecture in Practice, 2008 (3rd edition).

• Jan Bosch, Design & Use of Software Architectures, 2000.

• Frank Buschmann et al., Pattern-Oriented Software Architecture: A System of Patterns, 1996. Part II: 2001.

• George Fairbanks: Just Enough Software Architecture, 2012.

• Erich Gamma et al., Design Patterns: Elements of Reusable Object-Oriented Software, 1995.

• C. Hofmeister et al., Applied Software Architecture, 1999.

• Philippe B. Kruchten, The 4+1 view model of architecture, IEEE Software, 12(6):42-50, November 1995.

• Mary Shaw and David Garlan, Software Architecture; Perspectives of an Emerging Discipline, 1995.

• Richard Taylor et al.: Software Architecture, University of California at Irvine, Lecture 2011.

• Ian Sommerville: Software Engineering, 9th edition, 2010. (http://www.softwareengineering-9.com/)

• Hans van Vliet: Software Architecture, Free University of Amsterdam, Lecture 2008.

MTAT.03.094 / Lecture 07 / © Dietmar Pfahl 2014

Next Lecture

• Date/Time:

• Friday, 31-Oct, 14:15-16:00

• Topic:

• Refactoring (and TDD)

• For you to do:

• Finish and submit Lab Task 4