DOC PREVIEW
UT Dallas CS 6359 - S16_Chapter_17

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1What will we learn?Object Design: PrinciplesSlide 4Object Design: How to ProceedResponsibility Driven Design (RDD)GRASPGang of FourMore on GRASPCreatorSlide 11CreatorSlide 13Dog Grooming ParlorDog Grooming ParlorInformation ExpertSlide 17Information Expert: Example POSSlide 19Information Expert: Example POS (cont)Slide 21Information Expert: How to UseLow CouplingSlide 24Low Coupling: Monopoly ExampleLow Coupling: POS ExampleSlide 27Low Coupling: ObservationsTakeaways from Chapter 17Next …Object-Oriented Analysis and DesignCHAPTER 17: GRASP PRINCIPLES1What will we learn?GRASP – Designing objects with responsibilitiesWe will enter the design phase: We’ll learn how to take the analysis we’ve done and convert it to an object-oriented designRecall what we’ve done so far:Explored Use Cases, and how to createExplored how to create a Domain Model after the use cases were createdExplored how to create System Sequence Diagrams if necessary, and create Operations ContractsOn to the design …2Object Design: Principles Several of the artifacts that were created during analysis stage (Inception, Elaboration phases) provide input into the design:Use case text explain the behavior that software classes must ultimately support. This part of the design is called use case realization, because the design will ultimately “realize” the use casesThe SSDs describe the system event/operation messages (at a high level), and this is the starting point for our eventual interaction diagramsWe may have Operations Contracts that complement the use case text, to clarify that the software must achieve in a system operationThe Supplementary Specification captured any non-functional requirementsThe Glossary would capture any requirements related to parameters or data, plus other detailsThe Domain Model suggests some names and attributes for our software objects, but at a high level34Operation: enterItem(…)Post-conditions:- . . .Operation ContractsSaledate. . .SalesLineItemquantity1..*1. . .. . .Domain ModelUse-Case ModelDesign Model: RegisterenterItem(itemID, quantity): ProductCatalogd = getProductDescription(itemID)addLineItem( d, quantity ): SaleRequire-mentsBusiness ModelingDesignSample UP Artifact Relationships: SystementerItem(id, quantity)Use Case TextSystem Sequence DiagramsmakeNewSale()system eventsCashierProcess Sale: Cashieruse case namessystem operationsUse Case DiagramSupplementarySpecificationGlossarystarting events to design for, and detailed post-condition to satisfyProcess Sale1. Customer arrives ...2. ...3. Cashier enters item identifier.inspiration for names of some software domain objectsfunctional requirements that must be realized by the objectsideas for the post-conditionsRegister...makeNewSale()enterItem(...)...ProductCatalog...getProductDescription(...)...1*non-functional requirementsdomain rulesitem details, formats, validationObject Design: How to Proceed First step is usually a “modeling day”, where time is spent creating UML diagrams for the design model based upon the previously mentioned artifacts The key idea is responsibility-driven design, which is essentially assigning responsibilities to collaborating objects Will result in both static and dynamic diagrams, i.e. class and interaction diagrams Small groups will work on various parts of the design, but shortly after (perhaps a one-day modeling workshop) the team will start coding Remember, this is an iterative approach, not Waterfall! Outputs include UML diagrams for object design (class diagrams), interaction diagrams, package diagrams, user interface sketches (and prototypes), database models, etc.5Responsibility Driven Design (RDD) Basic idea is to assign responsibilities to the software objects Two basic types of responsibility: Doing and KnowingDoing: doing something, creating an object, doing a calculation, initiate some action in another object, control activity between objects. Generate some activityKnowing: knowing about private encapsulated data, related objects, or things that can be derived or calculatedMay also have Collaboration, in which an object may collaborate with several other objects to fulfill a responsibility Note that responsibilities are not methods – they are an abstraction – but methods fulfill responsibilities RDD leads to thinking of the system as a community of collaborating objects, each with a set of responsibilities6GRASP GRASP = General Responsibility Assignment Software Patterns (or Principles)GRASP names and describes basic principles to assign responsibilities – useful tool for RDDProvides patterns for assigning responsibilities What is a pattern?A principle or idiom used that provide guidance in the creation of softwareThey have a name, describe a problem, and a solution to the problemPatterns can be applied in various circumstances, to numerous contextsOften these guide the assignment of responsibilities to objectsA good pattern is a named and well known problem/solution pair that can be applied in new contextsNaming is important – provides a way to identify the pattern Good patterns are usually the result of tried-and-true knowledge, i.e. solutions that have been applied many times before7Gang of Four In 1994, four authors produced a book called Design PatternsGamma, Helm, Johnson, Vlissides Described 23 patterns that are useful for OOD Considered the “bible” of design pattern books Often referred to as “Gang of Four” patterns, or GoF Patterns We’ll see more in later chapters We will call the GRASP ideas principles and the GoF ideas patternsGRASP principles are more high level, general principles of object designGoF patterns are more concrete, solutions to specific problems in object design8More on GRASP GRASP defines 9 principles These are basic building blocks in OODCreatorControllerInformation ExpertLow CouplingHigh CohesionPolymorphismPure FabricationIndirectionProtected Variations9Creator Problem: Who should be responsible for creating a new instance of some class?Basic problem in design, so it’s a good idea to have a general principle for deciding how to solve this (i.e., how to assign this responsibility) Solution: Assign class B the responsibility to create class A if one or more of the following is true:B “contains” or completely aggregates AB records AB closely uses AB has the initializing data for A that will be passed to A when it is created (B is an Expert with respect to creating A) Example: Consider the Monopoly Game


View Full Document

UT Dallas CS 6359 - S16_Chapter_17

Documents in this Course
Lecture2

Lecture2

63 pages

Lecture3

Lecture3

49 pages

Lecture4

Lecture4

48 pages

Lecture5

Lecture5

47 pages

Lecture6

Lecture6

45 pages

Lecture7

Lecture7

63 pages

Lecture8

Lecture8

77 pages

Lecture9

Lecture9

48 pages

Lecture10

Lecture10

84 pages

Lecture11

Lecture11

45 pages

Lecture12

Lecture12

134 pages

Lecture13

Lecture13

62 pages

Lecture14

Lecture14

76 pages

Project

Project

2 pages

Chapter_1

Chapter_1

25 pages

Load more
Download S16_Chapter_17
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view S16_Chapter_17 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view S16_Chapter_17 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?