Use cases for modularity and extensibility

When we talk about modularity, in some cases we are also thinking about extensibility. Below are some use cases that span these concepts and that could be addressed in various ways:

Use Case 1 - Clean encapsulation of a functional area

I discussed this use case in my previous message related to Vivek and Keith's thread on the service facade refactoring Keith has been doing. The core idea here being that modules should allow a clean separation (loose coupling) between modules. This also includes compile time encapsulation (not being able to use internal classes/methods in a module) and dependency management. Basic dependency management is compile time (what version of other libraries do I need to build) and ideally run time (what versions of other libraries do I need to load and run).

Use Case 2 - Adding new generic functionality to Mifos through configuration

Imagine being able to add a new tab to the set of tabs displayed at the top of Mifos that linked to a human resources system. We would want to have some configuration that would be picked up at runtime and tell mifos what tab to add and how to render the contents of the tab. You could imagine that this content could be rendered in a variety of ways including being additional Java/Spring based pages or even being a separate web app. The implementation for the new tab could call Mifos APIs to interact with Mifos or be completely independent of Mifos and just render itself in such a way that it appears as part of Mifos.

Use Case 3 - Extending a given area of functionality in Mifos through configuration

Mifos currently supports two products: loan products and savings products. Imagine that we supported including additional products by configuring Mifos to pick up addition product modules. At run time Mifos would discover which products had been configured and show the UI for managing and displaying each product. If the Savings Product was not listed in configuration, it would not show up in the UI. If someone wanted to create a new insurance product, they would write a new module for insurance that defined insurance products and could create and manage an account associated with an insurance policy. Mifos would detect that a new insurance module was specified to be loaded and would load it and add Insurance Product Management under Loan and Savings product management. In client detail screens, information on each configured account would be displayed.

Use Case 4 - Extending functionality for an existing module

Mifos supports different kinds of loan schedules. Ideally, each type of loan schedule could be broken out as a separate component or module. Adding a new type of loan in addition to flat and declining balance would be a matter of implementing a new module that implemented a service provider interface for loan schedule calculation/management.