Setters •All Parameters Are Injected in the Constructor •Do Not Store References to Mutable Objects (Private Scalars Okay) •Throw Exceptions If Something Is Wrong •Functions that Appear to Modify Should Return a New Object •Declare the Class Final so it can’t be Overridden (probably) Value Objects
Objects •Part of the Core Domain •Usually Created in an Aggregate •Probably Want To Persist Them •Passed to Event Bus (Application Layer) •Listeners are Application Services •Used To Cross Bounded Contexts •Do Not Contain Entities (Only Value Objects)