Facade Design Pattern Structure - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Facade Design Pattern Structure

Description:

Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. ... System. assemble() system1. OrderApplication. Interpreter Design Pattern ... – PowerPoint PPT presentation

Number of Views:1449
Avg rating:3.0/5.0
Slides: 24
Provided by: bost99
Category:

less

Transcript and Presenter's Notes

Title: Facade Design Pattern Structure


1
Facade Design Pattern Structure
Façade exposed
1
Client
This call replaced by 1 2 (Client cant refer
to P)
2
not exposed
not exposed
P not exposed
not exposed
not exposed
not exposed
Adapted from Software Engineering An
Object-Oriented Perspective by Eric J. Braude
(Wiley 2001), with permission.
2
Architecture and Modularization of Encounter
Role-playing Game
EncounterGame
EncounterGame facade
EncounterCharacters
EncounterCast facade
EncounterEnvironment
EncounterEnvironment facade
Adapted from Software Engineering An
Object-Oriented Perspective by Eric J. Braude
(Wiley 2001), with permission.
3
Observer Design Pattern
Server part
Client part
Client of this system
1
Observer update()
1..n
Source notify()
2
for all Observers o o.update()
ConcreteObserver observerState update()
ConcreteSubject state
subject
3
if() observerState subject.getState()
Gamma et al
4
Observer Applied to International Hamburger Co.
User of this system
Server part
Client part
Observer update()
1..n
Source notify()
1
for all Observers o o.update()
2
SeniorManagement observerState update()
Headquarters demand
Marketing marketingDemand update() doDisplay()
hq
3
if( abs( hq.demand - marketingDemand ) gt 0.01 )
marketingDemand hq.getDemand() doDisplay()

Adapted from Software Engineering An
Object-Oriented Perspective by Eric J. Braude
(Wiley 2001), with permission.
5
0bserver class diagram
6
Observer interaction diagram
7
State Design Pattern Structure doRequest()
behaves according to state of Target
state.handleRequest()
Client
Target doRequest()
TargetState handleRequest()
targetState
1
target Target
TargetStateB handleRequest()
TargetStateA handleRequest()
. . . . . .
Gamma et al
8
State Design Pattern Applied to Role-Playing Game
RolePlayingGame
state
RPGame handleEvent()
GameState handleEvent()
state.handleEvent()
EncounterGame
EncounterGame
Waiting handleEvent()
Setting Qualities handleEvent()
Reporting handleEvent()
Engaging handleEvent()
SettingUp handleEvent()
Adapted from Software Engineering An
Object-Oriented Perspective by Eric J. Braude
(Wiley 2001), with permission.
9
Interpreter Design Pattern
OrderApplication
Component assemble()
system1
System assemble()
10
Interpreter Design Pattern
1..n
AbstractExpression interpret()
Client
TerminalExpression interpret()
NonTerminalExpression interpret()
Gamma et al
11
Application of Interpreter Design Pattern
n1 getNewName() n2 getnewName() System.out.p
rintln ( \nConstruct n1 as follows
system1.assemble() \nConstruct n2 as
follows system2.assemble() \nConnect
n1 and n2)
OrderApplication
Component assemble()
system1
System assemble()
return( \tComputer with cpu.assemble()
and ram.assemble())
system2
return( getDescription )
CPU assemble()
cpu
Computer assemble()
RAM assemble() getRAMType()
ram
Adapted from Software Engineering An
Object-Oriented Perspective by Eric J. Braude
(Wiley 2001), with permission.
12
Model-View-ControllerArchitectural Pattern
  • Model-view-controller pattern (simplified)
  • Problem
  • The user interface may change frequently. The
    databases may be used by several applications. We
    dont want to revise the entire application
    whenever the interface changes or modify the
    database whenever business rules change. What to
    do?
  • Solution
  • Divide applications into three areas of concern
  • Model stores data
  • View receives, retrieves and displays data
  • Controller manages events, coordinates with
    model and view

13
                              
14
Sequence Diagram for MVC
15
Delegering - klassediagram
16
Delegering sekvensdiagram
17
(No Transcript)
18
(No Transcript)
19
(No Transcript)
20
(No Transcript)
21
Heterogeneous redundancy
  • Is structurally the same as homogeneous
    redundancy but the two systems primary and
    secondary - are different.

22
(No Transcript)
23
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com