The consensus I prefer is to first group the classes modulo, and then functional. For example, you might have the following structure:
com.example.modulea - modulea specific code that doesn't have any real need of a different package com.example.modulea.dao - data access for module a com.example.modulea.print - printing for module a
...
com.example.moduleb - moduleb specific code that doesn't have any real need of a different package com.example.moduleb.dao - data access for module b com.example.moduleb.print - printing for module b
Thus, the code becomes understandable with the help of the package.
In a different style of grouping by pure functionality, the package size tends to be quite large. If your project contains 15 modules, and each module has one or more elements for each package, these are at least 15 classes per package. I prefer clearly separated packages than packages that simply group things, because "oh, here are some printing utilities that are used for each module, but only one module actually uses one of them from this package" - it just gets confused.
MetroidFan2002
source share