adam bien's blog

Fluent Interfaces, Passive View, Java EE 5 and the TrainingDB - sample code 📎

The first (alpha) version of the JavaServerFaces frontend for the sample app "RunAndBikeDB" was checked in into p4j5. This application is intended to manage your training data (sports, not Java :-)) and watch your progress. In this release only the storage of trainings units is implemented, however I'm already working on reports. This application is fully based on Java EE 5 (JPA, EJB 3 and JSF).

The business logic of the application was built with JPA regarding to the ideas of the FluentInterface "pattern". The presentation logic is based on the Model View Presenter Pattern (this name is actually retired), or PassiveView Pattern. I will disect both soonly on this blog. In addition this sample will be described in more detail in one of the upcoming issues of the JavaSpektrum (german magazine).

The whole app can be downloaded from p4j5. It is comprised of: RunAndBikeApplication (the ear), RunAndBikeDB (the domain objects, ejb-jar), and RunAndBikeJSFView (the presentation). These are Netbeans 6.0 projects (so just check out and start) tested on Glassfish V2. Thanks to the first committer "dynamic". He already contributed some code to the domain layer.