• No results found

Chapter 7, System Design Architecture Organization. Construction. Software

N/A
N/A
Protected

Academic year: 2021

Share "Chapter 7, System Design Architecture Organization. Construction. Software"

Copied!
42
0
0

Loading.... (view fulltext now)

Full text

(1)

Chapter 7, System Design – Architecture

p

,

y

g

Organization

O

bject-

O

riented

S

S

oftware

C

onstruction

Armin B. Cremers, Tobias Rho, Daniel Speicher & Holger Mügge

(2)

Overview

♦ Where are we right now? (last Lecture):

Š Overview of System Design

Š Subsystem Decomposition

 Architectural Styles (Client-Server, Peer-to-Peer, … ) ♦ Overview of this Lecture:

Š Architecture Organization

 Refinement of Decomposition  Refinement of Decomposition

(3)

Software Lifecycle Activities

...system design

System Object

Implemen-Testing Requirements

Analysis

System design is concerned with

the overall aspects of the

Design Design tation Testing

Elicitation Analysis

the overall aspects of the

system.

The main goals are:

The main goals are:

Low cost, good response time,

high reliability.

class Expressed in Terms of Structured by Realized by Implemented by Verified by class... class... class... Solution Application ? class....?

Sub- Domain Source

Domain Test

(4)

Activities during System Design

Activities during

1 Id tif

g

8 A ti i t

System

Design

1. Identify

Design Goals 8. Anticipate Change

2. Decompose

into Subsystems 7. Find BoundaryConditions

3. Map Hardware

to Software 6. Design Global Control Flow

4. Define Data

Persistency 5. Define AccessControl Persistency Control

(5)

Aspects for Architecture Organization

♦ 3. Mapping of Subsystem to Hardware

Š Determine the hardware configuration

♦ Selection of Off-The-Shelf Components

♦ Selection of Off The Shelf Components

Š Purchase existing components to realize subsystems more economically

♦ 4. Design of Persistent Data Management

Š Realize Storage System for objects that outlive a single execution of the system

♦ 5. Define Access Control

P t t Sh d bj t f t

Š Protect Shared objects for concurrent access

♦ 6. Define Global Control flow

Š Determine the sequence of operations within the subsystems

7 D fi B d C diti

♦ 7. Define Boundary Conditions

(6)

3. Hardware Mapping

This activity addresses two questions:

♦ What is the most appropriate hardware environment? pp p

♦ How are objects and subsystems mapped on the chosen hardware?

Š Mapping Objects onto Reality: Processor, Memory, Input/Output

Š Mapping Associations onto Reality: Connectivity

(7)

Hardware Mapping:

Mapping the Subsystems – Important Issues

♦ Processor issues:

Š Is the computation rate too demanding for a single processor?

Š Can we get a speedup by distributing tasks across several processors?

Š How many processors are required to maintain steady state load?

♦ Memory issues:

Š Is there enough memory to buffer bursts of requests?

♦ I/O issues:

Š Does the response time exceed the available communication bandwidth between subsystems ?

(8)

Hardware Mapping:

Mapping the Subsystems Associations

Describe the physical connectivity of the hardware:

Š Which associations in the object model are mapped to physical connections?

Š Which of the client-supplier relationships in the analysis/design model correspond to physical connections?

Describe the logical connectivity (subsystem associations):

Š Identify associations that do not directly map into physical connection. Distinction:

 Logical Connection within a local system

 Logical Connection within a distributed system

(9)

Hardware Mapping:

Logical vs. Physical Connectivity

Subsystem 2 Layer 1 Subsystem 1 Layer 1 Layer 2 y y Layer 2 Layer 3 Layer 3 Layer 4 Logical C ti it T t Session Application Presentation Session Application Presentation Connectivity Layers Physical DataLink Physical Network Transport DataLink Physical Network Transport Bidirectional associations for each

layer

Physical

(10)

Hardware Mapping:

Connectivity Mapping Questions

♦ What is the connectivity among physical units?

♦ What is the appropriate communication protocol between the

ring star tree

♦ What is the appropriate communication protocol between the subsystems, especially Distributed Systems?

Š Function of required bandwidth, latency and desired reliability, desired quality of service (QoS)q y (Q )

(11)

Software Mapping:

Selecting additional Software

♦ Selection of existing software subsystems (components, services, frameworks) that realize technical aspects

Š Communication subsystems

Š Data Management subsystems

♦ COTS (Commercial Off-the-Shelf) Components( ) p

Š Products that are designed to be easily installed and to interoperate with existing system components.

