lecture 8 software architecture csci 3350 - software engineering ii fall 2014 bill pine

36
Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Upload: damon-evans

Post on 11-Jan-2016

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Lecture 8Software Architecture

CSCI 3350 - Software Engineering II

Fall 2014

Bill Pine

Page 2: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 2

Lecture Overview

• Examine two categories of architecture– Independent Components– Dataflow Architectures

• Most popular styles within each

Page 3: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 3

What Is Software Architecture?

• There is no universal definition – An effort by SEI at Carnegie Mellon identified

more than 150 distinct definitions• Why might that be?

Page 4: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 4

Definition

• Software Architecture - the high-level structure or structures of the software system that show the software components, their interfaces, and the relationships among them– Must satisfy all system requirements:

functional, nonfunctional and pseudo

Page 5: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 5

Major Architectural Components

• All systems consist of hardware and software• Software development consists of

– Identifying the major software – Allocating those software components to the

hardware components of the system

• This allocation or mapping can be accomplished in a variety of ways

Page 6: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 6

Basic Software Functions

• There are four basic software functions– Data storage– Data access logic– Problem Domain (application) logic– Presentation logic

Page 7: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 7

Data Storage Functionality

• Most application require data persistence from one execution session to another

• May range from– Simple unstructured text file– Structured text file– Relational database– Object-oriented database

Page 8: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 8

Data Access Logic

• Consists of the processing necessary to access the persistent data

• May range from– Simple “reads”– Complex structured “reads”– SQL queries

Page 9: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 9

Problem Domain Logic

• The logic documented in the functional requirements

• As captured by the– Use cases– Sequence diagrams– State machine diagrams– … Other UML diagrams as required

Page 10: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 10

Presentation Logic

• Human-computer interface– Accepting user input– Displaying information

Page 11: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 11

Primary Hardware Components

• There are three primary hardware components– Client computer - desktop, laptop, handheld, …– Servers – mainframe, minicomputer,

microcomputer– The network connecting client to server – cell,

…, broadband, high speed ethernet, T3, …

• Nota Bene – This does not imply that the only possible architecture is client-server

Page 12: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 12

Distribution of Software Functions

• The architecture style is determined by the ways in which the four software functions are distributed (organized) over the hardware – Sometimes called just architectures,

architectural patterns, …

• A particular style is chosen to satisfy the nonfunctional and pseudo requirements

Page 13: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 13

Aside on Motivation

• According to the old saw– “Don’t reinvent the wheel”

• Want to be able to leverage previous experience– Both our own, but more importantly– The experience of those who have gone before

Page 14: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

CSCI 3350 Lecture 8 - 14

An Analogy

• To become a Chess Master– Learn the rules

• Names of pieces, movements, board geometry– Learn the principles

• Relative value of pieces, power of threats, strategic value of the center of the board

– Study the games of the masters• These games contain patterns that must be

– Understood– Memorized– Applied repeatedly

Page 15: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

CSCI 3350 Lecture 8 - 15

An Analogy (continued)

• To become a Software Design Master– Learn the rules

• Language, algorithms, data structures– Learn the principles

• Structured programming, o-o programming, generic programming

– Study the designs of the masters• These designs contain patterns that must be

– Understood– Memorized– Applied repeatedly

Page 16: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

CSCI 3350 Lecture 8 - 16

An Analogy (continued)

• When applied at different levels of granularity for software development, gives rise to– Coding patterns – at the module level

• Relevant during implementation workflow

– Design patterns – at the subsystem level• Relevant during detailed design workflow

– Architectural patterns (styles) – at the system level• Relevant during the top-level design workflow

Page 17: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Coding Patterns

• You should have learned these during CSCI 1250, 1260, 2210, 3230, 2910, …

• Examples– Find max, min of an unsorted list– Simple list sorting methods– Simple list searching– Read data from a flat file– Walk a linked list, …

• Idiomatic (specific forms for each language)24 July 2013 CSCI - 3350 Lecture 8 - 17

Page 18: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Class Exercise

• Assign simple coding patterns to teams( Ten Minutes)

24 July 2013 CSCI - 3350 Lecture 8 - 18

Page 19: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Design Patterns

• Subject of a separate lecture

24 July 2013 CSCI - 3350 Lecture 8 - 19

Page 20: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI - 3350 Lecture 8 - 20

Architectural Styles

• We will divide architectural styles into two categories– Independent Components– Dataflow

• Begin with Independent Components– Server– Client– Client Server

Page 21: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Server-Based Style

• Server (mainframe) responsible all four basic software functions

