DEV Community

Discussion on: Do I really need to create classes in two places?

Collapse
thomasjunkos profile image
Thomas Junkツ

My concern here is maintainability. If I update the API or make a change to the underlying models, I have to do this in two places. While I don't have a big application, I still feel as though I am doing this wrong.

Let's face it from the other direction:

Say, you want to solve this problem once and for all and write your backendcode once and develop an abstraction framework to do the rest.
Say you want to make changes to your model which aren't reflected in your framework, you have to make changes in the model and in your framework. Or think about errors in your framework, which lead to strange behaviour not introduced without your framework.

I would argue, that on the long run, it is cheaper to live with some doubling of concepts and code, that to develop a solution to prevent this - including costs for teaching new team members your "magic".