What is the difference between a domain model and a data model?
A domain model is generally implemented as an object model within a layer that uses a lower-level layer for persistence and "publishes" an API to a higher-level layer to gain access to the data and behavior of the model. In the Unified Modeling Language (UML), a class diagram is used to represent the domain model.
Domain model and domain diagram do not exist in UML, so all depends on the definition you use.
Domain models are useful during the requirements analysis phase to identify the entity classes in the Entity-Control-Boundary architecture. Domain models are closely related to the Entity-Relationship models used by database designers.
The Domain Model is an object model of the domain that incorporates both behavior and data. In the example of the e-commerce app, we need to deal with the domain logic of customers who want to buy products and return them if they want.
A datamodel is a design model that only describes data and it's relations. The model contains entities, but they are described in terms of what data they own not how they act on this data or what their responsibilities are.
An domain model on the other hand, is a conceptual model used in analysis of a problem domain. It describes the domain in terms of entities that have relations, data and behaviour. It describes the responsibilities of those entities as relevant for understanding the problem domain.
BTW an excelent and very short introduction to UML is:
UML Distilled: A Brief Guide to the Standard Object Modeling Language
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With