Packages organisation with MVC design pattern
- by Oltarus
I have been programming quite a lot now and still can't decide which of these packages hierachies was the best:
package1
Class1Controller
Class1Model
Class1View
package2
Class2Controller
Class2Model
Class2View
or
controller
Class1Controller
Class2Contoller
model
Class1Model
Class2Model
view
Class1View
Class2View
In other words, is it better to apply the MVC design pattern to classes or to packages? Is there any reason to choose one over the other?
My question is language-agnostic, but I'm mostly a Java programmer, if it does any difference.