lecture13

29
CS 5150 1 CS 5150 Software Engineering Lecture 13 System Architecture and Design 1

Upload: abdur-rehman-muhammadi

Post on 23-Jun-2015

82 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Lecture13

CS 5150 1

CS 5150 Software Engineering

Lecture 13

System Architecture and Design 1

Page 2: Lecture13

CS 5150 2

Course Administration

First presentations October 12 to 14

Report due Friday at 11:00 p.m.

Survey due Friday at 11:00 p.m.

Test 2

Solutions not collected in class will be at reception at 301 College Avenue

Page 3: Lecture13

CS 5150 3

Copyright and Work for Hire

U. S. Code Title 17

§ 201. Ownership of copyright

(a) Initial Ownership.— Copyright in a work protected under this title vests initially in the author or authors of the work. The authors of a joint work are coowners of copyright in the work.

(b) Works Made for Hire.— In the case of a work made for hire, the employer or other person for whom the work was prepared is considered the author for purposes of this title, and, unless the parties have expressly agreed otherwise in a written instrument signed by them, owns all of the rights comprised in the copyright.

Page 4: Lecture13

CS 5150 4

System Architecture and Design

The overall design of a system:

• Computers and networks (e.g., monolithic, distributed)

• Interfaces and protocols (e.g., http, ODBC)

• Databases (e.g., relational, distributed)

• Security (e.g., smart card authentication)

• Operations (e.g., backup, archiving, audit trails)

• Software environments (e.g., languages, source control tools)

• Testing frameworks

Page 5: Lecture13

CS 5150 5

UML: System and Subsystem Modeling

Subsystem model

A grouping of elements that specifies what a part of a system should do.

Component (UML definition)

"A distributable piece of implementation of a system, including software code (source, binary, or executable) but also including business documents, etc., in a human system."

A component can be thought of as an implementation of a subsystem.

Page 6: Lecture13

CS 5150 6

UML Diagrams and Specifications

For every subsystem, there is a choice of diagrams

Choose the diagrams that best model the system and are clearest to everybody.

In UML every diagram must have supporting specification

The diagrams shows the relationships among parts of the system, but much, much more detail is needed to specify a system explicitly.

For example, to specify a Web plug-in, at the very least, the specification should include the version of the protocols to be supported at the interfaces, options (if any), and implementation restrictions.

Page 7: Lecture13

CS 5150 7

UML Notation: Component & Node

orderform.java

A component is a physical and replaceable part of a system that conforms to and provides the realization of a set of interfaces.

Server

A node is a physical element that exists at run time and represents a computational resource, e.g., a computer.

Page 8: Lecture13

CS 5150 8

Components and Replaceability

Components allow system to be assembled from binary replaceable elements

• A component is bits not concepts

• A component can be replaced by any other component(s) that conforms to the interfaces

• A component is part of a system

• A component provides the realization of a set of interfaces

Page 9: Lecture13

CS 5150 9

Components and Classes

Components may live on nodes.

Classes represent logical abstractions. They may be grouped into packages.

Classes have attributes and operations directly.

Components have operations that are reachable only through interfaces.

Page 10: Lecture13

CS 5150 10

Example: Simple Web System

Web serverWeb browser

• Static pages from server

• All interaction requires communication with server

Page 11: Lecture13

CS 5150 11

Deployment Diagram

WebBrowser

PersonalComp

WebServer

DeptServer

components

nodes

Page 12: Lecture13

CS 5150 12

Component Diagram: Interfaces

WebBrowser WebServer

HTTP

dependency

interface

realization

Page 13: Lecture13

CS 5150 13

UML Notation:Application Programming Interface (API)

API is an interface that is realized by one or more components.

WebServer

Get Post

Page 14: Lecture13

CS 5150 14

Architectural Styles

An architectural style is system architecture that recurs in many different applications.

See: Mary Shaw and David Garlan, Software architecture: perspectives on an emerging discipline. Prentice Hall, 1996

Page 15: Lecture13

CS 5150 15

Architectural Style: Pipe

Example: A three-pass compiler

ParserLexical analysis

Code generation

Output from one subsystem is the input to the next.

Page 16: Lecture13

CS 5150 16

Architectural Style: Client/Server

Web example: Serving static pages

Firefox client

Apache server

The control flows in the client and the server are independent. communication between client and server follows a protocol.

In a peer-to-peer architecture, the same component acts as both a client and a server.

Page 17: Lecture13

CS 5150 17

System Architecture Example:Extensibility in Web Browsers

Web browsers provide a flexible user interface through an extensible architecture

Protocols:HTTP, FTP, etc., proxies

Data types: helper applications, plug-ins, etc.

Executable code:Server-side code, e.g., servlets, CGIJavaScript at client, etc.

Style sheets:

CSS, etc.

Page 18: Lecture13

CS 5150 18

Web User Interface: Application Server

Web browser

• Server-side code can configure pages, access data, validate information, etc.

• All interaction requires communication with server

Data

Server

Page 19: Lecture13

CS 5150 19

Architectural Style: Three Tier Architecture

Web example: Serving dynamic pages

Each of the tiers can be replaced by other components that implement the same interfaces

Presentation tier

Application tier

Database tier

Page 20: Lecture13

CS 5150 20

UML Notation: Component Diagram

ApacheFirefox

HTTP ODBC

MySQL

These components might be located on a single node

Page 21: Lecture13

CS 5150 21

Three tier architecture: Broadcast searching

User interfaceservice

User

Databases

This is an example of a multicast protocol.

The primary difficulty is to avoid troubles at one site degrading the entire system (e.g., every transaction cannot wait for a system to time out).

Page 22: Lecture13

CS 5150 22

Web User Interface: JavaScript

Data

Server

Web browser

• JavaScripts can process information locally

• Some interactions are local

• Functions are constrained by web protocols

JavaScript

html

Page 23: Lecture13

CS 5150 23

UML Notation: Package

A package is a general-purpose mechanism for organizing elements into groups.

Note: Some authors draw packages with a different shaped box:

JavaScript

JavaScript

Page 24: Lecture13

CS 5150 24

Example: Web Browser

HTTP

JavaScript

HTMLRenderEach package represents a group of classes.

WebBrowser

Page 25: Lecture13

CS 5150 25

Web User Interface: Applet

Any server

Web serverWeb browser

• Any executable code can run on client

• Client can connect to any server

• Functions are constrained by capabilities of browser

Applets

Page 26: Lecture13

CS 5150 26

Applet Interfaces

WebBrowser WebServer

HTTP

XYZServer

XYZInterface

Page 27: Lecture13

CS 5150 27

Architectural Style: Repository

Repository

Input components

Transactions

Advantages: Flexible architecture for data-intensive systems.

Disadvantages: Difficult to modify repository since all other components are coupled to it.

Page 28: Lecture13

CS 5150 28

Architectural Style: Repository with Storage Access Layer

Data Store

Input components

Transactions

Advantages: Data Store subsystem can be changed without modifying any component except the Storage Access.

Storage Access

This is sometimes called a "glue" layer

Repository

Page 29: Lecture13

CS 5150 29

Systems Architecture for Distributed Data: Replication

Replication

Several copies of the data are held in different locations.

Mirror: Complete data set is replicated

Cache: Dynamic set of data is replicated (e.g., most recently used)

With replicated data, the biggest problems are concurrency and consistency.