Top Banner
1 CS115 Class 7: Architecture Due today Requirements Read Architecture paper pages 1-15 Next Tuesday – Read Practical UML
21

1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

1

CS115 Class 7: Architecture

• Due today– Requirements – Read Architecture paper pages 1-15

• Next Tuesday– Read Practical UML

Page 2: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

2

Software Architecture

• After requirements (what to build), next step is design (how to build it)

• Often split into two phases– High-level design (aka Architectural design)– Low-level design (aka detailed design)

• So architecture = initial design decisions– often graphical (boxes and arrows)

Page 3: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

3

Choose Wisely

• “Marry your architecture in haste, repent at your leisure.” – Barry Boehm

• “Software is transparent and malleable in the small, but opaque and brittle in the large.”

Page 4: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

4

Software Architecture: What?

• It’s an abstraction of the system that enables you to reason about critical aspects of its behavior– “intellectually graspable”

• What to abstract away?– anything you can, unrelated to critical behavior– art in choosing level of abstraction (details to support

reasoning, simplification to be able to grasp)

• What’s left in?– components, connectors, interactions– may want multiple views

Page 5: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

5

Architecture as Modular Decomposition

• An architecture specifies how the system is decomposed into cooperating modules.

• What is a module?• Why are modules good?• Which modules are good?• Which modular decompositions are good?

Page 6: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

6

Module

• Some way to break a program into pieces and relationships– Lexically contiguous sequence of program

statements, having an aggregate identifier • (Yourden and Constantine, 1979)

– Java: package, class, method• not so much a statement block {}, expression

Page 7: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

7

Characteristics of Good Modules

• Support thinking-inside– High cohesion (single purpose)– Complete (can understand with little context) and

reusable– All methods focus on attributes associated with the

object

• Support thinking-outside (abstraction)– Low coupling (simple interface) – Information hiding (implementation/representation

details)

Page 8: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

8

Example module decomposition:What’s good and not-so-good?

Page 9: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

9

Evaluating an Architecture

• Consider a collection of change case scenarios• For each scenario, estimate changed LOC• Sum over all scenarios

– (probability of scenario changing) x (changed LOC for scenario)

• Gives indication of evolveability of architecture– good selection of scenarios is critical

• Hard to do in practice

Page 10: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

10

Architectural Models

• Architectural Models distill essence of past successes– recurring solutions to recurring problems– “Set of constraints on an architecture that

defines a set or family of architectures that satisfies them” from SWEBOK

– like design patterns, but at strategic, whole system scale

– some may seem familiar/obvious

Page 11: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

11

Call/Return Architecture

Page 12: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

12

Layered Architecture

Page 13: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

13

Layered Architecture

Page 14: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

14

Data-Flow Architecture

Page 15: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

15

Dataflow Architecture

• Each component has a set of inputs and outputs.• A component reads a stream of data on its input and

produces a stream of data on its outputs.• Input is transformed both locally and incrementally so that

output begins before input is consumed (a parallel system).• Components are called filters; independent, don’t know

other filters.– If every filter process all data at one go, is batch sequential

• Connectors serve as conduits for the information streams and are termed pipes– specializations: pipeline (single sequence thru), bounded

(amount in pipe is restricted)• Common style: Unix, compilers, signal processing, parallel

systems, distributed systems

Page 16: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

16

Dataflow Architecture

• easy understanding of the system's behavior as the composition of filters

• obvious reuse• easy to maintain and

enhance• support concurrent

execution

• often leads to batch processing - when all goes thru first filter then all thru 2nd

• poor for interactive apps• may force lowest common

denominator on data transmission, resulting in added work for each filter to parse input and format output data which can, in turn, affect performance and increase complexity of the filters

Pro Con

Page 17: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

17

Client-Server Model (Two Tier)

Page 18: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

18

Limitations of Two Tier Architecture

• Fat client– does application code (code update problem)

• Thin client– just user interface code (overloads server)

• Really have three conceptual layers– user interface– application code– data storage

Page 19: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

19

Three-Tier Model

Page 20: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

20

Crafting a Good Architecture

• Understand domain• Internalize common architectural models• Evaluate (see earlier)• Iterate

• Choose your architecture wisely.

Page 21: 1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.

21

Design Deliverable Expectations

• After Architecture comes (detailed) design• Both are together in same deliverable

– allows iteration on architecture– due May 4

• Most technically challenging deliverable– plan to review designs in class

• May 4 Blue Team , 9 - Awesome and Quadratron, 11 – PhermWare and SKARGO , 16 – ZeroVector

– one per day, 30+ minutes– interactive

• would you want to be involved in implementing this design?• can you make it better?