Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
OutlineSFWR ENG 3A04: Software Design II
Dr. Ridha Khedri
Department of Computing and Software, McMaster UniversityCanada L8S 4L7, Hamilton, Ontario
Term 1
Acknowledgments: Material based on Software Architecture Design by Tao et al. (Chapter 9)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Outline
Part I: Review ofPrevious Lecture
Part II: Today’sLecture
Outline of Part I
1 Main/Subroutine Software Architecture
2 Master/Slaves Software Architecture
3 Layered Architecture
4 Virtual Machine
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Outline
Part I: Review ofPrevious Lecture
Part II: Today’sLecture
Outline of Part II
5 Overview
6 Model-View-ControllerMVC-IMVC-ll
7 Presentation-Abstraction-Control (PAC) Architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Main/SubroutineSoftwareArchitecture
Master/SlavesSoftwareArchitecture
LayeredArchitecture
Virtual Machine
Part I
Review of Previous Lecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Part II
Today’s Lecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureOverview
More and more software applications that involve userinput and output interactions
We focus on the software architecture that bestsupports user interaction
Interaction oriented software architecture decomposesthe system into three major partitions
Data module (provides the data abstraction& corebusiness logic)Flow control module (determines the flow controls,view selections, communications between modules, jobdispatching, and certain data initializations andconfigurations)View presentation module (responsible for visual oraudio data output presentation)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureOverview
This architecture allows the separation of userinteractions from data abstraction and business dataprocessing
Allows multiple views for a same data set
Even for a specific view presentation, the interfaces mayneed to change very often (the loose coupling betweendata abstractions and its presentations is very helpful)
A control module plays a central role that mediates thedata module and view presentation modules
All three modules may be completely connected
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureOverview
There are two categories of interaction orientedarchitecture:
Presentation-Abstraction-Control (PAC)
Model-View-Controller (MVC).
They are different in their flow controls and structureorganization
The MVC does not have a clear hierarchical structureand all three modules are connected together
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureOverview
The PAC is an agent based hierarchical architecture
The system is decomposed into many cooperatingagentsEach agent has three components (Presentation,Abstraction, and Control)The Control component in each agent is in charge ofcommunications with other agentsThe top-level agent provides core data and businesslogicsThe bottom level agents provide detailed specific dataand presentationsA middle level agent may play a role of coordinator oflow-level agentsThere are no direct connections between Abstractioncomponent and Presentation component in each agent
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller
Most of Web developers are familiar with MVCarchitecture
Widely adopted for Web server site interactiveapplication design such as online shopping, onlinesurvey, online student registration, etc.
MVC architecture is specifically used in applicationswhere user interfaces are prone to data changes all thetime
MVC architecture typically supports ”look and feel”features in GUI application
The Java Swing components and Java Swing layoutmanagers are designed in MVC architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller
Summary:The Controller
manages the user input requestscontrols the sequence of user interactionsselects desired views for output displaysmanages all initialization, instantiations, andregistrations of other modules in the MVC system
The Model moduleprovides all core functional services and encapsulates alldata detailsdoes NOT depend on other modules, and it does notknow which views are registered with or attached to it
The View moduleis responsible for displaying the data provided by theModel module and updating the interfaces wheneverthe data changes
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller (MVC-I)
The MVC-I is a simple version of MVC architecture
The system is simply decomposed into twosub-systems:
Controller/View
It handles input and output processing and theirinterfaces
It registers with (attaches to) data module
ModelIt copes with all core functionality and data
It notifies the Controller-View module of any datachanges in the Model module
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller (MVC-I)
The connection between the Controller/View and theModel can be designed in a pattern of subscribe/notify
The Controller/View subscribes the Model and theModel notifies the Controller/View of any changes
The Controller/View is an observer to the data in theModel of MVC
Read the example given in Chaptre 9, Section 9.2.1 tosee how MVC-I architecture concretely works
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller (MVC-I)
Figure: MVC-I architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller (MVC-II)
MVC-II architecture
The Model module provides all core functionality anddata supported by database (Same as MVC-I)
The View module displays the data from the Modelmodule
The Controller module
It takes input requests, validates input data, initiatesthe Model and the View and their connection
It dispatches tasks
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller (MVC-II)
The Controller and the View register with the Modelmodule
Whenever the data in the Model module is changed theView module and the Controller module are notified
Comparison to MVCI
In both MVC-I and MVC-II, Model module plays anactive role
In MVC-Il architecture, the View module and theController module are completely separated
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller (MVC-I)
Figure: MVC-II architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller
Figure: A detailed MVC-II architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller
Figure: Sequence diagram for MVC architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller
Figure: MVC architecture on Java Web platform
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller
Applicable domain of MVC architectureSuitable for interactive applications (multiple views areneeded + volatile graphics interfaces)
There are clear divisions between controller, view, anddata modules (different professionals can be assignedto work on different aspects of the system)
BenefitsMany MVC vendor frameworks available
Multiple views synchronized with same data model
Easy to plug in new or change interface views, updateinterface views with new technologies
Very effective for developments (team = graphics,programming, and data base professionals)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
MVC-I
MVC-ll
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitectureModel-View-Controller
Limitations
Does not fit agent-oriented application such asinteractive mobile, robotics applications
Multiple pairs of controllers and views based on thesame data model make any data model changeexpensive
The division between the View and the Controller isnot very clear in some cases
Related architecture
Implicit invocation architecture such as event-based,Multi-tierarchitecture, andPresentation-Abstraction-Control (PAC)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitecturePresentation-Abstraction-Control (PAC)Architecture
The PAC architecture is quite similar to MVC
The PAC was developed from MVC to support theapplication requirement of multiple agents in additionto the interactive application requirement
The PAC three components concepts are applied to allconcrete sub-system architecture
It is very suitable for any distributed system where eachremote agent has its own functionalities with data andinteractive interface
Another feature: all agents need to communicate withother agents in a well structured way
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitecturePresentation-Abstraction-Control (PAC)Architecture
Figure: A single agent in PAC
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitecturePresentation-Abstraction-Control (PAC)Architecture
Applicable domain of PAC architectureInteractive system where the system can be dividedinto many cooperating agents in a hierarchicalstructure (Each agent has its specific job)
The coupling among the agents is expected very loose(change of one agent will not affect the others)
BenefitsSupporting multi-tasking, multi-viewing
Supporting agent reusability and extensibility
Easy to plug in new agent or replace an existing agent
Supporting concurrency (agents are in different threadsor different devices or computers)
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Interaction Oriented Software ArchitecturePresentation-Abstraction-Control (PAC)Architecture
LimitationsOverhead due to
the control bridge between presentation andabstractionthe communications of controls of many agents
Difficult to determine the right numbers of the agentsbased on the loose couplings between agents and highindependence of each other
Development complexity: due to complete separation ofpresentation and abstraction (communications betweenagents only take place between the controls of agents)
Increased complexity of the system design andimplementation
Related ArchitectureLayered architecture, multi-tier architecture, MVCarchitecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II
SFWR ENG 3A04:Software Design II
Dr. R. Khedri
Overview
Model-View-Controller
Presentation-Abstraction-Control (PAC)Architecture
Dr. R. Khedri SFWR ENG 3A04: Software Design II