Code De-Duplication
As part of Phase IV project, SCSB code has been de-duplicated. Following strategy was adapted for the de-duplication.
Created a common library: Common Library added to the project to facilitate the removal of Entity Classes and Other Common Classes which existed with same name and functionality across multiple projects. These classes were removed from the respective projects and one copy of the same kept in Common Library. Constants with same name and value which were present in multiple projects also removed and kept in Common Constants File in Common Library.
Entity Class Abstraction: Entity classes abstracted with AbstractEntity class with “id” as the primary key. All Entity Classes implement AbstractEntity class and value for primary key overridden. Entity Classes with composite primary key abstracted and kept in common Library, with common fields used across project.
Removed Duplicated Code: Added AbstractController class created for each project. All Controller classes in the project extend this AbstractController Class. This removed the duplicated code in Controller Classes. Created Util Classes created and is used to have common methods and Code repeated across classes to avoid repetition . Same set of code present across different classes and same class were removed and moved to newly created methods.