Although there may be reasons not to pass the code, I personally prefer DRY.
I solved the DRY-style problem using Python by placing the model definition file in the dir app/models.yaml and linking it to the symbol in each of the sub-modules of the app/module_blah/models.yaml , so that all the modules look at the same ones same definitions of models. During deployment, symbolic links are automatically replaced by the actual contents of the symbolically linked file. From appcfg.py update :
The command follows symbolic links and recursively uploads all files to the server. Temporary or source control files, such as foo ~, .svn / *, are skipped.
Help may be needed to deploy all the modules.
I used the same technique to also share entire libraries with common code between modules, by referencing the app/lib/libX subdir in the desired app/module_blah/lib/libX as needed.
Not sure if this method can be used in Java, tho.
source share