1 software architecture cs 414, software engineering i mark ardis, rose-hulman institute january 14,...

42
1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

Post on 20-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

1

Software Architecture

CS 414, Software Engineering I

Mark Ardis, Rose-Hulman Institute

January 14, 2003

Page 2: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

2

Outline

Definitions of Architecture

Architectural Styles

Patterns

Page 3: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

3

Definitions of Architecture (1)

1. The art and science of designing and erecting buildings.

2. Buildings and other large structures: “the low, brick-and-adobe architecture of the Southwest.”

American Heritage® Dictionary of the English Language: Fourth Edition. 2000.

Page 4: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

4

Definitions of Architecture (2)

3. A style and method of design and construction: “Byzantine architecture.”

4. Orderly arrangement of parts; structure: “the architecture of the federal bureaucracy; the architecture of a novel.”

American Heritage® Dictionary of the English Language: Fourth Edition. 2000.

Page 5: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

5

Definitions of Architecture (3)

5. Computer Science The overall design or structure of a computer system, including the hardware and the software required to run it, especially the internal structure of the microprocessor.

American Heritage® Dictionary of the English Language: Fourth Edition. 2000.

Page 6: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

6

Software Architecture

Global control

Communication, synchronization and data access

Assignment of functionality to design elements

Composition of design elements

Scaling and performance

Page 7: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

7

Outline

Definitions of Architecture

Architectural Styles

Patterns

Page 8: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

8

Architectural Styles (1)

Dataflow Batch sequential Pipes and filters

Call-and-return Main program and subroutine OO systems Hierarchical layers

Page 9: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

9

Architectural Styles (2)

Independent components Communicating processes Event systems

Virtual machines Interpreters Rule-based systems

Page 10: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

10

Architectural Styles (3)

Data-centered Databases Hypertext systems Blackboards

Page 11: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

11

Blackboard Architecture

Knowledge sources separate and independent

Blackboard data structure problem-solving state knowledge sources update it

Control driven by state of blackboard

Page 12: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

12

Blackboard Example

Blackboard(shared data)

ks1 ks2

ks3

ks4

ks5

ks6

ks7

Page 13: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

13

Pipe and Filter Architecture

Filters

Pipes

Page 14: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

14

Examples of Pipe-and-Filter

Unix shell scripts

Compilers lexical analysis, parsing, semantic

analysis, code generation

Batch sequential degenerate case where all input processed

before any output

Page 15: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

15

Layered Architecture

Core

Utilities

Applications

Page 16: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

16

Interpreter Architecture

InterpreterEngine

Program

Data Output

Page 17: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

17

Architecture Review Boards

Review Architectural Specifications

Provide shared knowledge across projects

Prevent mistakes early

Page 18: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

18

First Cartoon of the Day

Page 19: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

19

Outline

Definitions of Architecture

Architectural Styles

Patterns

Page 20: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

20

Christopher Alexander

Architect who proposed that people design their own dwellings, using accepted patterns of designWrote a series of books that influenced the OO community

Page 21: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

21

A Place to Wait (1/3)

The process of waiting has inherent conflicts in it.

On the one hand, whatever people are waiting for---the doctor, an airplane---has built-in uncertainties, which make it inevitable that they must spend a long time hanging around, waiting, doing nothing.

Page 22: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

22

A Place to Wait (2/3)

On the other hand, they cannot usually afford to enjoy this time. Since they never know when their turn will come, they cannot even take a stroll or sit outside.

Page 23: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

23

A Place to Wait (3/3)

Therefore:In places where people end up waiting,

create a situation which makes the waiting positive. Fuse the waiting with some other activity---newspaper, coffee, pool tables; something which draws people in who are not simply waiting. And also the opposite: make a place which can draw a person waiting into a reverie; quiet; a positive silence.

Page 24: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

24

History of Software Patterns

Kent Beck had read Alexander's work while in collegeKent convinced Ward Cunningham that ideas were goodThey helped a group design a user interface by letting users design it (1987)

Page 25: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

25

Beck and Cunningham's Original Patterns

Window Per TaskFew PanesStandard PanesNouns and VerbsShort Menus

Page 26: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

26

Window Per Task

Make a specific window for each task the user must perform. All of the information needed to complete a task should be available in the Few Panes of the window. Assume prerequisite tasks have been completed (if they haven't, the user will simply change windows).

Page 27: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

27

Few Panes

To understand complex things one often must see it from several points of view. Therefore: Provide these points of view by dividing the area of your Window Per Task into panes.

Page 28: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

28

Standard Panes

One must learn to operate each kind of pane offered in the Few Panes of every window. Therefore: Cast each pane into the format offered by one of a few standard panes. [Tektronix had 4.]

Page 29: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

29

Nouns and Verbs

Things exist while action happens. Therefore: Put lists of things (nouns) in a list pane (one of Few Panes) which persists through interactions. Put actions (verbs) in Short Menus which pop up and then disappear as the action commences.

Page 30: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

30

Short Menus

The elements of a pop-up menu must be visually searched repeatedly. Therefore: Make them short, fixed and single-level.

Page 31: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

31

What is a Pattern?

"a named nugget of insight that conveys the essence of a proven solution to a recurring problem within a certain context amidst competing concerns"

"a solution to a problem in a context"

Page 32: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

32

Pattern Parts

NameProblem descriptionContext: when is it applicable?Forces: what are the tradeoffs?SolutionConsequences...

Page 33: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

33

A Good Pattern

solves a problemis a proven conceptdescribes a relationshiphas a significant human componentprovides a solution that isn't obvious

Page 34: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

34

Qualities of a Pattern

Encapsulation and abstractionOpenness and variabilityGenerativity and composabilityEquilibrium

Page 35: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

35

Leaky Bucket Counters (1/2)

Problem: How do you deal with transient faults?

Context: Fault-tolerant software that must deal with failure events.

Forces: You want a hardware module to exhibit hard

failures before taking drastic action. Some failures come from the environment,

and should not be blamed on the device.

Page 36: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

36

Leaky Bucket Counters (2/2)

Solution: A failure group has a counter that is incremented for each failure. Each counter is decremented periodically. A hard failure is not reported until the counter exceeds a threshold.

Consequences: Hard errors are handled, but transient errors are not as likely to trigger error handling.

Page 37: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

37

Second Cartoon of the Day

Page 38: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

38

Writers' Workshops

Method of publishing patternsProcess:

1. Author reads a short segment2. Others provide constructive criticism

while author remains silent3. Group thanks author (applause)

Page 39: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

39

Pattern Mining

Interview experts about their domainRecord patterns that are foundShare resulting set with experts

Page 40: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

40

Advantages of Patterns

Shorten discoveryAvoid inexpert design decisionsReuse large chunks of design

Page 41: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

41

References

Gamma, Helm, Johnson and Vlissides Design Patterns, Addison-Wesley 1995, ISBN 0-201-63361-2. (Gang of Four)

Jim Coplien, Software Patterns Management Briefing, 1996, http://www.bell-labs.com/user/cope/Patterns/WhitePaper

Appleton, Brad

Patterns and Software: Essential Concepts and Terminology, 2000

http://www.cmcrossroads.com/bradapp/docs/patterns-intro.html

Page 42: 1 Software Architecture CS 414, Software Engineering I Mark Ardis, Rose-Hulman Institute January 14, 2003

42

Books by Alexander

Notes on the Synthesis of Form, Harvard University Press, 1964

The Oregon Experiment, Oxford University Press, 1975

A Pattern Language: Towns, Buildings, Construction, Oxford University Press, 1977

The Timeless Way of Building, Oxford University Press, 1979