In this short article we will try to explore some of the discussions around best practices for packages
Above structure defined is more a classic structure followed mostly :) ... (At least on the projects that I worked on)
Follow this article which more are less explains the spring pet clinic project structure.
Below is the good article I found about project by code structure, if you find anything better, please comment.
which ever approach you choose from above for enterprise you would like to standardize the project structure for all the development team and provide some template classes. If you are using maven you can do this by arch-type.
We can use maven archtype to create structure. Personally I feel it's important in enterprise to have a common structure defined for consistency and readability perspective.
Good Articles to follow for creating a maven archtype.
you can also use IntellIJ feature for storing project templates locally for future reference.
In this article I try to summarize the package structure and how we can use maven archtype to create our package structures and templates.