Quick help:
Distribution ships with two example applications. One found in org.nthx.pat.demo package in src/main/ directory and another, very simple one - skeleton app - found in src/skeleton-app/ directory.
Based on two of them you should be able to design your object world and write a simple application.
PAT is an aspect. More on aspects you'll find in Aspect Oriented Programming areas. What is important for running PAT is that the compilation process is little bit more than simple <javac>.
After compilation of Java sources one needs to compile just compiled classes
with another compiler - AopC. It comes with JBossAOP distribution (shipped)
with PAT).
There are many ways of compiling sources: using Ant task, invoking it from
command line. I support only Ant tasks for now. More on this may be found in
http://www.jboss.org/products/aop/
Basically, remember to do two steps:
Two Ant's tasks exist for compiling `*.class' files: <annotationc> and <aopc>. One may see examples of usage in build.xml file.
For compilation process you need all the *.jar files found in lib/ and dist/ directory.
PAT classes can be generated with:
No matter how you will run your java apps, there are two system variables you must pass to the PAT.
./etc/aop/
)./P-databases/demo/
)
This variable must be always passed to JVM as a system property.
Value of this variable must point to a directory in which `*-aop.xml'
files exist. Those are JBossAOP configuration files. PAT needs them to work.
Look at build.xml file, to see how to pass this variable using Ant.
When one uses IDE then - depending on your IDE - you also have to pass this variable. When running a TestCase in IntelliJ IDEA for example, one has an option to pass additional variables to a test case. Put:
PAT distribution (as you can see in build.xml) uses `${basedir}/{etc.dir}' value in Ant script.
This variable points to a directory in which PAT and Prevayler holds its data files.
Every different application (which differs in class' schema) has to use different directory for storing/reading those files.
Distribution customizes the variable in Ant's build.properties file.
Default PAT's value is: P-databases. Then 4 directories go:
The directory structure of a database looks like this: