OO Methodology Elaboration Iteration 3 – Part 3 - More Design Patterns -

Slides:



Advertisements
Similar presentations
Systems Architecture Use Case Diagram, System Overview, Class Diagram Design Patterns (weve used) Refactorings (weve used) Table of Contents.
Advertisements

Object-Oriented Analysis and Design
Object Design Examples with GRASP
Chapter 1 Object Oriented Analysis and Design. UML, Patterns, and Object-Oriented Analysis and Design  The essential skills for the creation of well-designed,
Object-Oriented Analysis and Design CHAPTERS 12-14: INTRODUCTION TO DESIGN 1.
Design Patterns Copyright © Vyacheslav Mukhortov, Nikita Nyanchuk-Tatarskiy, Copyright © INTEKS LLC,
Object-Oriented Software Engineering Practical Software Development using UML and Java Design Patterns Sources: Chapter 6: Using Design Patterns, and Chapter.
Chapter 3 Case Studies.
Object-Oriented Analysis and Design
Chapter 26 Applying Gang of Four Design Patterns 1CS6359 Fall 2012 John Cole.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
The first step in getting what you want is to decide what you want.
TK2023 Object-Oriented Software Engineering CHAPTER 6 SYSTEM SEQUENCE DIAGRAMS.
Client/Server Software Architectures Yonglei Tao.
CSSE 374: Even More Object Design with Gang of Four Design Patterns These slides derived from Shawn Bohner, Curt Clifton, and others involved in delivering.
MVC pattern and implementation in java
Design Patterns.
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
CSSE 374: More Object Design with Gang of Four Design Patterns Steve Chenoweth Office: Moench Room F220 Phone: (812)
Chapter 17. GRASP General Responsibility Assignment Software Patterns (Principles) OOD: after identifying requirements, create domain model, define responsiblities.
CSSE 374: Introduction to Gang of Four Design Patterns
CSSE 374: 3½ Gang of Four Design Patterns These slides derived from Steve Chenoweth, Shawn Bohner, Curt Clifton, and others involved in delivering 374.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Chapter 7: Object Design Examples with GRASP. Objective Design use case realizations. Apply GRASP to assign responsibilities to classes. Apply UML to.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Chapter 26 GoF Design Patterns. The Adapter Design Pattern.
GRASP: Designing Objects With Responsibilities Chapter 17 Applying UML and Patterns -Craig Larman.
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Copyright © Craig Larman All Rights Reserved Responsibility-Driven Design with the GRASP Patterns.
Object-Oriented Design Part 2
GRASP: Designing Objects with Responsibilities
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Object Design and Use- Case Realizations with GRASP Patterns.
Unit 4 Object-Oriented Design Patterns NameStudent Number CAI XIANGHT082182A KYAW THU LINHT082238Y LI PENGFEIHT082220L NAUNG NAUNG LATTHT082195L PLATHOTTAM.
What to remember from Chap 13 (Logical architecture)
OO Methodology Elaboration Iteration 3 – Part 2 Refining Models.
Design Model Lecture p6 T120B pavasario sem.
CS 4233 Review Feb February Review2 Outline  Previous Business – My.wpi.edu contains all grades to date for course – Review and contact.
Chapter 36 More Object Design with GoF Patterns 1CS6359 Fall 2011 John Cole.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
OO Methodology Elaboration Iteration 2 - Design Patterns -
OO Methodology Elaboration Iteration 3 – Part 1 Refining Models.
OO Design Roshan Chitrakar. Analysis to Design Do the RIGHT thing Do the RIGHT thing Requirement Analysis Requirement Analysis Domain Modeling with addition.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Elaboration Iteration 3 – Part 3 - Persistence Framework -
Copyright © Craig Larman All Rights Reserved COMP-350 Object-Oriented Analysis and Design GRASP: Designing Objects with Responsibilities Reference:
GRASP: Designing Objects With Responsibilities
References: Applying UML and patterns Craig Larman
OO Methodology Elaboration Phase Iteration 1- Part 3.
Proxy Pattern defined The Proxy Pattern provides a surrogate or placeholder for another object to control access to it by creating a representative object.
DESIGNING A PERSISTENCE FRAMEWORK WITH PATTERNS. The Problem: Persistent Objects persistent object An object that can survive the process or thread that.
OOD OO Design. OOD-2 OO Development Requirements Use case analysis OO Analysis –Models from the domain and application OO Design –Mapping of model.
OO Methodology Elaboration Phase Iteration 1- Part 2.
Elaboration: Iteration 2. Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early,
Object Design Examples with GRASP
Elaboration popo.
GoF Patterns (GoF) popo.
Chapter 12: Collaboration Diagram - PART2
Conception OBJET GRASP Patterns
Design Patterns with C# (and Food!)
Apply Expert, Creator, Controller, Low Coupling, High Cohesion
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
GoF Design Patterns (Ch. 26)
Frameworks And Patterns
OBJECT ORIENTED ANALYSIS AND DESIGN
GoF Design Patterns (Ch. 26)
GoF Patterns Ch. 26.
Presentation transcript:

