Skip to content
testinfected edited this page Nov 1, 2011 · 9 revisions

Petstore

A sample Java application to demonstrate applying the principles and practices described in Steve Freeman and Nat Pryce book, Growing Object Oriented Software, Guided by Tests.

Disclaimer

This application is built on top of Spring MVC 3.0, Spring Core 3.0, Hibernate 3.5, Velocity 1.6, Sitemesh 2 and Maven 2/3.

I hear people asking, why such choices? I don't pretend these are the sexiest nor best frameworks for doing web development in Java. In fact I don't think they are. I wanted to choose technologies a lot Java developers have to deal (or struggle) with, with the following objectives in mind:

  • Make it relevant and useful to a large number of Java developers using open source technologies
  • Make the point that technologies should not be preventing you from applying the best practices described in the book.
  • Learn Spring MVC myself, after doing essentially rails development recently
  • Don't make it to easy ;-)

Project structure

The project is composed of a top-level (parent) project, which aggregates several modules:

  • petstore-domain (jar): the domain model of the application
  • petstore-infrastructure (jar): includes the persistence adapters
  • petstore-app (war): the web application part (controllers, views and helpers)
  • petstore-system-tests (tests only): a special module that contains no production code and does not generate a package. It it used to run the end-to-end tests for the application.
Clone this wiki locally