Business Case

The example explains how a real-life business problem is solved using OpenEJB in a combination with other open-source frameworks and tools. The example covers the entire technical solution, including architecture, design, build automation, unit testing, implementation, and deployment.

The product is hosted at with its source code available at [] . The purpose of the system is to collect UML meta information from open source products and make it visible for end-users in form of diagrams and texts. More information about the product and its documentation you can get at [] .

Architecture and Design

The following Java-stack technologies are used in the system:

There are three layers in the system (Presentation, Business, and Persistence) and a number of components in each of them:


Presentation Layer includes JSF (Mojarra), JAX-RS (Jersey), and Java EE container (Tomcat). In other words, everything on top of "Delegates " in the diagram. Package [com.rempl.oss.delegates|] with its classes realize [Business Delegate|] and [Service Locator|] Java EE design patterns. More about it later...

Business Layer includes EJB (OpenEJB), Brokers (Stateless Session Beans), and JPA entities.

Persistence Layer includes JPA (OpenJPA), JDBC (MySQL JDBC Driver) and the MySQL server.

Build Automation and Tests

Build automation is managed by Maven 3 , see our [pom.xml|] .

There are four levels of testing in the product:

  1. Static analysis
  2. Out-of-container unit testing
  3. In-container functional testing
  4. On-location testing

During static analysis we are using Checkstyle , [PMD|] , [FindBugs|] , [Cobertura|] , [maven-dependency-plugin|] , [xml-maven-plugin|] . Important to note that all these tools are used as gate condition checkers, not as post-factum analyzers. 

Out-of-container tests are automated with JUnit. Good example of a Stateless Session Bean out-of-container testing: .

In-containter functional testing is automated with JSFUnit and embedded Tomcat container. more later...

On-location testing is not yet automated... working on it...

Configuration and Plumbing