Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Domain Model and Object Model

  • What is Domain Model?
  • What is Object Model?

Are Domain Model and Object Model the same thing? What is the difference between these two? Please explain with simple example. I'm new in this concepts. I searched a lot in Google. But I couldn't get any simple explanation and example.

like image 764
Asish AP Avatar asked Jan 04 '13 04:01

Asish AP


People also ask

Is domain model and object model same?

A Domain Model is an Object Model describing the problem domain. They include the domain objects in the problem domain and describe the attributes, behavior and relationships between them.

What is object domain model?

Describes the specification and generation of a domain object model in Java™, based on the Application Data Model. The domain object model is based on the Decision Optimization Center Application Data Model.

What is the difference between domain and 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 domain and object?

A domain object is an entity in the domain layer of your application, eg. an Address class. "Model" means the same thing - an entity in the "Domain Model". A POCO (plain old CLR object) is an object that has no behaviour (methods) defined, and only contains data (properties).


Video Answer


2 Answers

An Object Model of a system is a collection of classes and objects describing the relationships between them and the properties and methods contained within, in terms of the Object Oriented principles : Abstraction, Encapsulation, Inheritance and Polymorphism.

A Domain Model is an Object Model describing the problem domain. They include the domain objects in the problem domain and describe the attributes, behavior and relationships between them.

like image 169
stamhaney Avatar answered Oct 13 '22 04:10

stamhaney


If you talking about theses concepts according to DDD (Domain Driven Design), I don't agree with neigher of the preceding answers. As the author pointed out in his book,

A domain model does not have to be an object model. There are MODEL-DRIVEN DESIGNS implemented in Prolog, for example, with a model made up of logical rules and facts.

So a Domain Model is a representation of you domain rules based on any paradigm, not necessarly should it be Object, it could be any other paradigm, but the most important about it, is that it must make domain concepts and rules clear and separated from other technical aspects.

In conclusion, we can say that an Object Model is one of the representation forms of a Domain Model

like image 32
A77 Avatar answered Oct 13 '22 05:10

A77