Aug 31, 2018 · 1 min read
I have done that, and refactored them all out.
Why:
- Data in the trait was too simple, but was made complicated by splitting it,
- Data in the trait was too complicated, it should not have been there at all (but in the repository or service even),
- I used it for LifeCycleEvents, replaced them for interfaces (eq Blameable, Logable, …) and event listeners,
- I had some weird issues before (SF3) with d:s:u — force always updating my trait fields.
- I can throw them all away and regenerate them without requiring a change in order to receive the same state.
With a trait you can `extend` a object in order to create more abstract solutions. An Entity should, in my opinion, be considered as a DTO.
