Issue
We want to create a spring MVC project using maven. We want to use just one project and, under it, have multiple sub-projects
What would be a good directory/package structure for the project for example
com
company
subproject_1
controller
doa
service
entity
subproject_2
controller
dao
service
entity
or all files of sub projects in one project
com
company
controller
all controllers of all sub projects
doa
all dao of all sub projects
service
entity
depending on the experience which project structure would be maintainable if the project increases and sub projects keeps adding on
or suggestion of any other package structure?
also what is the naming standard used for directory is it entity or domain? doa or persistence?
Solution
Why not following a multi-module project structure to group your sub-projects? It's a good coding practise widely adopted, recognised and easily manageable. Have a look at this example.
As far as the naming conventions goes that's personal preference but it's good idea to clearly maintain in package structure the different layers as you are saying from botton-top approach: the dao level, the domain, the service layer, the controllers and finally the view.
Answered By - dimitrisli