• Clients (in the role of simple terminals)– Capture user inputs– Pass to server for processing– Accept instructions and data from the server for

display

24 July 2013 CSCI - 3350 Lecture 8 - 21

Page 22: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Server-Based Style (cont)

• Advantages– All software is developed for a single platform– All data is stored on a single platform– Single point of control

• Disadvantages– As demand grows, servers become overloaded

and response slows– Upgrades come only in large increments and

are expensive

24 July 2013 CSCI - 3350 Lecture 8 - 22

Page 23: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Client-Based Style

• Server (microcomputer) performs data storage function

• Client (microcomputer) performs presentation logic, application logic, and data access logic

24 July 2013 CSCI - 3350 Lecture 8 - 23

Page 24: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Client-Based Style (cont)

• Advantages– Cost effective for low levels of service

• Disadvantages– Network overload in high demand situations

• All data must travel to client for processing

– Likewise clients become overloaded in high demand situations• Examining all data records

24 July 2013 CSCI - 3350 Lecture 8 - 24

Page 25: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Client-Server Style

• Server (microcomputer → mainframe) performs data storage and data access logic

• Application logic shared on client and server• Client(microcomputer) performs presentation

logic – Thick client – has most of application logic– Thin client – has minimal application logic

• Sometimes referred to as two-tier style

24 July 2013 CSCI - 3350 Lecture 8 - 25

Page 26: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Client-Server Style (cont)

• Advantages– Scales well with increasing demand –

incremental upgrades– Server functions spread over several servers

means greater reliability– Easy to clearly separate the implements of the

different function – Supports many different platforms

24 July 2013 CSCI - 3350 Lecture 8 - 26

Page 27: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Client-Server Style (cont)

• Disadvantages– Structural complexity – must be able to support

multiple platforms• Cost to support multiple platforms estimated at

approximate 4 times an equivalent server style

– Maintenance / Updates more complex to support

24 July 2013 CSCI - 3350 Lecture 8 - 27

Page 28: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Multi-Tier Client-Server Style

• Three-tier– Database server (microcomputer → mainframe)

performs data storage and data access logic– Application server performs application logic– Client performs presentation logic

• N-tier– Similar to three-tier, but with multiple layers of

application servers

24 July 2013 CSCI - 3350 Lecture 8 - 28

Page 29: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Multi-tier Style (cont)

• Advantages– More scalable via load balancing

• Disadvantages– Increased network load to handle multiple paths – Complex development and testing– Maintenance / Updates more complex to

support

24 July 2013 CSCI - 3350 Lecture 8 - 29

Page 30: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

Distributed Objects Style

• The logical extension of object-oriented paradigm to client-server computing

• Three major players– OMG – Common Object Request Broker

Architecture– Sun – Enterprise Java Beans / Java 2 Enterprise

Edition– Microsoft - .NET OLE, COM and DCOM

24 July 2013 CSCI - 3350 Lecture 8 - 30

Page 31: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI 3350 Lecture 8 - 31

Indep. Components Comparison

Characteristic Server-Based Client-Based Client-Server

Infrastructure Cost Very high Medium Low

Development Cost Medium Low High

Development Ease Low High Medium

Interface Capabilities Low High High

Control & Security High Low Medium

Scalability Low Medium High

Page 32: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI 3350 Lecture 8 - 32

Dataflow Architectures

• Two primary type– Filters and Pipes– Batch sequential

Page 33: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI 3350 Lecture 8 - 33

Filters and Pipes

• Processing elements (filters) accept streams as input and produce output streams

• Processing elements are independent of one another

• Pipes used to connect the output stream of one filter to the input stream of another filter

• The heart of the Unix software development paradigm

Page 34: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI 3350 Lecture 8 - 34

Filters and Pipes (cont)

• Advantages– Modularity– An versatile means of implementing process

that are best modeled as a sequence of transformations

– Useful model for serializing data from objects

• Disadvantages– Some computations are not readily modeled

sequence of transformations

Page 35: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI 3350 Lecture 8 - 35

Batch Sequential

• Perhaps the oldest and most common style• Associated with Data Flow Analysis and

Data Flow Diagrams

Page 36: Lecture 8 Software Architecture CSCI 3350 - Software Engineering II Fall 2014 Bill Pine

24 July 2013 CSCI 3350 Lecture 8 - 36

Batch Sequential (cont)

• Advantages– For situations requiring an ordered set of

transactions be processed on a unified dataset with the ability to “unprocess” if interrupted by external events

• Disadvantages– Some computations are not readily modeled as

dataflow