Fall 2009ACS-3913 R. McFadyen1 Problem: You have a responsibility to assign to a class, but assigning it to a class in the conceptual model causes low.

Slides:



Advertisements
Similar presentations
Service and Dispatch Updates Presented by: Derek Kratz.
Advertisements

Object-Oriented Analysis and Design CHAPTER 17, 25: GRASP PATTERNS 1.
GRASP The other four What are the first five? What is the goal/purpose of using patterns?
Oct 2, Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
October R. McFadyen1 Polymorphism Indirection Pure Fabrication Protected Variations (Law of Demeter) Ch 22: More GRASP Patterns.
Feb R. McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m Function:
Layered Architectures The objectives of this chapter are: To understand the principles and importance of Layered Architectures To explain the structure.
A Guide to SQL, Seventh Edition. Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT.
Fall 2009ACS-3913 R McFadyen1 Design Patterns (GoF) contains the creational patterns: Abstract factory Builder Factory method (Simple Factory) Prototype.
ACS R McFadyen 1 Transaction A transaction is an atomic unit of work that is either completed in its entirety or not done at all. For recovery purposes,
Chapter 25 GRASP: More Objects with Responsibilities 1CS6359 Fall 2011 John Cole.
Oct 21, R. McFadyen1 Pure Fabrication P Problem: You have a responsibility to assign to a class, but assigning it to a class in the conceptual.
Spring 2010ACS-3913 Ron McFadyen1 Command The complex remote control (many pairs of buttons; null command) Undo … pages 216+ Macro … pages 224+
NJIT More GRASP Patterns Chapter 22 Applying UML and Patterns Craig Larman Prepared By: Krishnendu Banerjee.
Fall 2009ACS-3913 Ron McFadyen1 idea was first put forth by Christopher Alexander (1977) in his work on architectural design principles a pattern is a.
Jan 21, Ron McFadyen1 Domain Modeling Specification classes “need-to-know” associations Reflexive associations “association checklist”
February Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Pronunciation: -"fi-z&m.
March R McFadyen1 Activity Diagrams start end branch merge fork join guard transition swimlanes activity Used to present procedural steps (algorithm)
Low Coupling High Cohesion
GRASP : Designing Objects with Responsibilities
March 6, R. McFadyen1 Pure Fabrication P Problem: You have a responsibility to assign to a class, but assigning it to a class in the.
October 20, 2005Architectural Design, ECEN Architectural Design Architecture Business Cycle Design for Maintainability ECEN 5543 / CSCI 5548 SW Eng.
March R. McFadyen1 Pure Fabrication P Problem: You have a responsibility to assign to a class, but assigning it to a class in the conceptual.
Transaction Management and Concurrency Control
Fall 2009ACS-3913 Ron McFadyen1 From the Merriam-Webster’s online dictionary ( Main Entry: an·thro·po·mor·phism Date: 1753 an interpretation.
Chapter 25 More Design Patterns.
S9k Preventive Maintenance & Equipment Inventory.
MDECA SECURITY UPDATES Update & Review for Security Changes!
Fall CIS 764 Database Systems Design L18.1 Miscellaneous Notes.
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 17. GRASP General Responsibility Assignment Software Patterns (Principles) OOD: after identifying requirements, create domain model, define responsiblities.
1 SAD2 - UML 4 th Lecture Class Diagram in Construction Phase Patterns Case Study Lecturer: Dr Dimitrios Makris
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
MyFloridaMarketPlace MyFloridaMarketPlace Change Request Board August 30, 2007.
Chapter 18 Object Design Examples with GRASP 1CS6359 Fall 2011 John Cole.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Design Patterns. Patterns “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
Next Gen POS Example GRASP again. Same Patterns Different Example!
Jan 21, Ron McFadyen1 Ch 10. Domain Model: Visualizing Concepts Domain model illustrated with a class diagram (with no operations defined)
Distributed Software Development QR Marks The Spot Beta Prototype Vadym Khatsanovskyy, Nicolas Jacquemoud.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 MIP PALT Tool Training WebEx Training (2 hours) Introduction to the PALT Tool Monday 4/17/2006 & Tuesday 4/18/2006 Updated Monday 6/18/2007.
1 Announcements Reading for next week: Chapter 4 Your first homework will be assigned as soon as your database accounts have been set up.  Expect an .
State of Kansas Control Groups Statewide Management, Accounting and Reporting Tool Group Information – Add a New Value Navigation: Accounts Payable > Control.
Chapter 17 Designing with Responsibilities. Fig
References: Applying UML and patterns Craig Larman
Design. 2 The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary but not sufficient in order.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
GRASP: More Patterns for Assigning Responsibilities Presented By Dr. Shazzad Hosain.
Warranty – Online Tag This great new feature allows Warranty Tags to be created in Order Entry accessing JEN. This is the first phase in a 3-part project.
CSCI 6962: Server-side Design and Programming Shopping Carts and Databases.
A Guide to MySQL 6. 2 Objectives Create a new table from an existing table Change data using the UPDATE command Add new data using the INSERT command.
Oct 3, Ron McFadyen1 GRASP Patterns 1.Expert 2.Creator 3.Controller 4.Low Coupling 5.High Cohesion.
TK2023 Object-Oriented Software Engineering CHAPTER 13d GRASP Patterns: High Cohesion.
GRASP.
TK2023 Object-Oriented Software Engineering
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,
TK2023 Object-Oriented Software Engineering
Conception OBJET GRASP Patterns
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
Apply Expert, Creator, Controller, Low Coupling, High Cohesion
GRASP : Designing Objects with Responsibilities
CST221: Database Systems (III)
Chapter 25 GRASP The other four.
Chapter 25 GRASP The other four.
Updating Databases With Open SQL
Next Gen POS Example GRASP again.
Updating Databases With Open SQL
Presentation transcript:

Fall 2009ACS-3913 R. McFadyen1 Problem: You have a responsibility to assign to a class, but assigning it to a class in the conceptual model causes low coupling and/or high cohesion. Solution: Fabricate a class - create a class that is not found in your conceptual model, one that does not necessarily have a business meaning to the business person. Pure Fabrication

Fall 2009ACS-3913 R. McFadyen2 Example: Suppose we need to save instances of Sale in a relational database. To which class in the model do you assign this responsibility? Since Sale has the information to be saved, Sale would be suggested by Information Expert. To manage data going to and from a relational database will require a large number of operations … insert, delete, update, select, rollback, commit, buffer management, … Pure Fabrication

Fall 2009ACS-3913 R. McFadyen3 Pure Fabrication The Expert pattern suggests that Sale is the expert, and so should be the class to do this. There’s a lot involved - save, retrieve, commit, rollback - what about LineItems? When you save a Sale do you save LineItems too? We would end up adding a lot to Sale that has nothing to do with Sale-ness … Sale becomes less cohesive and more highly coupled to more non-domain classes. Sale will become much more complex, and not so focused.

Fall 2009ACS-3913 R. McFadyen4 Pure Fabrication Pure Fabrication suggests to create a new class for these new responsibilities PersistentStorage insert() delete() update()... Sale remains well-designed - high cohesion, low coupling PersistentStorage class is relatively cohesive - sole purpose is to store/retrieve objects to/from a relational database PersistentStorage is a fabrication; it is made up from your imagination; it cannot be found in the Domain Model

Fall 2009ACS-3913 R. McFadyen5 Pure Fabrication Example: see pages of Patterns in Java, Volume 2; Mark Grand; John Wiley & Sons Fig 4.13 shows a conceptual model Fig 4.14 shows an initial assignment of responsibilities, where the ServiceManager does scheduling and invoicing. Fig 4.15 shows the fabrication of a new class, InvoiceGenerator, which results in higher cohesion/less coupling.

Fall 2009ACS-3913 R. McFadyen6 System manages a field service organization: Organization sends technicians who install and repair equipment on service calls to other organizations that use the equipment Some service calls are paid by the organization that uses the equipment; equipment vendors pay from some service calls; others are paid for jointly. Service manager is given field service projects for a user organization Service manager is schedules service technicians to perform the tasks Service manager sends invoices for completed tasks to the paying organizations

Fall 2009ACS-3913 R. McFadyen7 UserOrganization PayingOrganization ServiceTechnician ServiceManager FieldServiceProject Note: ServiceManager is highly coupled to other classes Organizes-work-for Install/repair-equipment schedules invoices compute-invoices-for performs pays-for 1..* 0..* * 0..* ServiceTask getPayor(): Patterns in Java, Volume 2 Fig 4.14

Fall 2009ACS-3913 R. McFadyen8 Consider the tasks assigned to the ServiceManager: scheduling tasks scheduling projects scheduling technicians generating invoices These are central to the function of the service manager no reasonable class in the domain to assign this to, so using Pure Fabrication, fabricate a new class for this purpose

Fall 2009ACS-3913 R. McFadyen9 UserOrganization Paying Organization ServiceTechnician ServiceManager FieldServiceProject Organizes-work-for Install/repair-equipment schedules invoices compute-invoices-for performs pays-for 1..* 0..* * 0..* ServiceTask getPayor(): Invoice Generator generateInvoices(): Note: Pure Fabrication preserves low coupling and high cohesion Patterns in Java, Volume 2 Fig 4.15