TermComp Blog

by binabik on 2008-11-21 at 16:00

Termcomp Eclipse project structure

This article describes the folder and package structure in the termcomp Eclipse project.

Source Folders

In the image shown above or in your eclipse project navigator, you can see 3 source folders. These are:

src/model
This folder contains the package(s) related to the underlying data model
src/action
This folder contains all the other packages for the termcomp application (explanation below)
src/test
At time of writing unused, but will at some point contain the unit testing packages (volunteers anyone?)

Build related Folders

The following folders are build folders and can be safely ignored, but not deleted.

classes
Contains the compiled Java classes
dist
Is used to store distribution archives (.ear, .war, .jar and friends)
exploded-archives
A pre-staging folder for creating the distribution archives
src
See above

Resource Folders

The following folders contain project resources and should not normally be needed in daily development life.

lib
Contains all required libraries. See note below.
resources
Contains configuration files for the application.
workflows
Contains JBPM workflow definitions
doc
Contains generated JavaDoc files, not always up-to-date (use Eclipse’s built-in “Generate JavaDoc” functionality).

If a library is added and is required for successful running of the application, then the build.xml also needs to be changed to include the library in the generated war file. Add the library to the <copy todir=”${war.dir}/WEB-INF/lib”> directive in the war target.

View Folder

This folder contains the end user visible web-pages. The folder structure is the same as visible in the application. Structural files are contained in the layout and stylesheet directories. When creating new JSF pages, re-use an existing one as a template to include the layout and ensure that the files have the ending .xhtml.

The mails directory contains templates for emails sent by the system, the docs directory contains any documentation intended for end-users. help contains help files and admin the administration files.

To add items to the folding menu, edit the file layout/panelmenu.xhtml.

Packages

The packages are structured as follows:

org.aspsimon.termcomp.entity
This package contains the Hibernate @Entity beans for the whole termcomp application.
org.aspsimon.termcomp.infrastructure
This package contains infrastructure objects which are used at a very low level.
org.aspsimon.termcomp.infastructure.utility
This package contains utility objects for mundane tasks.
org.aspsimon.termcomp.infrastructure.validator
This package contains the Hibernate validator beans used in the web interface.
org.aspsimon.termcomp.interfaces
This package contains interfaces for the session beans.
org.aspsimon.termcomp.local.* and org.aspsimon.termcomp.remote
These packages are related to the remote scheduling application, in the web project, they only contain the required stub classes.
org.aspsimon.termcomp.session
This package contains all the session beans which are used to provide functionality to the JSF pages in the application.