I write in java and try using DDD.
- I have domain model with interface for repository, repository has interface where is implemented in infrastructure layer (IoC).
- I would like that only aggregation roots class and interfaces had package scope public. Entity, domain service, VO should had package scope private.
App schema (Interfaces is controllers, GUI etc.)
My question is:
- How save data to database from aggregation root without getters. I would like have only clean buissnes behavior. Maybe my aggregation root should create DTO object?(but is smell)
- Factory should be in domain package, application or should have interface in domain package?