Sunday, November 11, 2012

Spring by Example (1.2.2)

A new multi-module Contact Application has been added. It is comprised of the following modules:
  • DAO - DB Schema, JPA Entities, Spring Data JPA repositories.
  • Web Service Beans - JAXB beans generated from XSDs.
  • Services - APIs use JAXB beans and Dozer is used to convert between this beans and the JPA entities. Security and transactions are configured in this layer.
  • REST Services - The module has clients & controllers, as well as their Spring configurations. JSON and XML views are supported for requests.
  • Webapp - The webapp as a standard JSP UI, Sencha ExtJS, and also a Sencha Touch UI.
  • Test - The DAO, Services, and REST Services all have an abstract test class for each module that each test extends. This way within each module, all tests have a shared context so Spring only has to load once. All of these tests use an in memory database and the REST Services have an embedded jetty server. REST Services tests can be run with clients using JSON or XML for marshalling.