Maven-based wizards are available to help in the creation of new projects. More on this will follow at the end of this section.
Here's the file and folder of a simple project created by one of these wizards:
. |-- pom.xml `-- src |-- main | |-- java | | `-- pt | | `-- digitalis | | |-- entities | | | |-- applications | | | | `-- SampleApplication.java | | | |-- providers | | | | `-- SampleProvider.java | | | |-- services | | | | `-- SampleService.java | | | `-- stages | | | `-- SampleStage.java | | `-- ioc | | |-- AppModule.java | | `-- EntityRegistrator.java | |-- resources | | `-- modules.properties | `-- webapp | |-- WEB-INF | | `-- web.xml | `-- sample.jsp `-- test `-- java `-- pt `-- digitalis `-- SomeTest.java
We can identify the following parts:
Other folders can exist as well, but that's beyond the scope of this section. More information about this subject can be found on the Maven documentation (see here).
This is the IoC modules descriptor. Read more about it here.
By default the project must define an IEntityRegistration implementation.
This class will tell DiF what packages to search for DEM entity classes.
Here's an example of such a file:
public class EntityRegistrator implements IEntityRegistration { public void registerEntitys(IDEMRegistrator registrator) { registrator.registerMetaModelPackage("pt.digitalis.someapp.entities"); } }
By adding these two files, the modules.properties and this Java class, DiF will search the "pt.digitalis.someapp.entities" package and all it's sub-packages for entity classes. Which is to say java classes annotated with the Entity definition annotations. More information on this subject can be found here
The rest of the project files should be organized as follows:
A tutorial describing the creation of a simple project is available here.