Unformatted text preview:

Unified Modeling Language (UML) for OO domain analysisNotation warsCloser look at Coad & NicolaClass diagrams in UMLA heuristic for class diagram designTwo basic relationships of O-OGeneralizations (inheritance)AssociationsFive activities of OOAClass & Object analysisStructure (association) analysisAttributes and operationsYour next assignmentsEclipse with plug-insDynamic behaviorsSequence diagramCollaboration diagramsFrom CRC cards to Interaction diagramsUnified Modeling Language Unified Modeling Language (UML)(UML)for OO domain analysisfor OO domain analysisCSE432CSE432Prof Glenn BlankProf Glenn BlankNotation warsNotation warsEarly 90’s: 6-10 different notationsEarly 90’s: 6-10 different notationsBertrand MeyerBertrand Meyer: circles and arrows: circles and arrows Distinguishes inheritance and client/supplier relationshipsDistinguishes inheritance and client/supplier relationshipsGrady Grady BoochBooch: clouds, lines and decorations: clouds, lines and decorations GardeningPlan – Association- Environmental ControllerGardeningPlan – Association- Environmental Controller Heater and Cooler – Generalization/Specialization-> ActuatorHeater and Cooler – Generalization/Specialization-> Actuator Environmental Controller Environmental Controller ●●-“has a”- Heater (Cooler, Light)-“has a”- Heater (Cooler, Light) Actuator o– “using” – Temperature (client/supplier)Actuator o– “using” – Temperature (client/supplier) Actuator is an abstract class (‘A’ in a triangle)Actuator is an abstract class (‘A’ in a triangle)Peter Peter CoadCoad, Ed Yourdon & Jill Nicola, Ed Yourdon & Jill Nicola: : Rounded boxes and annotated linesRounded boxes and annotated lines Line bisected by semi-circle represents generalization (inheritance)Line bisected by semi-circle represents generalization (inheritance) Line bisected by triangle represents whole/partLine bisected by triangle represents whole/partSo, what’s your reaction to all these (and more) notations?So, what’s your reaction to all these (and more) notations? “ “Can’t we all get along?” Hence three amigos create UML in mid-90’sCan’t we all get along?” Hence three amigos create UML in mid-90’sCloser look at Coad & NicolaCloser look at Coad & NicolaTwo different boxes grouping classes:Two different boxes grouping classes:HIC (Human Interaction Component)HIC (Human Interaction Component)PDC (Problem Domain Components)PDC (Problem Domain Components)Why is “Separation of Concerns principle” a good idea?Why is “Separation of Concerns principle” a good idea?First person scenariosFirst person scenariosCoad & Nicola call this the "Coad & Nicola call this the "I'm aliveI'm alive principle": principle": Objects can be better understood by thinking about them and talking Objects can be better understood by thinking about them and talking about them in the first person:about them in the first person:"I know my own ____ and I can ___ myself.""I know my own ____ and I can ___ myself."What goes in the blanks?What goes in the blanks?Attributes and behaviorsAttributes and behaviorsWhy is putting these scenarios in the first person a good idea?Why is putting these scenarios in the first person a good idea?Promotes “object-think”: objects are autonomous, performing behaviorsPromotes “object-think”: objects are autonomous, performing behaviorsSimilarly, Kent Beck talks about the need for anthropomorphism in Similarly, Kent Beck talks about the need for anthropomorphism in responsibility-driven designresponsibility-driven designClass diagrams in UMLClass diagrams in UMLClasses are boxes, lines are associationsClasses are boxes, lines are associationsAdd decorations to lines to refine themAdd decorations to lines to refine themBut before we study the decorations….But before we study the decorations….A heuristic for class diagram designA heuristic for class diagram designDon't put any decorations on the associations at firstDon't put any decorations on the associations at first Semantics of relations tends to be Semantics of relations tends to be vaguevague““Is a" relationship can mean SUBTYPE ("a square is a polygon")Is a" relationship can mean SUBTYPE ("a square is a polygon")or INSTANCE‑OF ("George is a square") or INSTANCE‑OF ("George is a square") or IDENTICAL‑TO ("The morning star is the evening star")or IDENTICAL‑TO ("The morning star is the evening star")or PROPERTY‑OF ("A circle is a round object") or PROPERTY‑OF ("A circle is a round object") or ROLE‑OF ("George is a President")or ROLE‑OF ("George is a President")or MADE‑OF ("My house is a brick one") or MADE‑OF ("My house is a brick one") or simply EXISTS (“To be or not to be…").or simply EXISTS (“To be or not to be…").In many languages, there is no verb "is" at all, or it’s rarely used.In many languages, there is no verb "is" at all, or it’s rarely used.Let the meaning of relations Let the meaning of relations emergeemerge from what they relate from what they relateVagueness is natural: start off vague, get more specific graduallyVagueness is natural: start off vague, get more specific graduallyUML supports this heuristic by starting with simple UML supports this heuristic by starting with simple undirected lines (associations)undirected lines (associations)Later, add detail to your relationship structuresLater, add detail to your relationship structuresTwo basic relationships of O-OTwo basic relationships of O-OOOA typically distinguishes two relations: OOA typically distinguishes two relations: is‑ais‑a and and has‑ahas‑aWhy Why twotwo??That’s what O-O programming languages implement:That’s what O-O programming languages implement:Smalltalk and Java: instance variables and inheritanceSmalltalk and Java: instance variables and inheritanceC++: data members and class derivation C++: data members and class derivation Meyer calls these Meyer calls these inheritanceinheritance and and client/supplierclient/supplierBooch: Booch: generalization/specializationgeneralization/specialization and and associationassociation or or aggregationaggregation or or compositioncompositionCoad and Yourdon: Coad and Yourdon: gen/specgen/spec and and whole/partwhole/partUML calls these UML calls these generalizationgeneralization and and associationassociation or or aggregationaggregation or or


View Full Document

LEHIGH CSE 432 - Unified Modeling Language

Download Unified Modeling Language
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 Unified Modeling Language 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 Unified Modeling Language 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?