Details
Description
Lombok could help us to not only reduce a large amount of code, but also to fix a couple of inconsistencies in the code base:
- getters/setters with non-standard characters (e. g. underscores)
- getters/setters with typos
The layered architecture of Fineract requires mapping between REST DTO classes and internal entity classes. The current code base contains various strategies to achieve this:
- private functions
- static functions
- mapping classes
All of these approaches are very manual (and error prone) and difficult to maintain. Mapstruct can help here:
- throw errors at compile time (missing new attributes, type changes etc.)
- one common concept (easier to understand)
- reduce manually maintained code and replace mostly generated code
Challenges:
- maintain immutability (especially in DTO classes)
- should we fluent builder pattern?
- backwards compatibility
- these improvements cannot be introduced as one pull request, but have to be split up at least at the “module” level (clients, loans, accounts etc.). This would result in approximately 30 pull requests; if we split up Lombok and Mapstruct then it would be 30 PRs each (=60); we would need this fine grained approach to make a transition as painless as possible
- some classes are maybe beyond repair (e. g. Loan.java with 6000 lines of code, the smaller part getters/setters and a long list of utility/business logic functions)
Attachments
Issue Links
- is a child of
-
FINERACT-1874 Release Apache Fineract 1.9.0
- In Progress