180 likes | 188 Views
Domain Models Part 1. http://flic.kr/p/9RR1BL. What are you going to learn about today?. Domain modeling: why? what? how? Diagramming domain models. http://flic.kr/p/8JpkTg. Iterative Development Process. We are here. Analysis. Requirements. Design. Initial Planning. Implementation.
E N D
Domain Models Part 1 http://flic.kr/p/9RR1BL
What are you goingto learn about today? • Domain modeling: • why? • what? • how? • Diagramming domain models http://flic.kr/p/8JpkTg
Iterative Development Process We are here Analysis Requirements Design InitialPlanning Implementation Planning Testing Evaluation Deployment
Analysis bridges the gapbetween requirements and design Design http://flic.kr/p/a1NZHb Analysis Requirements
Domain Model • “Most important—and classic—model in OO analysis” –Larman, p131 • Captures entities, attributes, and relationships in the problem domain • Represented with UML class diagram • Conceptual classes • As opposed to software or implementation classes • Acts as inspiration for some software classes • Lowers representational gap
POS Domain Model Classes: concepts or entities in the problem domain (not software)
3 aspects of conceptual classes 1. Symbol—words or images representing a conceptual class 2. Intention—definition of a conceptual class (put in glossary!) "A sale represents the event of a purchase transaction. It has a date and time." 3. Extension—set of examples to which conceptual class applies
POS Domain Model Classes: concepts or entities in the problem domain (not software) Attributes: number or text properties of conceptual classes
Is it a class or an attribute? If we do not think of an idea/thing asa number or text in the real world,it is probably a conceptual class,not an attribute
POS Domain Model Classes: concepts or entities in the problem domain (not software) Attributes: number or text properties of conceptual classes Associations: relationships between classes
Associations Readingdirection • Multiplicities: Read as • each Register records 0 or more Sales • each Sale is recorded by exactly 1 Register Name
Examples of multiplicities Also commonto see 0..* 8
How many Stores can an Item be stocked in? How many Items can a Store stock? How many Registers does a Store house? How many Sales LineItems per Sale? How many Sales LineItems can a particular Item be recorded in? POS Domain Model
How to find conceptual classes:Noun phrase identification • Identify nouns and noun phrases in descriptions of a domain • Nouns = candidate classes or attributes • Example:
Tip: Think like a mapmaker • Use existing names in the territory • Exclude irrelevant or out-of-scope features • Do not add things that are not there http://flic.kr/p/5QKvWh
Tip: Sketch classes starting from the upper left Sale Payment Store address
Think-Pair-Share Activity:Creating a Domain Model • Think • Identify nouns and noun phrases—for inspiration • Sketch class diagram • Group • Join your partner at the whiteboard • Collaboratively draw a class diagram • Make tentative decisions quickly, then debate • Share • I’ll randomly select diagram(s) to discuss • Identify one thing that you wish you’d thought of • Identify one thing that you would do differently http://flic.kr/p/5dfuqL
Summary • Domain models • Conceptual class diagrams • Attributes • Associations • Multiplicities • Tips: • Identify noun phrases • Think like mapmaker • Draw from upper left http://flic.kr/p/YSY3X