Introduction to Pattern Oriented Analysis and Design (POAD)
Instructor: Dr. Hany H. Ammar
- Dept. of Computer Science and
Introduction to Pattern Oriented Analysis and Design (POAD) - - PowerPoint PPT Presentation
Introduction to Pattern Oriented Analysis and Design (POAD) Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU Outline Review of Design Patterns The Lifecycle of a Pattern Examples of Design
Review of Design Patterns
– The Lifecycle of a Pattern
– Examples of Design Patterns The Command Pattern The Observer Pattern The Strategy Pattern Pattern Oriented Development – The Analysis phase – The Design phase – The design refinement phase The Feedback Control Example
Real World Projects Pattern Mining Discover Patterns Incident Occurrence of a Pattern Preliminary Documentati
Document Analyze/Rule of Three Author Version Document Pattern Polishing Reusable Version Pattern Reuse Feedback Modification
Phase I: MINING Author World Phase II: POLISHING Pattern Community World Phase III: REUSE Pattern User World
Legend Activit y Produc t
(From the Reference “Pattern-Oriented Analysis and Design”,
Sherif M Yacoub and Hany H. Ammar Addison-Wesley Inc., 2004)
From the Design Patterns CD by Gamma et al, Addison-Wesley Inc., 1998
From the Design Patterns CD by Gamma et al, Addison-Wesley Inc., 1998
–
–
–
Analysis Design Design Refinement
a logical model is developed and patterns are selected where patterns are glued together to produce a detailed pattern-level diagram An initial class diagram, and a more dense and profound class diagram, and sequence diagrams are developed
Acquaintan ce Pattern Library Candidate Patterns Selection Selected Patterns Application Requirements Requirem ent 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 Specializatio n Concretizatio n Develop Class Diagrams Initial UML class diagram Design Optimization Reductio n Merging & Grouping Optimized class diagram Detailed Pattern- Level Diagrams
(d) Design Refinement Analysis Design Design Refinement (b) Analysis (a) Overall POAD
The POAD process
a) overall phases, b) analysis, c) design, and d) design refinement
Retrieval of patterns from the domain specific
Selection of patterns from a set of candidate
Reference Input Measurement Feedback Data Error (Actuating) Signal Feed forward Elements Feedback Elements Plant. + + Controlled Output
From Pattern-Oriented Analysis and Design, Sherif M Yacoub and Hany H. Ammar Addison-Wesley Inc., 2004
– The feedforward component implements some sort of a
– The feedback component receives measurements and applies
– In the error calculation component, the feedback controller
– Data of different types need to be exchanged between the
FeedforwardStrategy <<Strategy>> FeedbackObserver <<Observ er>> FeedbackStrategy <<Strategy>> ErrorObserver <<Observ er>> Blackboard <<Blackboard>> Apply forward control strategy Manipluate Data Plant Apply feedback control strategy Manipulate Data Calculate Error Manipluate Data
This is an architectural pattern based on the data flow architectural style
FeedforwardStrategy (from POAD1-Feedback) <<Strategy>> FeedbackObserver <<Observer>> (from POAD1-Feedback) FeedbackStrategy <<Strategy>> (from POAD1-Feedback) ErrorObserver <<Observer>> (from POAD1-Feedback) Blackboard <<Blackboard>> (from POAD1-Feedback) Context Update Notify Context Update Notify setData getData
FeedforwardStrategy (from POAD1-Feedback) <<Strategy>> Feedback Observ er (from POAD1-Feedback) <<Observer>> Feedback Strategy (from POAD1-Feedback) <<Strategy>> ErrorObserver (from POAD1-Feedback) <<Observer>> Black board (from POAD1-Feedback) <<Black board>> Context Update Notify Context Update Notify setData getData
ConcreteOb servern
Subject Attach() Detach() Notify() Observer Update() ConcreteObservern
ConcreteStrate gyA AlgorithmInterface() ConcreteStrate gyB AlgorithmInterface() Context ContextInterface() Strategy AlgorithmInterface() Context ContextInterface() Strategy AlgorithmInterface() ConcreteStrategyB AlgorithmInterface() ConcreteStrategyA AlgorithmInterface() ConcreteDataHolderA ConcreteDataHolderB Blackboard setData() getData() DataHoldern
ErrorObserver (from POAD1-Feedback) <<Observer>>
ErrorObserver
Update() FeedbackSu bject subjectState GetState() AbstractSubject Attach() Detach() Notify() AbstractObserver Update()
n Update Notify
FeedforwardStrategy (from POAD1-Feedback) <<Strategy>>
ConcreteStrategyA AlgorithmInterface() ConcreteStrategyB AlgorithmInterface() AbstractController AlgorithmInterface() Controller ContextInterface()
Controller
Blackboard (from POAD1-Feedback) <<Blackboard>>
Blackboard setData() getData() DataHolder
getData setData n
ErrorData MeasuredData FeedbackData
DataHolder ErrorData MeasuredData FeedbackData AbstractObserver Update() AbstractSubject Attach() Detach() Notify()
n
AbstractController AlgorithmInterface() ConcreteStrategyB AlgorithmInterface() ConcreteStrategyA AlgorithmInterface() FBAbstractController AlgorithmInterface() FBConcreteStrategyB AlgorithmInterface() FBConcreteStrategyA AlgorithmInterface() Feedback ContextInterface() FeedbackSubject subjectState GetState() ErrorObserver
Update() Controller ContextInterface() Blackboard setData() getData()
n
AbstractObserver Update() AbstractSubject Attach() Detach() Notify() MeasurementSubject subjectState GetState()
n
FeedbackObserver
Update()
DataHolder ErrorData MeasuredData FeedbackData AbstractObserver Update() AbstractSubject Attach() Detach() Notify() ConcreteStrategyB AlgorithmInterface() ConcreteStrategyA AlgorithmInterface() FBConcreteStrategyB AlgorithmInterface() FBConcreteStrategyA AlgorithmInterface() ErrorObserver
Update() Controller ContextInterface() Blackboard setData() getData()
n n n
MeasurementSubject subjectState GetState()
FeedbackSubjectObserver
AbstractController AlgorithmInterface()
Object Collaboration Diagram
Measurement : MeasurementSubject Error : ErrorObserver F_controller : AbstractController Strategy1 : ControlStrategyA FB_Strategy : FBControlStrategyA 5: MeasurePlant ( ) Feedback : FeedbackSubjectObserver TheBlackboard: Blackboard 9: Notify() 12: GetInput() 13: Analyze() 7: FBApply () 8: Update () 10: Update() 11: Getstate() 3: Update ( ) 4: GetState ( ) 6: Update () 15: Control (DataHolder*) 14: Update () 1: Apply (DataHolder*) 2: Notify ( )