For this question, I'll give an example module to facilitate the discussion, Let's say the module is a calculation engine, It currently servers its purpose for its current audience. The requirement is to clone the same engine but with some tweaking for an entirely new audience. Given that, these are Considerations/Factors that will affect the design solution:
- User expects that the current engine will remain unchanged, because its not part of the requirement (note the new engine is for some new audience, and does not affect the users of the current engine).
- In addition to #1, the expectation is no regression testing for the code base of the current engine since no changes are introduced.
- Just to drive the point, refactoring the current engine to make it flexible to address both current and new engines, will not be an option given that will not satisfy the 2 points above.
- We can expect in the future that there will be exclusive changes for each engine, ie. change is applicable only to the new engine hence should not affect the current.
- Tight deadline.
However, I am still conflicted, since:
- It will inherently be a copy-paste solution.
- Duplicate code.
- Maintenance issue for code changes that should be common to both.
- Does not address extension issue, ie. a third engine, and so forth could all be possible.
Is the compromise acceptable in this situation, given the user expectations highlighted above? And followup question, is there something I can add to the solution that will address the conflicting issues but at the same time satisfy the user requirements?