In my new assignment, I have inherited this legacy chunk, which I had to redesign and refactor. The scope was initially restricted to the Presentation tier, which happened to be the bulkiest of all. During the course of analysis, it was realised that the application was built over a period of time with various modules using different classes to depict the same model.
These models are actually used to bind information into both view and db tier (Code reuse somebody?). The binding logic is a complex routine and was stabilised after multiple rounds of testing. Now I have this dilema of whether to retain these semantically duplicate but syntactically inconsistent models or to start with a clean slate. The second option would mean revamping the whole application and the schedules don't allow for that, but I have a bad inkling. Can you guys share some inside thoughts (pros & cons) and any unforeseen problems I may face in future.
Giving the following analogy which closely reflects the state of affairs.
- To start with, there is a user details module, which is more like a getter. The view gets rendered using the TO (transfer object) structure provided for this. Say 'Class UserInfo'
- Later a new requirement came up and a provision to edit the details was provided. Whoever coded it decided that they would use a new TO structure and came up with their own 'Class UserEditInfo'. Which is kind of super set of earlier class.
- Finally at a different point of time, a new enhancement to keep track of user transactions was made and guess what, a new 'Class UserDetails' was created.
All the above have bindings that map them to external tier and JSP logic, trying to eliminate two of the models would cause repurcussions in the whole Business tier (which is bad). To make things worse, the good old cowboys are nolonger around to help us out. Hope this helps