The Road Map. SE203b: OO Design for Software Engineers. W8: OO Design Approach

Similar documents
CS 307: Software Engineering. Lecture 10: Software Design and Architecture

UNIT-4 Behavioral Diagrams

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 9: Architecting and Designing Software

Software Engineering (CSC 4350/6350) Rao Casturi

Appendix A - Glossary(of OO software term s)

Design Process Overview. At Each Level of Abstraction. Design Phases. Design Phases James M. Bieman

Software Architecture Patterns

Oral Questions. Unit-1 Concepts. Oral Question/Assignment/Gate Question with Answer

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 8: Modelling Interactions and Behaviour

6 Identify Design Elements

CAS 703 Software Design

Interactions A link message

XVIII. Software Architectures

Presenter: Dong hyun Park

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

Object-Oriented Systems Analysis and Design Using UML

XIX. Software Architectures

8.1 Interaction Diagrams. Object-Oriented Software Engineering Practical Software Development using UML and Java. Interactions and messages

Design Patterns. Observations. Electrical Engineering Patterns. Mechanical Engineering Patterns

Basic Properties of Styles

State Machine Diagrams

10조 이호진 이지 호

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

Architectural Styles I

Component-Level Design. Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman. For non-profit educational use only

Architecture and the UML

09. Component-Level Design

Enterprise Architect. User Guide Series. UML Models. Author: Sparx Systems. Date: 30/06/2017. Version: 1.0 CREATED WITH

CS 307: Software Engineering. Lecture 9: Software Design (Coupling), Modeling Interactions and Behavior

SOFTWARE MODELING AND DESIGN. UML, Use Cases, Patterns, and. Software Architectures. Ki Cambridge UNIVERSITY PRESS. Hassan Gomaa

Behavioral Modeling. Gregor v. Bochmann, University of Ottawa

Activity Diagram Written Date : September 02, 2016

New Features Summary PowerDesigner 15.2

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 1. Introduction

Software Engineering. Page 1. Objectives. Object-Behavioural Modelling. Analysis = Process + Models. Case Study: Event Identification

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Architectural Styles II

Software Components and Distributed Systems

Objectives. Explain the purpose and objectives of objectoriented. Develop design class diagrams

Architectural Blueprint

An Introduction to Software Architecture. David Garlan & Mary Shaw 94

Enterprise Web based Software Architecture & Design

Software Architecture

Software Paradigms (Lesson 10) Selected Topics in Software Architecture

UP Requirements. Software Design - Dr Eitan Hadar (c) Activities of greater emphasis in this book. UP Workflows. Business Modeling.

Enterprise Software Architecture & Design

Distributed Objects. Object-Oriented Application Development

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

Enterprise Architect Training Courses

02 - Distributed Systems

Introduction to UML. Danang Wahyu utomo

Design concepts for data-intensive applications

Distribution and Integration Technologies

Oracle Fusion Middleware 11g: Build Applications with ADF Accel

UML 2.0 State Machines

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

OBJECT ORIENTED DESIGN with the Unified Process. Use Case Realization

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

Software Architecture

Unit Wise Questions. Unit-1 Concepts

Architectural Styles - Finale

Business Process Modeling. Version 25/10/2012

UNIT V *********************************************************************************************

Business Process Modeling. Version /10/2017

OO Using UML: Dynamic Models

Software. Networked multimedia. Buffering of media streams. Causes of multimedia. Browser based architecture. Programming

Introduction to UML p. 1 Introduction to the Object-Oriented Paradigm p. 1 What Is Visual Modeling? p. 6 Systems of Graphical Notation p.

02 - Distributed Systems

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

In this Lecture you will Learn: System Design. System Architecture. System Architecture

Module 3 Web Component

Distributed Multitiered Application

XVIII. Software Architectures

CAS 703 Software Design

Distributed Object-Based Systems The WWW Architecture Web Services Handout 11 Part(a) EECS 591 Farnam Jahanian University of Michigan.

