slices, clean architecture, runtime dependencies (inversion & || externalization) example
Classified Ads is sample domain. First context is Realestate. So:
- com.example.classifieds.realestate.campaign
- com.example.classifieds.realestate.advertisement
- com.example.classifieds.realestate.exposure
Domain:
- com.example.classifieds.realestate
Persistence:
- com.example.classifieds.realestate.repositories
Use Cases:
- com.example.classifieds.realestate.commands
Interactors:
- com.example.classifieds.realestate.handlers
- Repositories in the domain are interfaces
- Handlers in use cases are interfaces
- Persistence implements domain repositories
- Interactors are implementation of use cases' handlers; depend on domain but not on persistence
- Each detail (implementation) can be considered as runtime dependency for higher level
- Infrastructure can be considered as orbit with satellites
- Layers are glued with help of satellites into application