Š Mostly no adaptation at client-side is necessary

Š Mass-produced Æ relatively low cost.

♦ Selecting a Virtual Machine:

Š Environment including operating system and any additional software

Š Environment including operating system and any additional software components that are needed (e.g. DBMS)

Š Reduces the distance between the system and hardware

Š Reduction of development work (concentration on business code)

(12)

Drawing Hardware/Software Mappings

in UML

(Excurse)

♦ System design must model static and dynamic structures:

Š Component Diagrams for static structures

 show the structure at design time or compilation time Š Deployment Diagram for dynamic structures

(13)

Component Diagram

♦ Component Diagram (UML 2.0)

Š A graph of components connected by dependency relationships.

Š Shows the dependencies among software components

♦ Dependencies are shown as dashed arrows from the client component to the supplier component.p pp p

WebServer

(14)

Component Diagram

♦ Components can be refined to include information about the interfaces they provide (through ports) and the parts (classes, subsystems) they contain:

subsystems) they contain:

WebServer URI port port name URI HttpRequest GET POST provided interface DBQuery i d i t f FireFox required interface

(15)

Deployment Diagram

Deployment diagrams are useful for showing a system

design after the following decisions are made

g

g

Š

Subsystem decomposition

Š

Hardware Mapping

Š

Selection of additional Software Components

Š

Selection of additional Software Components

A deployment diagram is a graph of nodes connected by

A deployment diagram is a graph of nodes connected by

communication associations.

Š

Nodes are shown as 3-D boxes.

Š

N d

t i

t i

t

Š

Nodes may contain component instances.

Š

Components may contain objects (indicating that the object is

part of the component)

(16)

Deployment Diagram Example

Compile Time Dependency :Unixhost :DB2 Runtime :WebServer Runtime Dependency :PC :FireFox :CookieMgT

(17)

Software Mapping:

Problems with Connecting Subsystems

Connecting subsystems yields additional problems:

Š

Subsystems are implemented in different programming

Subsystems are implemented in different programming

languages

Š

The intention (semantics) cannot be derived exactly from the

interface (Example: difference between POST and GET?!)

interface (Example: difference between POST and GET?!)

Š

Subsystems might be built on different abstraction levels /

communication layers

Provider <<Interface>>

Æ How to achieve

(18)

Software Mapping:

Demand: Interoperability

♦ Interoperability: The ability of two or more systems or components to exchange information and to use the information that has been

h d exchanged

♦ Interoperability denote systems that work together

IEEE Glossary, 1990

Microsoft Webpage

♦ In general: Use standards!

♦ (Selected) Requirements for interoperable Systems:

St d d f C i ti f di t ib t d t

Š Standards for Communication for distributed systems

Š Semantic descriptions for interfaces

(19)

Software Mapping:

Standards for distributed systems

Standards for integrating distributed Subsystems:

Š Middleware Frameworks (CORBA, RMI, COM, SOAP)

Provider (Java) Client (C++) <<Interface>> Stub Skeletons Marshaling arguments Unmarshaling arguments

Remote Reference Layer (RMI), Object Request Broker (CORBA)

Marshaling arguments Unmarshaling arguments

Š Interface Definition Languages (IDL) are used to formulate Interfaces of Subsystems in an language neutral way

(20)

Software Mapping:

Semantic Descriptions

♦ Semantic Descriptions (Annotations) are instrumental to clarify the intention of a subsystem Provider requestData() requestSession() Questions: Æ O d ? requestNewSession() closeSession() query() Æ Order? Æ Any Iterations()? Æ(Exact) Purpose? ÆDependencies? getSemantics( )

♦ Hardly implemented in standard technologies, only in academic fields or in terms of proprietary solutions

(21)

Software Mapping:

Adapters

♦ Problem: Incompatible Interfaces and/or different data formats (syntax):

Generate getNextNumber( ) German Number

RandomNumber Printer P d E t i Produces „one“, „two“, „three“... Expects „eins“, „zwei“, „drei“...

(22)

Software Mapping:

Adapters

♦ Problem: Incompatible Interfaces and/or different data formats (syntax):