Notes. Submit homework on Blackboard The first homework deadline is the end of Sunday, Feb 11 th. Final slides have 'Spring 2018' in chapter title

CHAPTER 5 CO:-Sketch component diagram using basic notations 5.1 Component Diagram (4M) Sample Component Diagram 5.2 Deployment Diagram (8M)

Announcements. me your survey: See the Announcements page. Today. Reading. Take a break around 10:15am. Ack: Some figures are from Coulouris

Evolution of Service Oriented Architectures

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Application Servers in E-Commerce Applications

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR (ODD SEMESTER) QUESTION BANK

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

Meltem Özturan

ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE

Architectural Styles I

FREQUENTLY ASKED QUESTIONS

Object-Oriented Software Engineering Conquering Complex and Changing Systems. Chapter 6, System Design Lecture 1

Darshan Institute of Engineering & Technology for Diploma Studies

1.264 Lecture 16. Legacy Middleware

POAD Book: Chapter 4: Design Patterns as Components Chapter 5: Visual Design Models

Software Architecture

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

Distributed Middleware. Distributed Objects

Software MEIC. (Lesson 4)

Chapter 13: Architecture Patterns

Transcription:

SE203b: OO Design for Software Engineers W8: OO Design Approach Statechart,, Activity, Components & Node Diagrams Architectural frameworks Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa The Road Map Introduction to Software Design Software Design Approaches Introduction to OO Paradigm Software Design with OO Paradigm Patterns in Design and Architecture Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 2

OO Software Requirements & Design Process Requirement capture using Use Cases Use Case Diagrams Use Case Description Analysis & Design Class Diagrams Data Dictionary Interaction Diagrams Statechart Diagrams Activity Diagrams Implementation Deployment Architecture-centric Patterns Frameworks Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 3 Workflows and s Requirements Requirements Use Case Analysis Analysis Design Design Implementation Implementation Design Deployment Implementation Test Test Test Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 4

Use Case Diagram Captures system functionality as seen by users Built in early stages of development Purpose Specify the context of a system Capture the requirements of a system Validate a system s architecture Drive implementation and generate test cases Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 5 Class Diagram Captures the vocabulary of a system Built and refined throughout development Purpose Name and model concepts in the system Specify collaborations Specify logical database schemas Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 6

Sequence Diagram Captures dynamic behavior (time-oriented) Purpose flow of control Illustrate typical scenarios Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 7 Some Reusable OO Design Patterns Façade Adapter Composite Proxy Observer Abstract Factory Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 8

Analysis & Design Use Case Use Case Diagram Class Diagrams Object Object Diagrams Diagrams Analysis & Design Depl. Impl. Test Component Component Diagrams Diagrams Deployment Deployment Diagrams Diagrams Sequence Diagrams Collaboration Diagrams Statechart Statechart Diagrams Diagrams Activity Activity Diagrams Diagrams Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 9 Statechart Diagram Captures entity behavior (event-oriented) Purpose o o object lifecycle reactive objects (user interfaces, devices, etc.) Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 10

States & Events At any given point in time, the system is in one state It will remain in this state until an event occurs o that causes it to change state Events invoke changes in state Final state due to a given event depends upon the initial state An event separates two states off Lamp On A transition represents a change of state in response to an event Lamp Off It is considered to occur instantaneously The label on each transition is the event that causes the change of state Special states: A black circle represents the start state A circle with a ring around it represents an end state on Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 11 Actions & Activities Events trigger operations in the state diagram Two types of operations o An action is an instantaneous operation and not interruptible i.e., its internal structure is not important to model o An activity is an operation that takes time to complete it can be interrupted on Lamp On Off / display_off On / display_on off Lamp Off Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 12

Basic UML Statechart Diagram Initial state State Event Ready Transition stop /ctr := 0 Final state Done stop Action Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 13 Object lifecycle - General Handling depends on specific request type Create/Initialize Create/Initialize Object Object Wait Wait for for Request Request void:offhook (); {busy = true; obj.reqdialtone(); }; Handle Handle Request Request Terminate Terminate Object Object Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 14

