35
WATERLOO CHERITON SCHOOL OF COMPUTER SCIENCE Architectural Blueprint Architectural Blueprint The 4+1 View Model The 4+1 View Model of Software Architecture of Software Architecture ” ” by Philippe Kruchten by Philippe Kruchten CS 446/646 ECE452 May 30 th , 2011 IMPORTANT NOTICE TO STUDENTS These slides are NOT to be used as a replacement for student notes. These slides are sometimes vague and incomplete on purpose to spark a class discussion

Architectural Blueprint - University of Waterloo

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Architectural Blueprint - University of Waterloo

WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Architectural BlueprintArchitectural Blueprint““The 4+1 View Model The 4+1 View Model 

of Software Architectureof Software Architecture” ” 

by Philippe Kruchtenby Philippe Kruchten

CS 446/646 ECE452May 30th, 2011

IMPORTANT NOTICE TO STUDENTS

These slides are NOT to be used as a replacement for student notes.These slides are sometimes vague and incomplete on purpose to spark a class discussion

Page 2: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 2WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Architectural ModelDefinition[1]● Software architecture = {Elements, Forms, Constraints}

Definition [2]● “deals with the design and implementation of the high-

level structure of the software.

It is the result of assembling a certain number of architectural elements in some well-chosen forms to satisfy the major functionality and .... nonfunctional requirements”

[1] D. E. Perry & A. L. Wolf, “Foundations for the Study of Software Architecture,” ACM Software Engineering Notes, 17, 4, October 1992, 40-52

[2] P. B. Kruchten. The 4+1 View Model of architecture. IEEE Software, 12(6), Nov. 1995, pp. 42–50.

Page 3: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 3WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Is this an Architectural Model?

Software/System

Developers

Designers

Managers

End-Users

Owners

Buildengineers

Testengineers

Sale reps

Deploymentengineers

Software/System stakeholders Model

What is going on here?

Page 4: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 4WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Desired AttributesAddresses & captures● concerns of various stakeholders

– stakeholders:● end-users, developers, system engineers, project management● testers, support teams

● requirements– functional– non-functional

● performance, availability, concurrency, distribution, fault tolerance, security, testing, usability, configuration management, evolution, monitoring

Page 5: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 5WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Desired AttributesAn abstraction● represents the high level view

Is robust● adaptable● scalable● iterative

Meaningful & maintainable● has to be a live document

– changes with the system

Page 6: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 6WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Types of Architectural StylesBox & line model

Architectural definition language (ADL)

View based models● 4+1 view model (1995)

Page 7: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 7WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

4+1 View ModelModel● a model is composed of 5 views

– a single view is not enough

View ● is catered for a set of corresponding stakeholders

– addresses the concerns of its stakeholders● contains view elements

– components, connectors, notation ● generic representation

Page 8: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 8WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

4+1 View Model

LogicalView

DevelopmentView

ProcessView

PhysicalView

ScenarioView

Perhaps it should have been called 1+4 View Model

Page 9: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 9WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Logical ViewIntent● 'object model' of the design● is generally the starting point● addresses primarily functional requirements● decomposition into 'architectural entities'

Style● abstract data types / OO

Stakeholders● end-users, architects, designers

Page 10: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 10WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Logical ViewView representations● 1. OOA (object oriented analysis)

– entities are analysis classes– application of OOA principles

● abstraction, encapsulation. inheritance● association (aggregation, composition)

– class diagrams, state diagrams● 2. data centric analysis

– entity relationship (ER) diagrams

which is the correct view representation?

Page 11: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 11WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Example Logical View

Page 12: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 12WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Logical ViewDesign guidelines● a single (object) model across the system (why?)● avoid premature specialization (of what?)● UML diagrams

– class, communication, sequence diagrams

Page 13: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 13WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Process ViewIntent● handles the non-functional requirements● abstraction of architectural processes

Page 14: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 14WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Process ViewArchitectural Process● grouping of tasks into executable units

– task: thread of control● task hierarchy: major & minor tasks

– reflects task scope● types: atomic & distributed● can be replicated

– to improve performance, availability etc.● execute on 'process nodes' (what is a process node?)

