M1 vs. M2
There are various folders containing the java source files developed in Milestone 1 (M1) and being developed in Milestone 2(M2). The 2 milestones are following 2 different approaches in development.
Further, in Milestone 2 - hereafter M2 code - there are multiple iterations, typically every two weeks. Also, in M2 there are jUnit tests that should cover all business objects. The aim is to migrate to M2 style code throughout, so the developer is warned to check with the listserv before developing on top of soon to be deprecated code. Generally speaking, code that calls upon handlers and makes calls to separate DAO (data action objects) or that lacks the ending BO on objects is M1 code.
Again, M1 code is soon to be deprecated (note made May 2006).
Here is how you can tell the difference between the design approaches:
M1 - Taking the example of an account module - The business logic is present inside the business processors specific to the module like account(hence there is an account business processor), the attributes are present in value objects(account value object). To perform a specific functionality like create/update etc the value object is populated with the relevant information and passed to the relavant method in the account business processor. The business processor performs business logic using these value objects and then invokes the corresponding Dao(account dao) passing this value object. The value object is saved using hibernate in the Dao.
M2 - Taking the example of an account module - Accounts object contain the attributes relevant to them and also have the behavior on these attributes. It also contains the relavant associations to other account objects. To perform a specific functionality, the account object gets retrieved through hibernate and then the corresponding functionality is invoked on the account object. The account object performs the specific functionality and invokes the account persistence service passing itself to be saved in the database.
The various directories under which the code for M1 & M2 are present
src/org/mifos/application
This directory contains the different application modules that are implemented in MIFOS, the source code for M1 and M2 are present under this directory under the respective modules.
src/org/mifos/application/accounts
This directory contains the folders where-in the source code(M1 & M2) for the accounts module is present. The accounts folder also contains savings, loan and financial transaction classes.
src/org/mifos/application/accounts/struts
This directory contains the folders which contain code for struts related classes for the account module in M1 & M2
src/org/mifos/application/accounts/struts/action
This folder contains the struts action classes for handling the account functionality. Struts action classes written in M1 and M2 are present in this folder. The action classes written in M1 would have their class extending from MifosBaseAction. The action classes written in M2 would have their class extending from BaseAction.
src/org/mifos/application/accounts/struts/actionforms
This folder contains the struts action forms for the account module written in M1 & M2.
src/org/mifos/application/accounts/business
This folder contains the various account related objects being used in M2.
src/org/mifos/application/accounts/business/service
This folder contains the account business service being used in M2 .
src/org/mifos/application/accounts/business/handlers
This folder contains the account related business processors used in M1. The business processor contains the business logic to handle account functionality developed during M1.
src/org/mifos/application/accounts/persistence
This folder contains the persistent classes being used in M2. The persistent classes contain the hibernate code for retrival , saving of account objects being used in M2.
src/org/mifos/application/accounts/persistence/service
This folder contains the account persistent service methods being used in M2.
src/org/mifos/application/accounts/dao
This folder contains the account related dao used in M1. The dao contain the hibernate code for retrival, saving of account objects developed during M1.
src/org/mifos/application/accounts/util/valueobjects
This folder contains the value objects(containing data) for accounts used in M1.
src/org/mifos/application/accounts/exceptions
This folder contains the account exception classes being used in M1 & M2.
src/org/mifos/application/accounts/util/helpers
This folder contains helper classes used for accounts in M1 & M2.
src/org/mifos/application/accounts/util/resources
This folder contains resource file used for accounts in M1 & M2.
src/org/mifos/application/accounts/loan
This directory has the same structure as defined for accounts, this directory contains classes written in M1 and M2 to handle loan functionality
src/org/mifos/application/accounts/savings
This directory contains classes written in M2 to handle savings functionality
src/org/mifos/application/accounts/financial
This directory contains classes written in M2 to handle accounting functionality
src/org/mifos/application/bulkentry
This directory contains folders which have classes written in M2 to handle bulkentry functionality
src/org/mifos/application/collectionsheet
This directory contains folders which have classes written in M2 to handle collectionsheet functionality
Other modules defined under src/org/mifos/application contain folders having classes written in M1 and M2, the structure is the same as defined above for accounts module
src/org/mifos/framework/business
This folder contains the framework classes written for M2
src/org/mifos/framework/business/service
This folder contains the framework classes written for M2
src/org/mifos/framework/persistence
This folder contains the framework classes written for M2
src/org/mifos/framework/business/handlers
This folder contains the framework classes written for M1
src/org/mifos/framework/business/util/helpers
This folder contains the framework classes written for M1
src/org/mifos/framework/dao
This folder contains the framework classes written for M1
src/org/mifos/framework/struts
This folder contains the framework classes written for M1 & M2
src/org/mifos/framework/exceptions
This folder contains the framework classes written for M1 & M2
src/org/mifos/framework/hibernate
This folder contains the framework classes written for M1 & M2
src/org/mifos/framework/security
This folder contains the framework classes written for M1 & M2
src/org/mifos/framework/components
This folder contains the component classes written for M1 & M2
The test directory under root contains the unit test casses written in M2, it follows the directory structure like src.