Object lifecycle and State Machines Direct mapping: Create/Initialize Object Lamp On on Wait for Event Handle Event off Lamp Off on/print( on ) off Terminate Object stop Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 15 Actions on Entry to States Entry and exit actions Entry Actions: Performed whenever the state is entered o Notation: entry/ action name o Useful when all transitions entering a state share a common action Exit Actions: Performed whenever the state is exited. o Notation: exit/ action name o Useful when all transitions leaving a state share a common action. LampOn entry/lamp.on(); exit/lamp.off(); e1 e2 Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 16

Order of Actions: Simple Case Exit actions prefix transition actions Entry action postfix transition actions LampOn entry/lamp.on(); exit/printf( exiting printf( exiting ); off/printf( to off ); LampOff entry/lamp.off(); exit/printf( exiting printf( exiting ); Resulting action sequence: printf( exiting ); printf( to off ); lamp.off(); off/printf( needless printf( needless ); printf( exiting ); printf( needless ); ); lamp.off(); Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 17 State ( Do ) Activities An activity is associated with a state The notation: do/ activity name It forks a concurrent thread that executes until: the activity completes or the state is exited o through an outgoing transition the activity can be a continuous operation e.g., do: display main screen Error entry/printf( error printf( error! ) do/while (true) alarm.ring(); Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 18

Conditions State1 Do /activity 1 Event1 [condition] /action State2 A state is often associated with the value of an object satisfying some conditions A conditions is a Boolean function of object value o e.g., the amount within predefined limits A guarded transition o a transition labeled by an event with a condition A guarded transition fires when its event occurs and the condition is true It showed as a Boolean expression in brackets following the event name e.g., insert card [readable] Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 19 Guards Conditional execution of transitions guards must be side-effect free Selling bid [value >= 200] /sell Happy bid [value < 100] /reject bid [(value >= 100) & (value < 200)] /sell Unhappy Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 20

State Generalization In a nested state diagram, a state in a higher-level is a form of generalization of the states in its lower level state diagram If it is in state X, it is in exactly one of the state x_1; ; x_n Y x_1 X x_n Z Transmission Neutral N F R N Stop U Forward First Second U D D Forward Reverse Third Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 21 Concurrency Aggregation concurrency A state diagram for an aggregate is a collection of state diagrams, one for each element The elements are inherently concurrent Objects can change state independently or interact Synchronization constraints are implemented by conditions in guarded transitions Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 22

Car Components: Example Car Ignition Accelerator Brake Transmission Transmission R Accelerator Neutral Reverse depress accel N Off On N F release accel Forward Ignition Off turn key to start [transmission in neutral] Starting release key On turn key off Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 23 Statecharts: : Recap Used to model event-driven (reactive) behavior well-suited to the server model inherent in the object paradigm Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 24

Activity Diagram Captures dynamic behavior (activity-oriented) Purpose o o workflows operations Transitions are caused by internal events The objective o To help understanding the flow of work (operations) that an object or component performs often associated with several classes especially concurrent activities Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 25 Kinds of Action States Action (State) Action Submachine (State) Submachine Just like their state machine counterparts (simple state and submachine state) except that transitions are caused by internal events and are taken when the step is finished, Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 26

Example POEmployee sortmail() delivermail() POEmployee.sortMail POEmployee. delivermail delivermail Check Out Truck Put Mail In Boxes Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 27 Activity Graph as Method All activity graphs are methods for operations Application is completely OO when all action states invoke operations POEmployee.sortMail POEmployee. delivermail POEmployee delivermail sortmail() delivermail() «realize» Check Out Truck Put Mail In Boxes Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 28

Coordinating Steps Initial state Final state Branch/merge Fork join Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 29 Coordinating Steps(Cont.) For modeling conventional flow chart decisions. Calculate Cost [cost < $50] [cost >= $50] Charge Account Get Authorization Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 30

Representing Concurrency Concurrency is shown using forks, joins and rendezvous. o o o A fork has one incoming transition and multiple outgoing transitions. The execution splits into multiple concurrent threads A join has multiple incoming transitions and one outgoing transition. The outgoing transition will be taken when all incoming transitions have occurred The incoming transitions must be triggered in separate threads If one incoming transition occurs a wait condition occurs at the join until the other transitions occur A rendezvous has multiple incoming and multiple outgoing transitions. Once all the incoming transitions occur all the outgoing transitions may occur Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 31 Example Build Frame Put On Roof Install Walls Install Foundation Inspect Install Electricity in Foundation Install Electricity In Frame Install Electricity Outside Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 32

Swimlanes The activity of an object might involve invocation of other ojects. The partition of activities among the existing objects can be explicitly shown using swimlanes Partitions are a grouping mechanism o Swimlanes are the notation for partitions They do not provide domain-specific semantics Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 33 Activity Diagrams an example with swimlanes Student CourseSection Receive course registration request [not ok] Check prerequisites Check special permission [not ok] [ok] [ok] Verify course not full [ok] [not ok] Complete registration Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 34

Coordinating Steps Synch state is inherited from state machines but used mostly in activity graphs Provides communication capability between parallel processes State machine notation Build Frame Put On Roof Install Walls Install Foundation Inspect Install Electricity in Foundation Install Electricity In Frame Install Electricity Outside Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 35 Convenience Features (Synch State) Forks and joins do not require composite states Synch states may be omitted for the common case (unlimited bound and one incoming and outgoing transition). Activity diagram notation Build Frame Put On Roof Install Walls Install Foundation Inspect Install Electricity in Foundation Install Electricity In Frame Install Electricity Outside Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 36

When to Use Activity Diagrams Use activity diagrams when the behavior you are modeling... does not depend much on external events mostly has steps that run to completion o rather than being interrupted by events requires object/data flow between steps is being constructed at a stage when you are more concerned with o which activities happen, rather than which objects are responsible for them (except partitions possibly) Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 37 Activity Diagrams: Recap Use Activity Diagrams for applications that are primarily control and data-driven, like business modeling rather than event-driven applications like embedded systems Purpose o workflows o operations Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 38

OO Software Requirements & Design Process Requirement capture using Use Cases Use Case Diagrams Use Case Description Analysis & Design Class Diagrams Data Dictionary Interaction Diagrams Statechart Diagrams Activity Diagrams Implementation Deployment Architecture-centric Patterns Frameworks Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 39 Workflows and s Requirements Requirements Use Case Analysis Analysis & Design Design Implementation Implementation Design Deployment Implementation Test Test Test Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 40

Use Case Use Case Diagram Class Class Diagrams Diagrams Deployment Deployment Diagrams Diagrams Object Object Diagrams Diagrams Design Analysis Depl. Impl. Test Component Component Diagrams Diagrams Sequence Sequence Diagrams Diagrams Collaboration Collaboration Diagrams Diagrams Statechart Statechart Diagrams Diagrams Activity Activity Diagrams Diagrams Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 41 Component Diagram Captures the physical structure of the implementation Components may be implemented by artifacts oo e.g., binary, executable, or or script files (such as html) component Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 42

Components and Classes Component is the physical implementation of a set of classes Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 43 Components and Interfaces The component realizes the interface is connected to the interface using a full realization relationship A component accesses the services of the other component through its interface Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 44

Component Diagram Example ShoppingSessionHome ShoppingSession <<EJBSession>> ShoppingSession CatalogHome <<EJBEntity>> Catalog CatalogHome CatalogPK CatalogPK Catalog Catalog CatalogInfo CatalogInfo Catalog ShoppingCartHome <<EJBEntity>> ShoppingCart ShoppingCart Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 45 Deployment Diagram Captures the topology of a system s hardware Shows the configuration of run-time processing elements and the software components, o processes and objects that live on them Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 46

Nodes and Components A component may be deployed by a node or more classes might be implemented by a component or more Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 47 Deployment Diagram Example(Cont.) Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 48

Deployment Diagram Example(Cont.) :Client <<browser>> :OpenSourceBrowser videostoreserver:appserver <<Session>> ShoppingSession ShoppingSession <<Entity>> Catalog Catalog <<Entity>> ShoppingCart ShoppingCart :DBServer <<database>> :VideoStoreDB Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 49 OO Software Requirements & Design Process Requirement capture using Use Cases Use Case Diagrams Use Case Description Analysis & Design Class Diagrams Data Dictionary Interaction Diagrams Statechart Diagrams Activity Diagrams Implementation Deployment Architecture-centric Patterns Frameworks Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 50

Architectural Patterns: : Frameworks The notion of patterns can be applied to software architecture These are called o architectural patterns, or o frameworks, or o architectural styles Each allows you to design flexible systems using components o The components are as independent of each other as possible Architectural patterns Layered View Controller (MVC) Distributed o Client Server o Broker Pipes and filters Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 51 Multi-Layer Style In a layered system, each layer communicates only with the layer immediately below it Each layer has a well-defined interface used by the layer immediately above o The higher layer sees the lower layer as a set of services A complex system can be built by superposing layers at increasing levels of abstraction It is important to have a separate layer for the UI Layers immediately below the UI layer o provide the application functions determined by the use-cases Bottom layers provide general services o e.g. network communication, database access Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 52

Multi-layer layer Style Example User Interface User Interface Application Logic OS Access Application Logic DB Access NW Comm. OS Access DB Access Network Communication Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 53 Example: 2-tier 2 & 3-tier 3 Architecture Graphical User Interface Application Graphical User Interface Business Object Graphical User Interface Business Object Relational Database/ External Relational Database/ External Design Patterns Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 54

Multi-layer layer Example Application Programs Screen Display Facilities User Account Mngt Application Programs Screen Display Facilities User Account Mngt. File System Kernel File System Kernel Typical layers in an operating system Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 55 Deployment Diagram Example(Cont.) :Client Presentation <<browser>> :OpenSourceBrowser videostoreserver:appserver Application Logic <<Session>> ShoppingSession ShoppingSession <<Entity>> Catalog Catalog <<Entity>> ShoppingCart ShoppingCart :DBServer Database <<database>> :VideoStoreDB Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 56

Complex Internet system Client Dynamic HTML, JavaScript, Java plug-ins, source code enhancements Server Java, C, C++, JavaScript, CGI Application Server Java, C, C++, JavaBeans, CORBA, DCOM Fulfillment System Financial System Inventory System RDBMS Server Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 57 The Multi-Layer Design Principles Divide and conquer: The layers can be independently designed Increase cohesion: Well-designed layers have layer cohesion Reduce coupling: Well-designed lower layers do not know about the higher layers the only connection between layers is through the interfaces (API) Increase abstraction: you do not need to know the details of how the lower layers are implemented Increase reusability: The lower layers can often be designed generically. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 58

The Multi-layer layer Design Principles Increase reuse: o You can often reuse layers built by others that provide the services you need. Increase flexibility: o you can add new facilities built on lower-level services, or replace higher-level layers. Design for portability: o All the dependent facilities can be isolated in one of the lower layers. Design for testability: o Layers can be tested independently. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 59 -View View-Controller (MVC( MVC) ) Style to separate the user interface layer from other parts of the system The main elements The model o contains the underlying classes whose instances are to be viewed and manipulated The view o contains objects used to render the appearance of the data from the model in the user interface The controller o contains the objects that control and handle the user s interaction with the view and the model The Observable design pattern is normally used to separate the model from the view Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 60

The MVC Architecture UI Example Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 61 MVC: : Example Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 62

MVC: : Example Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 63 The MVC Architecture Example viewed by actor View create and update receives actor events notify about changes Controller modify Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 64

The MVC Design Principles Divide and conquer: o The three components can be somewhat independently designed Increase cohesion: o The components have stronger layer cohesion by separating view and controller Reduce coupling: o The communication channels between the three components are minimal Increase reuse: o The view and controller normally make extensive use of reusable components for various kinds of UI controls Design for flexibility: o It is usually quite easy to change the UI by changing the view, the controller, or both Design for testability: You can test the application separately from the UI Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 65 Distributed Architecture Clients LAN WAN Servers Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 66

Client-Server & Multi-tier tier Styles There is at least one component that has the role of server o waiting for and then handling connections that has the role of client o initiating connections in order to obtain some service. A further extension is the Peer-to-Peer pattern A system composed of various software components that are distributed over several hosts. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 67 Client-Server Client1: System1: <<communication>> exchange messages System3: <<communication>> exchange messages <<communication>> exchange messages <<communication>> Request service 1 <<communication>> look up addresses Server: Peer-to-peer Client2: System2: Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 68

Physical Application Architecture Thinner client, thicker server Client A Application Client B Application Client C WWW Browser Business Object Services DCOM CORBA Beans Business Object Engine Business COM Object Server MTS Beans ETS Business Object Services Web Server HTML CGI ASP Business Object Services Java Business Object Engine Business Object Engine Relational Database Server(s) Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 69 The distributed architecture Design Principles Divide and conquer: o Dividing the system into client and server processes where Each can be separately developed. Increase cohesion: o The server can provide a cohesive service to clients. Reduce coupling: o There is usually only one communication channel exchanging simple messages. Increase abstraction: o Separate distributed components are often good abstractions. Increase reuse: o It is often possible to find suitable frameworks on which to build good distributed systems However, client-server systems are often very application specific Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 70

The distributed architecture Design Principles Design for flexibility: o can be easily reconfigured by adding extra servers or clients Design for portability: o You can write clients for new platforms without having to port the server. Design for testability: o You can test clients and servers independently. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 71 The Broker Style Transparently distribute aspects of the software system to different nodes o An object can call methods of another object without knowing that this object is remotely located o CORBA and Web-services are a well-known open standards that support borkering. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 72

Example of a Broker system Client Proxy object request Distributed Infrastructure Broker Server Remote Obj Subscribe Interface Repository (Registration) Publish Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 73 The Broker Architecture Design Principles Divide and conquer: o The remote objects can be independently designed. Increase reusability: o It is often possible to design the remote objects so that other systems can use them too. Increase reuse: o You may be able to reuse remote objects that others have created. Design for flexibility: o The brokers can be updated as required, or the proxy can communicate with a different remote object. Design for portability: o You can develop clients for new platforms while still accessing brokers and remote objects on other platforms. Design defensively: o You can provide careful assertion checking in the remote objects. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 74

The Pipe-and and-filter Framework A stream of data, in a relatively simple format, is passed through a series of processes Each of which transforms it in some way. Data is constantly fed into the pipeline. The processes work concurrently. The architecture is very flexible. o o o o Almost all the components could be removed. Components could be replaced. New components could be inserted. Certain components could be reordered. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 75 Example of a pipe-and and-filter system encoders for microphone input microphones near sound source cancel echo cancel noise remove non-voice frequencies equalize dynamic range compress transmit distant microphone encoder for ambient noise encode speaker output TCP/IP Transmission decompress receive Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 76

The Pipe-Filter Architecture Design Principles Divide and conquer: o The separate processes can be independently designed. Increase cohesion: o The processes have functional cohesion. Reduce coupling: o The processes have only one input and one output. Increase abstraction: o The pipeline components are often good abstractions, hiding their internal details. Increase reusability: o The processes can often be used in many different contexts. Increase reuse: o It is often possible to find reusable components to insert into a pipeline. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 77 The Pipe-Filter Architecture Design Principles Design for flexibility: o There are several ways in which the system is flexible. Design for testability: o It is normally easy to test the individual processes. Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 78

OO Software Requirements & Design Process Requirement capture using Use Cases Use Case Diagrams Use Case Description Analysis & Design Class Diagrams Data Dictionary Interaction Diagrams Statechart Diagrams Activity Diagrams Implementation Deployment Architecture-centric Patterns Frameworks Mar 29, 2006 SE203b, ECE UWO, Hamada Ghenniwa 79