Technical Information

Creating Date: 2005/July/21
Lastest Update: 2005/July/21

Here you can read about important technical information. We are talk about packages, database, frameworks and the system's base. If you want to understand the JTasks architecture, this requirement is very important.

Let's start with package organization. The package's base is jtasks, inside this package we will go to organize the rest of the packages. Bellow you can read more details and your respective description:

How the Actions work?

The actions work together webwork framework. You can read more about webwork in your official website (http://www.opensymphony.com/webwork/). As the package description above, we can see that all actions are implemented into jtasks.actions package.

For JTasks, none actions can inherent from ActionSupport directly. You need to inherent from some class inside jtasks.system package. Into this package, the class of the top from hierarchy is ActionBase. Each class has your own documentation inside the code (javadoc).

If you need to make some .xml file to work with the Action, you need to put this file in the same package from the action. LoginAction-validation.xml is a simple and already implemented example.

Working with Hibernate

Hibernate classes are localized in two packages, jtasks.model and jtasks.dao. The first package is where the POJOs are implemented. Beyond the .java files, also are localized the .xml file that hibernate uses to your map. For example, if you have Users.java class, you need to have Users.hbm.xml file (this file is used by hibernate). Now, the question is, how can I create this .hbm.xml file? They are created using ant+xdoclet, by the way, the ant script is localized in the root of the system, called hibernate-xdoclet.xml. You can learn more about xdoclet in your official website.

Other important package is jtasks.dao, this package contains the class that represent the DAO pattern (read more about design pattern, it's very important). DAO.java class is the class from top hierarchy, others DAO classes must inherent him. Look to DAO.java class and you will see some "default" methods. These defaults methods are very used in the majority of the system.

Into DAO class, you will find an important object, called SessionFactory. This object must use the Singleton pattern and it need to start only once. This start occur when the Application Server starts, in other words, when the Application Server starts one servlet is called (Initialization.java) and this servlet start the SessionFactory calling the start() method by DAO.