advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv...
Transcript of advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv...
![Page 1: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/1.jpg)
POAD Book:
Chapter 7POAD: The Process
Instructor: Dr. Hany H. AmmarDept. of Computer Science and Electrical Engineering, WVU
![Page 2: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/2.jpg)
Goals
Pattern Integration: Present two different ways for gluing patterns
To introduce the process aspects of POAD to outline the POAD approach and to
illustrate how patterns can be utilized as design building blocks
We will later see how POAD evolve from their integration
![Page 3: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/3.jpg)
outline
• Pattern Integration: Stringing vs Overlapping
• POAD Process Outline (Nutshell)• Analysis• Design• Design Refinement
![Page 4: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/4.jpg)
Pattern Integration: Stringing vs Overlapping Both techniques (stringing patterns, and
overlapping them together) were originally used for Civil engineering purposes, but they do apply to building software systems.
Stringing -patterns are glued together – glue could be UML relationships – design is a loose assembly of patterns – You end up with too many classes with trivial
responsibilities
![Page 5: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/5.jpg)
Pattern Integration: Stringing vs Overlapping Overlapping
– A class as a participant in one pattern could be at the same time a participant of another pattern in the same application design
– One class can play two different roles, in two different patterns
The Advantage of overlapping is that you have fewer classes
The disadvantage is that pattern boundary is lost and patterns are hard to trace
![Page 6: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/6.jpg)
Example Consider the Reactor and Composite Patterns
Reactor
Dispatch()
EventHandler
HandleEvent()CloseHandle()GetHandle()
nn
ConcreteEventHandler1 ConcreteventHandler2
![Page 7: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/7.jpg)
Example
Leaf
Operation()
Composite
Operation()AddComponent(Component)RemoveComponent(Component)
Component
Operation()AddComponent(Component)RemoveComponent(Component)
nn
![Page 8: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/8.jpg)
Example
Now, you have two patterns to glue, the Reactor and the Composite patterns
Stringing the 2 patterns together gives us the following
![Page 9: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/9.jpg)
Example: Stringing
Leaf
Operation()
Composite
Operation()AddComponent(Component)RemoveComponent(Compon
Component
Operation()AddComponent(Component)RemoveComponent(Component)
nn
Reactor
Dispatch()
EventHandler
HandleEvent()CloseHandle()GetHandle()
nn
ConcreteEventHandler1 ConcreteventHandler2
![Page 10: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/10.jpg)
Example: Overlapping
Reactor
Dispatch()
EventHandlerComponent
HandleEvent()CloseHandle()GetHandle()AddComponent(EventHandlerComponent)RemoveComponent(EventHandlerComponent)
nn
LeafEventHandler
HandleEvent()CloseHandle()GetHandle()
CompositeEventHandler
HandleEvent()CloseHandle()GetHandle()AddComponent(EventHandlerComponent)RemoveComponent(EventHandlerComponent)
nn
![Page 11: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/11.jpg)
What does POAD uses
Although Stringing is the easier of the 2 approaches, it is often avoided– It provides good traceability
POAD uses both – It uses the simplicity and traceability of the
stringing-patterns approach – the density and profoundness of the
overlapping-patterns approach POAD integrates both methods in one
process
![Page 12: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/12.jpg)
Hierarchical Integration Techniques POAD starts by assembling patterns at a
higher level of abstraction using the stringing approach
It then allows the designer to integrate the lower level classes to produce dense and profound designs
![Page 13: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/13.jpg)
outline
• Pattern Integration: Stringing vs Overlapping
• POAD Process Outline (Nutshell)• Analysis• Design• Design Refinement
![Page 14: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/14.jpg)
POAD Process Outline (Nutshell)
We will use the purpose/process/product template to explain the various steps within a development phases– Purpose - explains why a designer would
conduct this step – Process - describes the activity that the designer
conducts in this step – Product - describes expected output of this step
![Page 15: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/15.jpg)
Three phases of POAD
analysis – A set of patterns are selected from a domain
specific library high-level design phase where
– patterns are glued together using pattern composition models to produce an initial class diagram
design refinement phase – initial class diagram is processed to produce a
more dense and profound class diagram
![Page 16: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/16.jpg)
POAD Process
The following figure shows the symbols we use for POAD Process description
Product
A process uses a product
A process uses another process
Legend
A process produces a product
Process
![Page 17: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/17.jpg)
Acquaintance Pattern
Library
Candidate Patterns
Selection
Selected Patterns
Application Requirements
Requirement
Analysis
Required Conceptual
Components
Retrieval
Pattern-Level Diagrams
Constructing Pattern-Level
models
Create Pattern
Instances
Define Pattern
Relationships
Construct Pattern-Level
Diagrams
Constructing models for Pattern-Level with
Interfaces
Pattern-Level with Interfaces Diagrams
Declare Pattern
Interfaces
Identify Relationships
between Pattern Interfaces
Constructing models for Detailed Pattern-Level
Detailed Pattern-Level Diagrams
Selected Patterns
(c) Design
Instantiating Pattern Internals
Domain Specific Detailed Pattern-Level Diagrams
Specialization
Concretization
Develop Class Diagrams
Initial UML class diagram
Design Optimization
Reduction
Merging & Grouping
Optimized class diagram
Detailed Pattern-Level Diagrams(d) Design Refinement
Analysis
Design
Design Refinement
(b) Analysis
(a) Overall POAD
The POAD processa) overall phases, b) analysis, c) design, and d) design refinement
![Page 18: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/18.jpg)
outline
• Pattern Integration: Stringing vs Overlapping
• POAD Process Outline (Nutshell)• Analysis• Design• Design Refinement
![Page 19: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/19.jpg)
Analysis phase Purpose
– Analyze the application requirements and decide what patterns that will be used
Process– UML use case diagrams and sequence diagrams are
used to identify required patterns– Main concern is determining whether or not the
pattern can be used and why it is better– analyst searches pattern catalogues for candidate
patterns – Analyst must be acquainted with the catalogue
Acquaintance Pattern
Library
Candidate Patterns
Selection
Selected Patterns
Application Requirements
Requirement
AnalysisRequired
Conceptual Components
Retrieval
![Page 20: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/20.jpg)
Analysis phase– Retrieval how to select a pattern from a catalogue
Product– Patterns chosen by the application analyst – For example: Recall the
Feedback control example.Observer and Strategy patternis selected for thefeedforward component,
And for the feedback component
Reference Input
Measurement
Feedback Data
Error (Actuating) Signal
Feed forward
Elements
Feedback Elements
Plant.+
+Controlled
Output
Acquaintance Pattern
Library
Candidate Patterns
Selection
Selected Patterns
Application Requirements
Requirement
AnalysisRequired
Conceptual Components
Retrieval
![Page 21: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/21.jpg)
outline
• Pattern Integration: Stringing vs Overlapping
• POAD Process Outline (Nutshell)• Analysis• Design• Design Refinement
![Page 22: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/22.jpg)
Design phase
Purpose– Develop the application design by composing the
patterns selected in the analysis phase Process
– Instantiating patterns, and identifying relationships between instances
– Proceed from the Pattern-Level diagram to create a Pattern-Level with Interface diagram
Pattern-Level Diagrams
Constructing Pattern-Level
models
Create Pattern Instances
Define Pattern Relationships
Construct Pattern-Level
DiagramsConstructing models for
Pattern-Level with Interfaces
Pattern-Level with Interfaces Diagrams
Declare Pattern Interfaces
Identify Relationships between Pattern
InterfacesConstructing models for Detailed Pattern-Level
Detailed Pattern-Level Diagrams
Selected Patterns
(c) Design
![Page 23: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/23.jpg)
Design phase
Process (Cont.) From Pattern-Level with Interface diagram, the
designer identifies details of the pattern and Detailed Pattern-Level diagram is produced
Product– The product of this phase is Detailed Pattern-
Level diagrams
Pattern-Level Diagrams
Constructing Pattern-Level
models
Create Pattern Instances
Define Pattern Relationships
Construct Pattern-Level
DiagramsConstructing models for
Pattern-Level with Interfaces
Pattern-Level with Interfaces Diagrams
Declare Pattern Interfaces
Identify Relationships between Pattern
InterfacesConstructing models for Detailed Pattern-Level
Detailed Pattern-Level Diagrams
Selected Patterns
(c) Design
![Page 24: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/24.jpg)
Example FeedforwardStrategy<<Strategy>>
InputObserver<<Observer>>
Context
Update Notify
Subject
Attach()Detach()Notify()
ObserverUpdate()
ConcreteObserverobserverStateUpdate()
ConcreteSubjectsubjectStategetState()
nn
ConcreteStrategyA
AlgorithmInterface()
ConcreteStrategyB
AlgorithmInterface()
ContextContextInterface()
StrategyAlgorithmInterface()
![Page 25: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/25.jpg)
outline
• Pattern Integration: Stringing vs Overlapping
• POAD Process Outline (Nutshell)• Analysis• Design• Design Refinement
![Page 26: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/26.jpg)
Design Refinement phase
Purpose– To develop the profound dense class diagram for
the application Process
– Starting with Detailed Pattern-Level diagram– Designer instantiates each pattern in the context of
the application
![Page 27: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/27.jpg)
Design Refinement phase
Process (cont.)– This produces our initial class diagram– class diagram is obtained from gluing patterns
together at the high level design Product
– Optimized class diagram for the application
![Page 28: advrts slides 13 POAD Process - West Virginia Universitycommunity.wvu.edu/~hhammar/rts/adv rts/adv rts slides/07/advrts sli… · –Product -describes expected output of this step](https://reader034.fdocuments.us/reader034/viewer/2022050504/5f95f6048dcf6b1e572398ce/html5/thumbnails/28.jpg)
DataHolder
ErrorData MeasuredData FeedbackData
AbstractObserver
Update()
AbstractSubject
Attach()Detach()Notify()
ConcreteStrategyB
AlgorithmInterface()
ConcreteStrategyA
AlgorithmInterface()
FBConcreteStrategyB
AlgorithmInterface()
FBConcreteStrategyA
AlgorithmInterface()
ErrorObserverobserverState
Update()
Controller
ContextInterface()
Blackboard
setData()getData() n
nn
n
MeasurementSubjectsubjectState
GetState()
FeedbackSubjectObserver
AbstractController
AlgorithmInterface()
Example