I am trying to apply DDD to the design of a Release Management system.
Project: The project/product/system.
ProjectEnvironment: The environments (Test, Staging, Prod) that exist for this project. Each project has its own defined environments.
ProjectVersion: A specific version of the project. This would be associated with a deployment package.
From this I would have
Project be the aggregate root and
ProjectVersion be aggregates of
Project. Neither of these can exist without
I would then only have a
ProjectRepository which would provide persisted
Projects with all the included
ProjectEnvironment aggregates (and consequently can only be accessed through their respective
Should there be a
GetVersionById()method on the
ProductRepositorysounds wrong. But then wouldn't supplying multiple repositories threaten the aggregate boundary?
Should there be a 'ProjectService' which would handle and validate the aggregates using the three repositories? In order to safeguard against invalid data, client code would only be able to reference the 'ProjectService'.