Normally, they are immutable and their methods (when available) should provide a "Side-Effect-Free" behavior (not changing the object state). For now, keep in mind that " Value Objects" do not need to be treated as unique. Let's try to make it clear in the class model (further). It is hard to portray all the nuances of it in a post as short as this one. Why? Well, if you are not able to identify them, you tend to model everything as an " Entity". Your capacity to identify Domain concepts and model them as " Value Objects" is one of the most powerful tools you can use in order to succeed in creating DDD models. Mutability and unique identity are the two main characteristics entities have. An Entity is a unique thing and is capable of being changed continuously over a long period of time." "We design a domain concept as an Entity when we care about its individuality, when distinguishing if from all objects in a system is a mandatory constraint. Vernon's book, "Implementing Domain Driven Design", has an excellent definition for Entity: However, for DDD, the meaning of Entity is very clear. It is possible to find many definitions for "Entity" in literature. Let's take a look in some core concepts that you must know when modeling a Domain Class Model.
A solid understanding of UML is very useful too.
DOMAIN DRIVEN DESIGN AGGREGATE SOFTWARE
For example, I like to use concepts from, GRASP (General Responsibility Assignment Software patterns - Craig Larman) and GOF patterns when I am creating my models. Concepts for Creating Domain Class Models in a DDD Fashionįirst of all, I would like to state here that any OOD (Object Oriented Design) know-how is useful for constructing Domain Class Models, it doesn't matter if you are a DDD enthusiast or not. I thought it would be a good thing if I worked on the contexts of the "Product Catalog Website" (the Core Subdomain) and a Support Subdomain (my choice was the "Orders" one).
As I said before, some of these contexts can even be supported by off-the-shelf applications, as the intent here is not to develop the whole solution basically from scratch. I am going to pick only two Bounded Contexts as examples for modeling. Picture 1: A DDD approach to the e-Commerce Domain