Architecture Overview
Here's a brief overview of our current system architecture:
- Mifos (Web) Application
- Presentation layer: Freemarker, Spring MVC; in transition from JSP and Apache Struts
- Business Logic: Spring Framework and custom Java code
- Data access layer: Hibernate Object Relational Mapper
- Web server: Apache Tomcat
- Database layer: MySQL
- Build system - Maven, JUnit, TestNG, Selenium
- Modularity (responsibility of a module, inter-module communication) (under discussion)
Architectural choices - why were these tools chosen? Pros, cons.
In general, tools and libraries we choose:
- are FLOSS
- work well with each other
- are cross-platform
- are stable: well-tested, well-supported, have large active communities
Application
- Spring Framework
- pros: provides a good framework for modular applications, allowing decomposition and separate testing. Good tools for web application UI patterns (Spring MVC), web app security (Spring Security), and integrates cleanly with Hibernate (Spring Transactions). Many users. Strong community. Strong corporate backing.
- Freemarker
- pros: Works well with Spring MVC (ex: Spring provides Freemarker macros), enforces presentation and business logic separation, good templating and page composition, very good error messages for debugging (compared to Velocity), and easy to program web pages with it.
- cons: Small community.
- Hibernate
- pros: Selected by the original writers of Mifos, we wanted to maintain code compatibility. Clean integration with Spring.
- Tomcat
- pros: highly reliable and scalable web application container. Good Spring Framework compatibility. Faster startup time and more lightweight than JBoss.
- MySQL
- pros: Selected by the original writers of Mifos. Works well with Hibernate.
Build system / Automated tests
- Maven
- pros: standardized build system with many plugin modules, less code to write compared with a custom build system like ant. Standard dependency checking and artifact (jar and war) management. Many extant useful plugins. Useful/extensive plugin development framework.
- cons: slow. Complex. Declarative (doesn't map well to procedural parts of builds).
- JUnit
- pros: selected by the original writers of Mifos for automated tests. Works.
- TestNG
- pros: flexible framework for integration and acceptance testing. Allows for running suites of tests with different set up and tear down.
- Selenium
- pros: good modeling of user behavior for acceptance testing.
- cons: Slow. Many things are tested at once.
More
We mostly use only one framework/library for each functional need. For example: only MySQL is used as a relational database. This makes it easier for developers to learn the system. On the other hand, it limits capabilities (ie: we don't have NoSQL databases). Sometimes this rule is broken, as is the case with JUnit and TestNG: there isn't a great reason for Mifos using both test frameworks.