Technologist Career Management System
The Domain Entity Model
This is the second installment of the Modern Developer’s Showcase Application: TCMS.
The first Installment defined the project and revealed the high level architecture for the Services and MVC 4 Application systems.
You can get caught up from the
Showcase Project Blog
This installment will detail the Domain Driven Design (DDD) Entity Model and its Object Relational Mappings (ORM) using Entity Framework 5.
The Business Domain Model
The Business Domain is created as Domain Entities and Value Objects.
What is a Domain Entity?
In Domain Driven Design
… An Entity is a Software Object
…… That has an Identity and Provides Value as a Parent or a Child Entity
What is a Value Object?
A Value Object is a Software Object
… that has No Identity
…… And Provides Value Only when it Belongs to an Entity: Parent or Child
An Entity can Serve as a Parent and as a Child within the Business Domain
Domain Entities and Value Objects
The Highest Level Entity Composite, as a DTO, for a Vehicle is CAR. The CAR holds other Entity Composite DTOs:
- The ENGINE DTO
- The BODY DTO
- The CHASSIS DTO
- The INTERIOR DTO
- The TIRES DTO
A TIRE is an Aggregate Value Object. It holds all the attributes as Properties about the Single Tire object.
The TIRES Entity Object DTO holds all the attributes for the collection of all TIRE Value Objects and the Collection of four TIRE Aggregate Value Objects as a List property.
The TIRE aggregate has no value unto itself. It only has value when it is a member of a List Property in the TIRES Composite object. It tells the Entity Composite CAR everything about the single TIRE Value Object.
The list of tires only has value when it is part of the TIRES Composite.
The TIRES Composite Is an Entity for the Tire Value Object. It has an Identity as a collection of TIRE but has no Domain Identity as its true Domain value only exists as an Aggregate Composite in the CAR Entity Composite.
Each TIRE can be destroyed and recreated without any effect to the CAR Composite
… That is the Litmus Test for a Value Object
…… Will its Destruction and Recreation Adversely effect on the Highest Level Entity
Likewise the TIRES Composite can be destroyed and recreated as well without any effect on the ability for the CAR Entity Composite to perform but the CAR Composite cannot perform without the TIRES Entity Composite of the TIRE Value Objects.
The TIRES Composite DTO is a Value Object for the Domain and an Entity Object Container for the Tire Value Object collection.
CAR is the Identity Entity Business Object: VEHICLE
The Domain Entity Model for TCMS
The TCMS Entity Model displays the relationships between the Entities and the Value Objects.
The Domain Entities are BLUE and the Domain Value Objects are WHITE:
In this Model there are Four Domain Entities:
-
The Assessment Entity – The Highest Level Entity and has Identity as the Composite Entity for all other Entities.
Assessment Entity consumes the Dependencies: People, Skills and Questions Entity’s Value Objects information
-
The People Entity – This Entity has Identity as a Collection of People.
This Entity is a Child Entity Dependency for the Assessment entity.
It provides Value Object detail information for the Assessment Entity
-
The Skills Entity – The Skills Entity has Identity as a Collection of Skills.
This Entity is a Child Entity Dependency for the Assessment Entity.
It provides the information details for the Skills being assessed.
The Skills Entity shares a Value Object, Skills Rating, with its Parent Entity Assessment.
In Assessment the Skills Rating Shared Value Object is the assessed results of the assessment. In Skills it is the baseline average expected rating for a 50 percentile assessment
-
The Questions Entity – This Entity has Identity as a Collection of Questions and Answers.
This Entity is a Child Entity for the Assessment and the Skills Entities.
It associates Questions and Answers for the Skills Entity and the Assessment Entity uses the Questions Entity to create the Assessment Questions Collection
The TCMS Entity Framework Domain Model
The TCMS Entity Framework Domain Model displays the relationships between the Entities and the Value Objects as an Object Relational Mapping (ORM) of the Domain Driven Design (DDD).
The InfoServices.DataDAL Data Abstraction Object Relationship Mapping (ORM) Layer
The Domain Entities are represented as groups of separate colored Class Objects as relational objects to the Entity ORM:
-
Person – Maroon Objects
-
Assessment – Salmon Objects
-
Skill – Rosy Brown Objects
-
Question – Dark Golden Rod
Stay Tuned for the Next Installment in the Modern Developer Showcase Solution: TCMS
… The InfoServices.DataOps Layer
Latest posts by Brad Huett (see all)
- DevOps: A Bridge to Your DevOps Culture - March 25, 2016
- Embracing Test Driven Development (TDD) - March 25, 2016
- DevOps: Delivering Agile Projects - March 25, 2016