Page 15: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 15WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Process ViewCommunication● messaging (synchronous, asynchronous, RPC, broadcast)

– usually for major tasks● shared memory

– for minor tasks● can we estimate the system load form the inter-process

communication?

Page 16: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 16WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Process ViewStyle● several styles are applicable

– pipes & filters– layered

● client / server

Stakeholders● integrators, architects

Page 17: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 17WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Example Process View

Page 18: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 18WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Development ViewIntent● software/system decomposition into software modules● software modules

– name space, packages, libraries, subsystems– modules are scoped for small (development) teams

Driven by internal requirements

Page 19: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 19WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Development ViewIntent● software/system decomposition into software modules● software modules

– name space, packages, libraries, subsystems– modules are scoped for small (development) teams

Driven by internal requirements

management

requirement allocation

cost evaluation

progress monitoring

reuse

technologymanagement resources

<from class>

Page 20: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 20WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Development ViewStyle● layered style

– each layer with well defined interface– subsystem dependencies on other subsystems

● in the same layer or lower

– each layer provides a development abstraction (responsibility)

Stakeholders● managers, architects, designers, developers, testers

Page 21: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 21WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Page 22: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 22WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Development ViewObservations● “complete development architecture can only be

described when all the elements of the software have been identified.” [1]

● So what things can we define here?

[1] P. B. Kruchten. The 4+1 View Model of architecture. IEEE Software, 12(6), Nov. 1995, pp. 42–50.

Page 23: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 23WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Development ViewObservations● “complete development architecture can only be

described when all the elements of the software have been identified.” [1]

● So what things can we define here?

[1] P. B. Kruchten. The 4+1 View Model of architecture. IEEE Software, 12(6), Nov. 1995, pp. 42–50.

code partitioning

inter-partitiondependencies

module visibility

development methodology

work allocation

Page 24: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 24WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Physical ViewIntent● physical manifestation of process view

– processes are mapped to processing nodes

Concerns● installation, configuration, deployment & delivery,

networking, messaging protocols

Stakeholders● system engineers, installers, architects, operators

Page 25: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 25WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Page 26: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 26WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Physical ViewDesign guidelines● mapping to be flexible● minimal impact on source code● same concerns as process view● UML deployment diagram

Page 27: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 27WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Scenario ViewIntent● “one view to rule them all”● capture system functionality in scenarios

– interaction of objects & processes– driven by important scenarios

● provides architecture validation

Stakeholders● all stakeholders from the other views

Page 28: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 28WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Example Scenario View

Componentsfrom the logical view

Connectorsfrom the process view

looks like a collaboration diagrams.what happened to use case diagram?

Page 29: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 29WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Example Scenario View

Componentsfrom the logical view

Connectorsfrom the process view

looks like a collaboration diagrams.what happened to use case diagram?

use cases & use case realization

Page 30: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 30WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

View Mappings

LogicalView

DevelopmentView

ProcessView

PhysicalView

ScenarioView

Page 31: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 31WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Logical to Process ViewObjects are mapped to processes● considerations

– autonomy– persistence– subordination– distribution

Strategy● inside-out: identify processes for objects● outside-in: identify processes (based on system requests)

and then allocate objects to these processes

Page 32: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 32WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Logical to Development ViewArchitectural component decomposition● architectural entities are broken down into design

components– packages, modules– classes

● mapping is governed by development concerns● 'distance' between logical and design view

– an indication of the size of the system

Page 33: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 33WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Process to Physical ViewProcesses assignment to hardware● major and minor tasks are assigned to physical machines● various configurations

– development– testing– deployment

Page 34: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 34WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

Model an Iterative ProcessStart with a model

In each iteration the architecture is ● prototyped● tested: under load if possible● measured & analyzed● refined

– add more scenarios– detect abstractions and optimizations

● goal:– each iteration should takes us a step closer to a stable

architecture

Page 35: Architectural Blueprint - University of Waterloo

CS446/646 ECE452 35WATERLOOCHERITON SCHOOL OFCOMPUTER SCIENCE

CommentsLacks some fundamental views● security, user interface, testing● upgrade, disaster recovery

Are the views ever complete?

Change in architectural style?● data centric to OO architecture