Re:Best Practices for Testing in Java (2019)
by rmdashrfstar on Wednesday September 02, 2020 @02:35AM
(#24350609)
I'm not sure calling the domain layer "anemic" by default is correct, as it's typically a (negative) descriptions of models which are too data-driven instead of behavior-driven. I would suggest an alternative layer structure:
Initiators/Controllers -> Application/Domain/Infrastructure Services -> Domain Models/Business Rules/Invariant Checking
[ Parent
| on HN ]
Re:Best Practices for Testing in Java (2019)
by exabrial on Wednesday September 02, 2020 @08:49AM
(#24352670)
We've thought about that; the style I've described is very non-OO. It is easy to teach though and it makes unit testing a breeze.
I like the architecture you've described. I think we arrived at where did because it's a natural for when using a DI container, which manages state and transaction groups for you.