Turbine can be used in three different ways depending on what you need.
You can choose to only use one way or choose to use all three. It is up
to you.
- As a servlet framework with Turbine as the controller.
- As a framework of useful code in your application.
- As a Object-Relational Tool.
In all cases, it means that you simply link against the API and code
provided in the turbine.jar file. In other words, if you want to only
use the Object Relational aspects of Turbine, then you would use Torque
to build your Object Relational code and then add the turbine.jar into
your classpath. Another example is if you want to use Turbine's
connection pool code. All you need to do is tell Turbine where its
configuration file is, add turbine.jar to your classpath and then add
the appropriate Turbine Java code into your application.
Turbine is now a fairly large codebase. This can be daunting to people
who are just starting out with Turbine. However, the code is fairly well
organized and as you learn about each part of the code, the entire
architecture starts to make sense and is really quite easy to master.
All of our code is well javadoc'd so we encourage you to review not only
the actual source code, but also the documentation. :-) The diffferent
parts of Turbine are:
-
org.apache.turbine.modules - This is where the code for the Modules
system is stored. The different Modules are described in more detail in
the funtional specification document.
-
org.apache.turbine.om - OM stands for Object Model. This is where the
code that represents Turbine's Object Model lives. The code in here is
for handling a lot of Turbine's RDBMS relationships. For example, there
is code that represents what a Turbine User is as well as code for the
BaseObject and BasePeer which is for the Peer based Object Relational
Tool.
-
org.apache.turbine.services - This is where the Services Framework
lives. The Services framework is a core aspect of Turbine. Essentially
it is a framework for creating Singleton objects which may also have an
init() and destroy() lifecycle. There are Services for many different
things. For example, the Database Connection Pool is a service and so is
the Logging (which is backed by Log4J).
-
org.apache.turbine.torque - Torque is our generic tool for building
autogenerated code. The benefit of this is that we are able to do things
like take a database that is defined as an XML file and then
autogenerate the .sql for a specific database as well as Java code that
can allow you to easily build an Object Relational system.
-
org.apache.turbine.util - The Util package is just that. A package of
utility code that is used within Turbine. There is code that will allow
you to easily send template based email using WebMacro or Velocity as
well as many other commonly used web application tools.