Skip to content
This repository was archived by the owner on Sep 27, 2025. It is now read-only.
This repository was archived by the owner on Sep 27, 2025. It is now read-only.

Refactor services and mappers as services and repositories #97

Description

@carltonwhitehead

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions