What Is A Domain Model?
What Is A Domain Model?
A domain model captures the most important types of objects in the context of the business. The domain model represents the things that exist or events that transpire in the business environment. I. Jacobsen
Association
+employee
1..*
Company
name
+employer
0..1
+owner
Role
<<Rule>> If a person is not employed by a company then they do not have a car.
Car
type name
Domain class
Domain classes?
Each domain class denotes a type of object. It is a descriptor for a set of things that share common features. Classes can be:o Business objects - represent things that are manipulated in the business e.g. Order. o Real world objects things that the business keeps track of e.g. Contact, Site. o Events that transpire - e.g. sale and payment.
A domain class has attributes and associations with other classes (discussed below). It is important that a domain class is given a good description
Identifying attributes ?
A domain class sounds like an attribute if: o It relies on an associated class for its identity e.g. order number class associated to an order class. The order number sounds suspiciously like an attribute of order. o It is a simple data type e.g. order number is a simple integer. Now it really sounds like an attribute!
Example
Router Name 1 * N/W Service FreePort Location * 1 Name DedicatedTo ValidIPRange ConnectivityType
* FreePlug Location * 1 1 H/W Warranty Maintainer StartDate EndDate * 0..1 * Machine SerialNumber HostName IPAddress Administrator SwitchPlug Memory LocationInRack Maintainer Warranty 0..1 * FreeSlot LocationInRack 1 1 Location Room Building X Y * 1 Switch/Hub Name * RackTypes Dimensions SlotNumber MachineDimensions
0..1
Rack Name
* *
Mario Rack
19" Rack
Hard Disk
Monitor
Graphics Card
Sound Card
DVD
CD
CPU
Router Name
* Switch/Hub Name * 1 * Machine SerialNumber HostName IPAddress Administrator SwitchPlug Memory LocationInRack Maintainer Warranty 0..1
0..1
Rack Name
Mario Rack
19" Rack
References
Business Modelling with UML Penker Analysis patterns Fowler
These books provide patterns for domain models.