DDD 中实体类型的设计往往被错误的导向了与数据库有关的 Scheme Design。 > Because of the prevailing approaches to software development that place > importance on the database, instead of designing domain concepts with rich > behaviors, developers might think primarily about the attributes (columns) > and associations (foreign keys) of the data. 这种以数据库范式为导向的设计思路导致 domain models 中几乎每一个概念都以 entity 的方式被编码为仅有 `getter` 和 `setter` 的类型,可是显然 Domain driven design 所追求的 entities 不应该仅仅具有 property accessors。 > An entity is a unique thing and is capable of being changed continuously over > a long period of time. Changes may be so extensive that the object might seem > much different from what it once was. And yes, it is the same object by identity. 常见的 *Anemia model (贫血的模型)* 很多时候就是来自于这样的设计。例如,书中第一章所给出的 Customer 的例子就是很【贫血】的: private void saveCustomer( String customerId, String customerFirstName, String customerLastName, String ...