...
Questions (provides a list of issues)
- Should module be decoupled from each other to the extent that they can possibly have their own database? Implications: no foreign key relationship, possible independent hosting and deployment, lack of transaction, cannot do joins?
- Which layers in a module are accessible to another module at the compile time?
- Entities in one module would refer to entities in another module. In such a case should there be hibernate based relationship between entities?
- Which module hosts the page which displays data from two functional modules?
- In case of One-to-One/One-to-Many/Many-to-One (logical) relationships between entities how to decide who refers to whom? How to avoid cyclic relationships between modules?
- If there is no domain relationship between entities in different modules. A parent entity (in module A) has child entity (in module B), when the child entity is created, how does parent entity get the id for it?
- When entities are updated in different modules, would transaction be taken care? Would it be the case when we use OSGI?
- If there is a requirement which involves joining data across different modules. Where should this code lie? How would we do this using HQL?
- If we partition modules only at the service layer (below presentation layer), we would have a monolithic website. Is that a problem?
- If and when we need it, what should be the caching strategy for reference data?
Guidelines
A functional module's service/domain-layer wants to read the data owned by another functional module.