Checking your application architecture #
ztemplates comes with a set of junit tests that check the architecture of your ztemplates application. The tests are implemented with ztest. The checks are made to your deployment package (ear, war, jar). The test output is in xml.
The following checks are made (for EJB3 with annotations):
- strict separation of actions and view: no class that is annotated with @ZRenderer (view) can depend on a class annotated with @ZMatch (action)
- actions can use session beans interfaces
- actions can render render-pojos
- session beans can use entity beans
- session beans can use sql layer
- session beans can use session beans interfaces
- parameters passed to/ returned by session beans interfaces are serializable
All other dependencies are forbidden.
This means that:
- views cannot use actions, ejbs or data access layer (java.sql, javax.sql)
- actions access session beans to get data in form of data transfer objects, convert the data to view-data-objects and pass the data to views.
- views cannot access any layer, they get the view-data-objects from the outside.
- session beans do not pass entities to other layers