Tuesday, December 25, 2018

How DDD and ORMs are related?


How DDD and ORMs are related?
How ORM support the DDD?
How ORM, DDD and Code First Migrations are related to each other?

According to DDD, Domain Model is core to the EA.

Domain Model should drive the Database Schema.

Latest ORMs support these phenomena by supporting the Code First Migrations.

C# Language also supports the Data Annotations to decorate the Domain Model with elements those help in translating Domain Model to the Database Schema

 C# Language also supports the Default Conventions, Data Annotations and Fluent APIs to specify the Database Schema elements in the Domain Model.

It is not primary job of ORM to update the Database Schema.

Primary job of ORM is, at runtime, to map Table Data to the Objects and vice versa. (OR Data Mapping)

Secondary job of ORM is to map Object Structure to the Database Schema and vice versa. (OR Structure Mapping/ OR Schema Mapping)

No comments:

Post a Comment