Which approach is the most maintainable?
Posted
by
2rs2ts
on Programmers
See other posts from Programmers
or by 2rs2ts
Published on 2013-07-03T01:29:00Z
Indexed on
2013/07/03
5:18 UTC
Read the original article
Hit count: 258
When creating a product which will inherently suffer from regression due to OS updates, which of these is the preferable approach when trying to reduce maintenance cost and the likelihood of needing refactoring, when considering the task of interpreting system state and settings for a lay user?
- Delegate the responsibility of interpreting the results of inspecting the system to the modules which perform these tasks, or,
- Separate the concerns of interpretation and inspection into two modules?
The first obviously creates a blob in which a lot of code would be verbose, redundant, and hard to grok; the second creates a strong coupling in which the interpretation module essentially has to know what it expects from inspection routines and will have to adapt to changes to the OS just as much as the inspection will.
I would normally choose the second option for the separation of concerns, foreseeing the possibility that inspection routines could be re-used, but a developer updating the product to deal with a new OS feature or something would have to not only write an inspection routine but also write an interpretation routine and link the two correctly - and it gets worse for a developer who has to change which inspection routines are used to get a certain system setting, or worse yet, has to fix an inspection routine which broke after an OS patch.
I wonder, is it better to have to patch one package a lot or two packages, each somewhat less so?
© Programmers or respective owner