Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Data Modelling and Domain Modelling?

By the way - with reference to data modelling I'm referring to logical or conceptual data models - not physical ones.

The question came up during a discussion at work; naturally I leapt to Wikipedia to get some basic definitions in place - hoping that they might clarify the difference - but they didn't...

A conceptual schema or conceptual data model is a map of concepts and their relationships.

Logical Data Modles seem very similar (from this definition):

A logical data model (LDM) in systems engineering is a representation of an organization's data, organized in terms entities and relationships and is independent of any particular data management technology.

Where-as...

A domain model, or Domain Object Model (DOM) in problem solving and software engineering can be thought of as a conceptual model of a system which describes the various entities involved in that system and their relationships.

The differences between domain model vs conceptual data model seems particularly murky.

One of the things which adds to this confusion is that (from what I've seen) a domain model is usually modelled using a UML class diagram - the class entity in a UML class diagram supports methods - our colleague maintains that a domain model must not contain "operations". I can understand domain modellers using a sub-set of a UML class diagram - but isn't it dangerous to assume people will refrain from including "operations" if the tooling they are using supports it?

like image 845
Adrian K Avatar asked Aug 17 '10 23:08

Adrian K


People also ask

What is the difference between data model and domain model?

A domain model is a representation of the organization's data, independent of the way the data is stored in the database, with a domain being the collection of all the objects in that system, while the data model is used in database design and development.

What is meant by domain modelling?

Domain Modeling is a way to describe and model real world entities and the relationships between them, which collectively describe the problem domain space.

What is a domain model called in database modeling?

The domain model is also called conceptual model, domain object model or analysis object model.

What are the three types of data modeling?

The three primary data model types are relational, dimensional, and entity-relationship (E-R).


2 Answers

Good question, the problem is that it depends on the definion of the terms, I think they differ slightly based on the sources. I would agree with previous answer - domain models are for describing the problem domain, at least the part you need to develop a solution. You describe all the various entities, their relations and their behaviour. I think that this is also the view from the Domain Driven design perspective. Data models on the other hand are used for describing the data in your system and relations or associations between them. This is useful for describing what needs to be stored in the system and might also give hints how. I think data models would apply for your "no operations" rule, because they are not important in this respect.

like image 171
Gabriel Ščerbák Avatar answered Nov 10 '22 05:11

Gabriel Ščerbák


Domain Modeling (in the sense of Domain Driven Design) is all about modelling the behavior of the domain concepts, while Data Modeling focuses mainly on... data.

It doesn't mean that Domain Modeling ignores data structures. It just puts more emphasis on operations and how they can be uses to solve problems.

I don't know much about other than Domain Driven Design domain modelling techniques, but DDD involves (apart from modeling data and behavior) also explicit modelling of consistency boundaries (aggregates).

like image 43
Szymon Pobiega Avatar answered Nov 10 '22 04:11

Szymon Pobiega