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 Planning Requirements Analysis Design Implementation Deployment Testing Evaluation Initial Planning
Analysis bridges the gap between requirements and 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 "A sale represents the event of a purchase transaction. It has a date and time." 2. Intention—definition of a conceptual class (put in glossary!) 3. Extension—set of examples to which conceptual class applies
POS Domain Model Attributes: number or text properties of conceptual classes Classes: concepts or entities in the problem domain (not software)
Is it a class or an attribute? If we do not think of an idea/thing as a number or text in the real world, it is probably a conceptual class, not an attribute
POS Domain Model Associations: relationships between classes Classes: concepts or entities in the problem domain (not software) Attributes: number or text properties of conceptual classes
Associations Reading direction Multiplicities: Read as each Register records 0 or more Sales each Sale is recorded by exactly 1 Register Name
Examples of multiplicities 8 Also common to see 0..*
POS Domain Model 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?
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 http://flic.kr/p/5dfuqL 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
Summary Domain models Conceptual class diagrams Tips: Attributes http://flic.kr/p/YSY3X Summary Domain models Conceptual class diagrams Attributes Associations Multiplicities Tips: Identify noun phrases Think like mapmaker Draw from upper left