Thursday, July 03, 2008

Typical JEE Project & Package Structure

Here is a typical structure for the Project and Packages of a JEE Web App:


Presentation Layer (Web project)
  • contains the UI e.g JSF pages and beans etc
  • only able to access the implementation of the project via the Control project
  • actions ('do' methods) are used to trigger use cases
  • does not contain any logic or calculations to remain swappable with an alternative UI
Business Layer (Control)

  • contains the transactional business logic operations whose pre-conditions are validated
    encapsulates any 'finder' methods required by the Web project
  • communicates with the Service project for CRUD operations
Persistence Layer (Service)
  • services all operations on persisted data using ORM mapping
    contains no business logic
Domain Layer (Common)
  • does not contain any methods other than those provided by the utils package
  • domain objects simply represent state and are passed through the layers of the system
  • the project is likely exported as a JAR file in a UML-Java transaformation to force any updates to change the domain model

No comments: