Just a quick question about best practice MVC development.
Let's say that I have two controllers (cont1, cont2), each of which uses a separate model, model1 and model2.
all files are complex, models contain dozens of methods.
Let's say I finished developing the first controller, and I'm in the middle of working on the second. I need to create a method in model 2 that will be exactly the same as one of the methods in model1. This is just a tiny method, for example, to get a list of categories.
What is the best approach to work - should I duplicate the method and include it in my model2, or should I get it from model1?
It would be wise to get it from model1, but I don’t know if this will affect the runtime, since it will have to load both models.
I would appreciate some feedback.
thanks to
source
share