Вы находитесь на странице: 1из 13

Domain model: visualizing concepts

Chapter 10 Applying UML and Patterns -Craig Larman

Domain Model Relationships


Business Model
Classes, attributes, associations Domain objects Elaboration on some terms

Domain Model

Use Case Model Requirements Design

Glossary

Interaction Diagrams

A 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. It may show:

concepts associations between concepts attributes of concepts

Domain Model UML Notation

Illustrated using a set of class diagrams for which no operations are defined.
A Domain Model is a description of things in the real world. A Domain Model is not a description of the software design. A concept is an idea, thing, or object.

A Domain Model is not a Software Artifact


A Conceptual class:
Sale Date Time

Software Artifacts:
Sales Database

vs.

Sale Date Time Print()


5

Identify Conceptual Classes by 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.

Steps 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
7

Apply the Mapmaker Strategy

Use existing names for things, the vocabulary of the domain Exclude irrelevant features Do not add things that are not there

A 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

Specification 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.

10

Description of a Service Example (Flight)


Flight Date Time Number
Flight Date Time Airport Name

Flies-to

vs.
Flight Desc
Described -by

Airport
Describes -flights-to

Date Time

Name

11

Monopoly Concepts (candidates)


Monopoly Game Player Piece

Die

Board

Square

12

The NextGen POS (partial) Domain Model

13

Вам также может понравиться