0

Regarding to Craig Larmans work on designing Domain models it is valid to have classes, which are attributeless. They have behavioral roles. When defining classes as entities and value objects regarding to work of Eric Evans I cannot decide whether the attributeless classes should be a value object or not or what they should be. How could they be implemented?

1 Answers1

0

An "attributeless" class can be also called a stateless class. I think it is not either a value object or entity. I can't think about any example of a domain where something is stateless and still needs to be modeled. Domain model is after all a description of things we are dealing with in our domain.

And in real world domains nothing is stateless. Everything can be described. ex: a user have a name and address, a car have a max speed ...

The stateless class will have only behavior so it can be a domain service or maybe the same behavior can belong to other domain models. It all depends on the business.

Mohamed Bouallegue
  • 1,334
  • 15
  • 19