Unformatted text preview:

DesignMethodResponsibility Driven DesignObject Modeling Technique (OMT)UMLObjects and AssociationsSlide 7Classes and AssociationsObjects and AttributesSlide 10Objects and BehaviorSlide 12Event DiagramsWhat Really is an Object?Slide 15Why this is importantDesign for ReuseSlide 18To Be or Not To Be --- A ClassSlide 20Slide 21What is an OO Model?OMTObject ModelMultiplicity of AssociationsDynamic ModelDesign vs. AnalysisAnalysis vs. DesignSlide 29OMT Process(continued)RDD ProcessRDD Initial DesignHeuristicsSlide 35PatternsChristopher Alexander -- A Pattern LanguageCompositeForcesSlide 40Composite PatternTwo design alternatives for Part-ofPart-ofEnsuring ConsistencySlide 45Slide 46Example: Views and FiguresComposite Pattern in VisualWorksCompositePartSlide 50Results of a PatternKinds of PatternsParts of a PatternPatterns Work TogetherBook ExampleA bookDistinquishing Components by Attributes, Not ClassesSlide 58Strategy PatternAdvantages of StrategyStrategyDesign with StrategyDecoratorsSlide 64Slide 65Decorator PatternDocument with DecoratorsSlide 68PrototypeSlide 70Slide 71Slide 72ConclusionDesignMethodsPatternsMethodConceptsNotationsProcessHeuristics(a book)Method: A systematic way of doing something.Responsibility Driven DesignConceptsClassResponsibilityCollaborationInheritanceSubsystemContractsBook: Object-Oriented Design by Wirfs-Brock, Wilkerson and WienerObject Modeling Technique (OMT)ConceptsObjectsClassesAssociations / CardinalityAttributesInheritanceEventsBook: Object-Oriented Modeling and Design by Rumbaugh, Blaha, Premerlani, Eddy and LorensonUMLUnified Modeling LanguageBooch, Rumbaugh, JacobsonUML = concepts and notationUnified Process = UML + a processObjects and AssociationsJohn is Mary's father. Mary is John's daughter.Bob is Mary's dog. Mary is Bob's owner.Ann is John's employer. John is Ann's employee.Objects and AssociationsMaryJohnBobAnnchildfatheremployeeemployerownerpetClasses and AssociationsPersonDogAnimalchildfatheremployeeemployerownerpetObjects and AttributesJohn's name is "John Patrick O'Brian".John's age is 27.John's address is 987 N. Oak St, Champaign IL 61820What about John's employer? John's wife?Objects and AttributesJohnJohnname: "John name: "John Patrick O'Brian"Patrick O'Brian"age: 27age: 27address: ...address: ...Objects and BehaviorJohn can earn money by working for his employer.John fills out time-cards.John takes vacations.Employer gives John a paycheck.John spends money to gain more possessions.fill out time-cardsfill out time-cardstake vacationstake vacationsreceive paycheckreceive paycheckbuy/spend buy/spend make reservationsmake reservationstravel travel check incheck inJohnJohnEvent DiagramsPersonTravel AgentAirlineHotelreservereservepayreserveCheck intravelpaypayreservepaytravelCheck inWhat Really is an Object?Reservation -- a promise to give service to a customerTicket -- record that customer has paid for service in advanceFlight Payment -- an event (transaction?) in which money is exchangedIn fact, anything we can talk about can be an object, including associations ("the husband of the first party", "first-born son").The important question is what we are trying to model.Models should be as simple as possible, but no simpler.Why this is importantMany of the objects in a good design are NOT problem domain objects.They can represent operations, processes, states, constraints, relationships, ...Design for ReusePurpose is to make a system flexible, extensible, and easily changed. Make things objects if they need to be changed and manipulated.Design for ReuseGoal is to build an application just by using preexisting objects.Compose, don't program.Relationship between objects as important as class hierarchy.To Be or Not To Be --- A ClassAnalysis model shouldn't contain implementation-specific objects like queues and lists.Classes should be• unique• relevant• specificTo Be or Not To Be --- A ClassOperations should not be objects unless you need to manipulate them.• A Call in a telephone billing system has attributes such as date and destination phone number, and must be stored so it can be printed on the monthly bill.The name of a class should represent its intrinsic nature and not a role that it plays in an association.• A person can have many roles when associated with a car: owner, passenger, driver, lesee.What is an OO Model?A OO model is a model expressed in terms of objects, classes, and the relationships between them.Models can be written in programming languages, graphics, or English.OMTgraphical OO modeling notation with three parts• object model• dynamic model (event trace/state machines)• functional model (data flow diagram)Object ModelObject, classes, attributes, operations, associations, inheritanceMammalPersonagebuy, sell,feedDogloudness, pricebarkownerpetMultiplicity of Associationsexactly onezero or morezero or oneone or moreotherClassClassClass1+1-2, 4Dynamic ModelRecord order of events, dynamic interaction between objects.DogPersonDoorEvent TraceState Machinebarkopennotifygo thru doornotifycloseregisterregisterNeed to Leavedo: register with doordo: bark at personLeavingdo: unregisterdo: go through doordo: notify dependentsunregisternotifyDesign vs. AnalysisUse of objects integrates design and analysis.• advantages - easier to move from one to the other• disadvantages - harder to tell which you are doingAnalysis vs. DesignAnalysis produces documents that customer can understand.Design produces documents that programmers can understand.DesignDesign must be implementable.Include detail not needed in analysis model.Doesn't include objects outside computer.OMT ProcessStart with requirementsBuild object modelidentify objects and classesprepare a data dictionaryidentify associations, attributesorganize using inheritancerefine, reorganize(continued)Build dynamic modelprepare scenariosidentify eventsbuild event tracebuild state diagramanalyze for consistencyRDD ProcessStart with partial requirementsBrainstorm for objectsInitial designIterate until you find all the objects, responsibilities, and collaborationsReorganize using inheritance and divide into subsystemsRDD Initial DesignRepeat until nothing is missing.Make scenario Add missing objectsAdd missing responsibilities (attributes and operations)Add missing collaborations (associations)HeuristicsModel the real world.Nouns are classes, verbs are operations on classes.Eliminate cycles of dependences between classes.Hide implementation details.A class


View Full Document

UIUC CS 497 - Design - Methods Patterns

Download Design - Methods Patterns
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 Design - Methods Patterns 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 Design - Methods Patterns 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?