OO Methodology Elaboration Iteration 3 – Part 3 - More Design Patterns -

2 Table of Contents Iteration 1 –Use-Case Model –Process Sale Use Case –Domain Model –Design Model Iteration 2 –GRASP: More Patterns for Assigning Responsibilities –Designing Use-Case Realizations with GoF Design Patterns Iteration 3 –Related Use Cases –Modeling Generalization –Refining the Domain Model –Adding New SSDs and Contracts –Modeling Behavior in Statechart Diagrams –Designing the Logical Architecture with Patterns –Organizing the Design and Implementation Model Packages –Introduction to Architectural Analysis and the SAD –Designing More Use-Case Realization with Paterns –Designing a Persistence Framework with Patterns

3 Iteration 3 Requirements Provide failover to local services when the remote services cannot be accessed. Provide support for POS device handling, such as the cash drawer and coin dispenser Handle credit payment authorization Support for persistent objects

4 Failover to Local Services Requirements –Robust recovery from remote service failure(e.g. inventory) –Robust recovery from remote product database failure Using Local Cache –to improve recoverability –to improve performance –cache-first, remote-second Implemented by using Factory and Adapter 1.The ServiceFactory will always return an adapter to a local product information service 2.The local products adapter is not really an adapter to another component. It implement the responsibilities of the local service 3.The local service is initialized to a reference to a second adapter to the true product service 4.If the local service finds the data in its cache, it returns it; otherwise, it forwards the request to the adapter for the external service Levels of Cache –In-memory ProductCatalog maintains some ProductSpecification objects –Local product service maintains a larger persistent cache to support fault-tolerance

5 Failover to Local Services Adapters for Product Information –the new local service object is inserted without affecting the design of the ProductCatalog object

6 Failover to Local Services Initialization of the product information service –Using Factory and Adapter

7 Failover to Local Services Starting collaboration with the product service –in-memory cache

8 Failover to Local Services Continuing the collaboration for the product information –If the local product service does not the product in its persistent cache, it collaborates with the adapter to the external service New external services do not affect the design –only the factory’s configuration of the remote service needs to change

9 Failover to Local Services Active objects –Since products prices change quickly, the cache can contains stale data –One solution is to add a remote service operation that answers today’s current change, and the LocalProduct object queries it every n minutes and updates its cache –one approach is to make LocalProduct active object

10 Failover to Local Services with a Proxy Problem –External service should be tried first, and a local version second –e.g. consider the posting of sales to the accounting service Proxy Pattern –Context/Problem Direct access to a real subject object is not desired or possible. –Solution Add a level of indirection with a surrogate proxy that implements the same interface as the subject object and is responsible for controlling or enhancing access to it

11 Failover to Local Services with a Proxy External accounting service access 1.Send a postSale message to the redirection proxy 2.if the proxy fails to contact with the external service, then it redirects the postSale to a local service

12 Accessing External Physical Devices with Adapters Requirements –to interact with physical devices (cash drawer, coin dispenser,etc.) –NextGen POS must work with a variety of POS equipment(IBM, Epson, NCR, etc) Some Investigations –there is an industry standard, UnifedPOS –there is a Java mapping of the Unified POS, JavaPOS –the major manufacturers of POS equipment provide JavaPOS implementations Adapter Device Driver Device JNI JavaPOS

13 Abstract Factory Context –There are families of classes (cashDrawer+CoinDispenser+...) –Each family implements the same interfaces Solution –Define a factory interface(the abstract factory). –Define a concrete factory class for each family

14 Abstract Factory Abstract Class Factory –Abstract factory using Singleton pattern, reads from a system property to decide which of its subclass factories to create

15 Handling Payments with Polymorphism Do It Myself –I do those things that are normally done to the actual object that I,m an abstraction of. Circle objects draw themselves Square objects draw themselves Text objects spell-check themselves –Do It Myself and Information Expert usually lead to the same choice –Do It Myself and Polymorphism usually lead to the same choice To handle multiple payment types –including authorization and accounting steps –different kinds of payments in different ways

16 Handling Payments with Polymorphism Creating a CreditPayment

17 Handling Payments with Polymorphism Creating a CheckPayment

18 Handling Payments with Polymorphism Credit Payment Authorization –payment authorization protocols involve merchant ID and POS terminal ID

19 Handling Payments with Polymorphism Credit Payment Authorization (cont’) –adapter implementations protect the upper layers of the system against all variations in payment authorization( format, protocol etc.)

20 Handling Payments with Polymorphism Credit Payment Authorization (cont’)