Monolithic systems have the problem of coupling. Cognizant of this fact, we want to move to a modular system.
What is a Mifos module?
Mifos modules should be carved out based on functional cohesion. There can be a two kinds of modules functional and cross-functional. (For list of modules please check here.)
All modules ...
- would be identifiable in the source code as a maven module.
Functional modules...
- would encapsulate the data and behavior for a part of the system.
Cross functional modules...
- can be used as libraries by other modules.
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.