4 mins tutor / Installing
Download distribution from Sourceforge. Unpack.
> tar xfvz pat-M1-XX.tgz
To run the example you need:
- Java SDK >=1.4. 1.5 seems to work also.
Run ant from command line or your favourite IDE:
You'll see output like this:
[echo] You may run several ant targets:
[echo] > ant skeleton-app
[echo] > ant tests
[echo] > ant tests2
[echo] > ant run-demo-withSnapshot
[echo] > ant run-demo-withoutSnapshot
[echo] > ant run-performance-demo
Total time: 0 seconds
We'll work with skeleton-app target..
Change directory to your new base directory for first application:
> cd src/skeleton/
> Main.java Transfer.java World.java
View those three files. One of them is Java application: Main.
The other two are PAT classes. One of them is root
class and the other is business object.
The requirement of PAT is to have a root class, that will have indirect
references to all other business objects. It is not so scary as it sounds :)
In our first app we have one business object: Transfer.
As we see the root class:
- it simply consists of list of
The only transaction in our example is
method of World class.
It simply adds empty object to a list, every time it's executed.
class simply creates root object and executes transaction on it.
Just run on command line or through your favourite IDE:
> ant skeleton-app
Run it several times, so you'll see it really works. The amount of transfers
is increasing every time the application is run.
Database files (Prevayler's files) are held in
P-databases/skeleton-app/ directory by default.
Feel free to change those classes. For more examples see
another demo app.
If there are any, try to look in Common problems.
If it fails, go and ask.
Revision: $Id: 4min_tutorial.gtml 3710 2005-05-29 01:19:01Z nthx $
Generated with GTML