I couldn’t find a satisfying answer so here is the question;
I am developing an HTML5-Websocket based application and I will be porting it to Mobile too.
The problem is that 2/3 of my features won’t be in the mobile version and features are tightly integrated into HTML with JS.
If I can elegantly separate those 1/3 features, I will be DRY. However I couldn’t find an easy solution for this.
For example, I have a function which gets the user object from node and process it in a function. For mobile, I will need the same flow but except 2/3 of the flow. I can create different functions for them and put them into the different files but this will bring a maintenance nightmare, since I will need to create tens of extra functions for even simple features.
Is there any good framework or way of doing these things out there for this job?
I would recommend a denoramlized approach for this situation. On the surface you think it’ll be a maintenance nightmare because you’ll be duplicating some code, but deeper down the maintenance nightmare may surface from having your shared code try to handle too much. Code abstraction and isolation in this case might be the way to go, and it will speed up QA.