♦ Solution: Adapter (implements both interfaces and transforms data in an

♦ Solution: Adapter (implements both interfaces and transforms data in an format, understandable for the client)

Adapter Generate RandomNumber German Number Printer Adapter

private GenerateRandomNumber myRandom; public String getNextNumber( ) {

St i i t R d tN tN b ( )

String input = myRandom.getNextNumber( ); if (input == „one“) return „eins“;

if (input == „two“) return „zwei“; }

(23)

4. Data Management

Some objects in the models need to be persistent

Š

In particular Entity Objects

Š

B

d

Obj

t

ll (

f

i f

)

Š

Boundary Objects as well (e.g. user preferences in forms)

A persistent object can be realized with one of the

following

Š

Files

 Cheap, simple, permanent storage  Low level (Read Write)

 Low level (Read, Write)

 Applications must add code to provide suitable level of

abstraction

Š

Database

Š

Database

 Powerful, scalable, portable

(24)

File or Database?

When should you choose a file system?

Š

For extensive data (images)

For extensive data (images)

Š

For lots of raw data (core dump, event trace)

Š

Temporary Data that is kept only for a short time

When should you choose a database?

Š

Data that require access at fine levels of details by multiple

Š

Data that require access at fine levels of details by multiple

users and/or applications (concurrent access)

Š

Data that must be ported across multiple platforms

(heterogeneous systems)

(heterogeneous systems)

(25)

Database Management System

A collection of routines that enables you to store, modify,

and extract information from a database

Main functions (realization depends on Vendor)

Š

Concurrent (write) access to the stored data

T

ti

M

t

Š

Transaction Management

Š

Rollback Mechanisms

Š

Crash Recovery

y

Š

Optimizer for complex Queries

Š

Integrity Checks

Š

A th i

ti

Š

Authorization

(26)

Relational Databases

♦ Data are stored in tables that comply with a predefined type called a (relational) schema

Š Column represents an attribute of a schema

Š Row represents data item as a tuple of attribute values

Š Several tuples in different tables represent the attribute values of an

Š Several tuples in different tables represent the attribute values of an object

♦ Mapping rules to convert object-oriented model to a relation scheme Id l f i l d t t ith l i

♦ Ideal for querying large data sets with complex queries

♦ SQL is the standard language defining and manipulating tables

♦ Leading commercial databases:g

Š DB2 (IBM)

Š Oracle

Š M SQL

(27)

Object-Oriented Databases

♦ Support of all fundamental object modeling concepts

Š Stores data as objects and associations

Š Classes, Attributes, Methods, Associations, Inheritance

♦ Reduce the time for the initial development of storage subsystem:

Š Easy Mapping of Object model to Database schemaEasy Mapping of Object model to Database schema

♦ Disadvantage:

Š Slower than relational databases even for simple queries

♦ Commercial Vendor

♦ Commercial Vendor

Š ObjectStore

Š Realization as “add-ons” for Relational DB (DB2) Æ Sense?

♦ New Hypes

(28)

5.

Defining Access Control

♦ In multi-user systems different actors have access to different functionality and data.

Š Example:

Š Example:

 System Admin has unlimited access to any data  Client only has read access to data

♦ Definition of access right during analysis:

♦ Definition of access right during analysis:

Š Associate different use cases with different actors.

♦ During system:

Š Determining which objects are shared among actorsDetermining which objects are shared among actors.

Š Define access rights for each objects (Æ access matrix)

♦ Subtopics here:

Š AuthenticationAuthentication

(29)

Access Matrix

♦ We model access on classes with an access matrix.

Š The rows of the matrix represents the actors of the system

Š The column represent classes whose access we want to control.

Access Right: An entry in the access matrix. It lists the operations ccess g t e t y t e access at t sts t e ope at o s

(30)

Access Matrix: Example

Objects

Actors PressRelease Cashflow

Actors External Organizer read( ) Manager read( ) write( ) read( ) compute( ) read( ) submit( ) Reject( ) annoyAbout( ) Employee read( ) read( ) adjust( )

(31)

Authentication and Encryption

♦ Authentication

Š Process of verifying the association between the identity of a user (or calling subsystem) and the system

 User name / password  Smart Cards

 Biometric Sensors (analyzing patterns of blood vessels in eyes / fingers ♦ Encryption

Š Translating a message (plaintext) into an encrypted message ( i h t t)

(ciphertext).

Š A key is used to encrypt (sender) and decrypt (receiver) a message

♦ Both approaches are fundamentally difficult problems

(32)

Different Options for Access Control

Static:

Global Access Tables (as shown)

(

)

Access Control Lists (who may does what on a given

object)

Capabilities (given an actor: what can he do to what

Capabilities (given an actor: what can he do to what

objects?)

Rules

i

l t

it

d

d

Š

more simple to write and read

Dynamic

y

Rules

(33)

6. Design Global Control Flow

♦ Control Flow is the sequencing of actions in a system

Š Deciding which operations will be executed in which orderg p

Š Some order is represented explicitly in the code (e.g. order of statements)

Š Some order is given implicitly by (object-oriented) language

Š Some order is given implicitly by (object oriented) language

semantics (e.g. overloading, type of object decides which method version is executed)

♦ Control flow is modeled by control objects

♦ Control flow is modeled by control objects.

Š Record external events

Š Store temporary states about events

Š Issue the right sequence of method calls on both boundary and entity objects

(34)

Design Global Control Flow

♦ Three main control models:

Š Procedure-driven control

 explicit

 easy to understand (most often … ;-) )  hard to change

Š Event-driven control

 observer pattern (aka publisher subscriber)  callback methods in frameworks

 somewhat implicit (you have to know where to look)  somewhat implicit (you have to know where to look)  more flexible, reusable

Š Thread-based control

 parallel execution (often only pseudo parallel)  parallel execution (often only pseudo parallel)  implicit

 sometimes difficult to understand, test, maintain

(35)

Decide on Software Control

♦ Event-driven control

Š Control object runs a loop managing external events  Example (Data) Model has changed

Š Whenever an event becomes available, it is dispatched to appropriate receiver components

Š Very flexible good for the design of graphical user interfaces easy

Š Very flexible, good for the design of graphical user interfaces, easy to extend :Control :Control :View Update :Model i :View

Model has changed

Update Update

Update

:Model

(36)

Event-Driven Control Flow

Observer Pattern

Two phases

1

Configuration (who observes whom)

1.

Configuration (who observes whom)

(37)

Decide on Software Control

♦ Thread-based (or decentralized) control

Š Control resides in several independent objects:

Š Control resides in several independent objects:  Each external event is assigned a single Thread  Each new Thread handles an event

(38)

7. Boundary Conditions (1/2)

♦ Most of the system design effort is concerned with steady-state behavior.

♦ However, the system design phase must also address the initiation and finalization of the system. This is addressed by a set of new use cases called administration use cases

I iti li ti d ib h th t i b ht f

Š Initialization describes how the system is brought from an non initialized state to steady-state ("startup use cases”).

 How does the system start up?

Wh t d t d t b d t t t ti ?

 What data need to be accessed at startup time?  What services have to registered?

 What does the user interface do at start up time?  How does it present itself to the user?

(39)

7. Boundary Conditions (2/2)

Š

Termination

 Describes what resources are cleaned up and which systems are

notified upon termination ("termination use cases").p ( )

ƒ Are single subsystems allowed to terminate?

ƒ Are other subsystems notified if a single subsystem terminates?

ƒ How are local updates communicated to the database?How are local updates communicated to the database?

Š

Failure

 Many possible causes: Bugs, errors, external problems (power supply).  Good system design foresees fatal failures (“failure use cases”).

ƒ How does the system behave when a node or communication link

f il ? A th b k i ti li k ?

fails? Are there backup communication links?

ƒ How does the system recover from failure? Is this different from initialization?

(40)

8. Anticipating Change

(41)

Architecture Organization

Iterative Process

Define design

goals subsystemsDefine subsystemsimplement

Map subsystem to hardware/ software platform

Manage persistent data Define access control Define access control

policies

Select a global control flow

flow

Describe boundary conditions

(42)

Summary

♦ Hardware/Software mapping

♦ Persistent data managementg

♦ Global resource handling

♦ Software control selection

♦ Boundary conditions

♦ Boundary conditions

♦ Each of these activities revises the subsystem decomposition to address a specific issue Once these activities are completed the address a specific issue. Once these activities are completed, the interface of the subsystems can be defined.

References

Related documents

Many classes still take advantage of on farm labs and workshops (Dairy Management courses in An Sci, Dairy Production Medicine and Reproduction Palpation blocks of CVM), but

In a country like South Africa where literacy levels are low, and school libraries either non-existent or largely not functional, public and community libraries could play a

3.99 21 Building relationships with local government units and institutions considering pool facility

R180_Wei-0 in the ndr1 mutant background. RPP39 transgenic plants displayed no difference in their ability to trigger ATR39-1- dependent HR as compared to transgenics in Col-0 wild

For each pair of operator nodes that are directly connected by data flow output edges as inputs to nl and n2, respectively, and that are compatible and thus could be merged in

journalists involved in the study were observed using the telephone and seeking out. personal contact throughout their day to help them get the

A deductible is the amount you pay for covered expenses each calendar year before benefits will be paid under the Empire Plan Basic Medical Program, and for non-network

When investigating the options for mobile technology, key decision makers are increasingly considering thermal printers as the only true and reliable solution for field