Title: Domain Model Visualizing Concepts
1Domain Model Visualizing Concepts
- Chapter 9
- Applying UML and Patterns
- Craig Larman
2Comments on diagrams
- Now that we are starting to look at diagrams, I
want to emphasize that this is a class on
analysis and design, not diagramming. While it
may look good on your resume that you can use
UML, your career depends on being able to
translate ideas into good systems. That is much
more difficult.
3Domain Model Relationships
Domain Model
Business Model
Classes, attributes, associations
Elaboration on some terms
Domain objects
Use Case Model
Glossary
Requirements
Interaction Diagrams
Design
4A Domain Model
- illustrates meaningful conceptual classes in a
problem domain. - is a representation of real-world concepts, not
software components. - is NOT a set of diagrams describing software
classes, or software objects and their
responsibilities.
5A Domain Model is the most important OO artifact
- Its development entails identifying a rich set of
conceptual classes, and is at the heart of object
oriented analysis. - It is a visual representation of the
decomposition of a domain into individual
conceptual classes or objects. - It is a visual dictionary of noteworthy
abstractions.
6Domain Model UML Notation
- Illustrated using a set of class diagrams for
which no operations are defined. - It may contain
- Domain Objects or Conceptual Classes
- Associations between conceptual classes
- Attributes of conceptual classes
7A Domain Model is not a Software Artifact
Software Artifacts
SalesDatabase
Sale
Date Time
vs.
Sale
Date Time
Print()
8Think of Conceptual Classesin terms of
- Symbols words or images
- Intensions its definition
- Extensions the set of examples to which it
applies - Symbols and Intensions are the practical
considerations when creating a domain model.
9Decomposition
- A central distinction between Object-oriented
analysis and structured analysis is the division
by objects rather than by functions during
decomposition. - During each iteration, only objects in current
scenarios are considered for addition to the
domain model.
10Conceptual Class Identification
- It is better to overspecify a domain with lots of
fine-grained conceptual classes than it is to
underspecify it. - Discover classes up front rather than later.
- Unlike data modeling, it is valid to include
concepts for which there are no attributes, or
which have a purely behavioral role rather than
an informational role.
11Identify Conceptual Classesby Category List
- Common Candidates for classes include
- Tangible objects, Descriptions, Roles,
- Places, Transactions, Containers,
- Systems, Abstract nouns, Rules,
- Organizations, Events, Processes,
- Written Materials, Catalogs, Records,
- Financial Instruments and Services
12Identify Conceptual Classesby Noun Phrase
- Identify Nouns and Noun Phrases in textual
descriptions of the domain. - Fully dressed Use Cases are good for this type of
linguistic analysis. - Its not strictly a mechanical process
- Words may be ambiguous
- Different phrases may represent the same concepts.
13Sales Domain example - Purchase Items Use Case
- We find concepts such as Register, Sale, Item,
Customer, Receipt etc. in this use case. - Should we include Receipt in the Model?
- Con As a report of a sale, its duplicate info.
- Pro Business Rules for a Return require that the
customer has a receipt. - Suggestion Include it in the iteration where the
Return Use Case is covered.
14Steps to create a Domain Model
- Identify Candidate Conceptual classes
- Draw them in a Domain Model
- Add associations necessary to record the
relationships that must be retained - Add attributes necessary for information to be
preserved - Apply existing Analysis Patterns
15Apply the Mapmaker Strategy
- Use existing names for things, the vocabulary of
the domain - Exclude irrelevant features
- Do not add things that are not there
16A Common Mistake - Classes as Attributes
- Rule If we do not think of a thing as a number
or text in the real world, then it is probably a
conceptual class. - If it takes up space, then it is likely a
conceptual class. - Examples
- A Store is not an attribute of a Sale
- A Destination is not an attribute of a flight
17Specification or Description Conceptual Classes
- A Class that records information about an item.
- Even if all Instances of the item are sold out,
the description remains. - Avoids duplication of recording the descriptive
information with each instance of the item.
18Description of a Service Example (Flight)
Flight
Date Time Number
Airport
Name
Flies-to
vs.
Flight
Date Time
FlightDesc
Date Time
Airport
Name
Described -by
Describes -flights-to
19Monopoly Concepts (candidates)
Monopoly Game
Player
Piece
Square
Die
Board
20UML Notation Multiple Perspectives
- UML describes raw diagram types, such as class
diagrams. It does not impose a specific method or
process. - UP, the Unified Process, applies raw UML to
defined methodology models. - UML can be used for 3 different perspectives
- Essential describe the real world
- Specifications software abstractions, such as
components and their interfaces - Implementation specific language (Java)