You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mappers having references to services is a clue that they're really acting as repositories. If they were truly adapters, they'd take pure layer-appropriate arguments and return a different-layer result.
As they are now, the responsibility for loading data is spread around services, mappers, and constraints.
Consolidate the loading and saving of records into repositories.
Services should call the repositories to retrieve domain objects, perform any mutations, invoke constraints for validation, and call the repositories to store domain objects.
Constraints should chiefly concern themselves with performing validation against domain objects. There are some constraints which apply to relational data (mutating supporting entities like Policy for Events with Lifecycle.FINAL, etc) which will require a repository call to carry out.
The text was updated successfully, but these errors were encountered:
Mappers having references to services is a clue that they're really acting as repositories. If they were truly adapters, they'd take pure layer-appropriate arguments and return a different-layer result.
As they are now, the responsibility for loading data is spread around services, mappers, and constraints.
Consolidate the loading and saving of records into repositories.
Services should call the repositories to retrieve domain objects, perform any mutations, invoke constraints for validation, and call the repositories to store domain objects.
Constraints should chiefly concern themselves with performing validation against domain objects. There are some constraints which apply to relational data (mutating supporting entities like Policy for Events with Lifecycle.FINAL, etc) which will require a repository call to carry out.
The text was updated successfully, but these errors were encountered: