The Model-View-Control paradigm is often used to structure application projects. Now, I am struggling to understand which folder/package layout makes most sense to structure my (largish) java application project. I can come up with two ways that each have essentially the same complexity, but allow for easier changes of different aspects:
A) ‘package-local MVC:‘
- org.comp.fooA |-fooAModel.java |-fooAView.java |-fooAControl.java - org.comp.fooB |-fooBModel.java |-fooBView.java |-fooBControl.javaa
In this way, each feature is enclosed nicely in its own package, making extension of the individual Funcitionality easy, but de-centralizes the gui-components into a lot of different packages. Larger changes to the gui would be inconvenient because there is no central coherent definition.
B) ‘global packaged MVC:‘
- org.comp.modelLayer |-fooAModel.java |-fooBModel.java - org.comp.viewLayer |-fooAView.java |-fooBView.java - org.comp.controlLayer |-fooAControl.java |-fooBControl.java
In this variant, the GUI is enclosed in one pacakage, emphasising that each gui element should be grouped with its neighbours. However, changes to each feature functionality have to be performed accross multiple Packages.
I am grateful for any experiences with either solution on large codebases, or any hints to the literature.