The Marringtons Database
(Adept-DB aka Adze-db)

Marringtons Java Systems are provided as open source under The Artistic License and hosted on SourceForge.net.

Desktop applications have support needs that differ from enterprise environments. The Marringtons library is here to extend the standard Java libraries with tools to fill those needs - including databases, XML processing and communications.

One major difference between a desktop application and and an enterprise environment is the availability of a database for information storage and retrieval.

Database Options for Desktop Applications
OptionBenefitsLimitations
Database Engine (e.g. Postgres) Full featured. Relational SQL. Transactional. Complex queries. Slow. Licensing/commercial issues. Difficult customer installation. Object mapping requires another layer (e.g. Hibernate).
Java SQL Solution (e.g. HSQLDB) Well featured. Relational. Single user. SQL Access only. Object mapping requires another layer (e.g. Hibernate).
JDO Database Standards compliant. Object database. Limited sources. Licensing/commercial issues. Complex to use. Large implementation.
Adept-db Object database. Simple to understand. Simple to use. Simple to maintain. Simple implementation. Not standards complient. Limited functionality.

I developed Adept-db before the JDO specification was published, otherwise I would have been tempted to become JDO complient. I would have ended up with a much larger and more complicated system.

I designed Adept-db with three words always in mind. Simple to use. Simple to understand. Simple to implement. I believe I succeeded in the first two - and with relation to other similar systems with the third.

Data you wish to persist should be enclosed in an object that extends com.marringtons.database.DAO. All public non-static non-volatile data will persist on demand. Call update() on data you may want to change. Call commit() to persist it after the changes or discard() to lose the changes. Indexing is described as public static inner classes with members with the same names as the fields to be indexed upon. Data is retrieved with first() and next() methods from an instance of an index (with overloaded defaults for int and String single keys). Objects can also be imported and exported as readable XML.


 static class MyDAO extends DAO
  {
    public int integer; // can contain any form of primative
    public String string; // and Strings
    public MyOtherClass myOtherClass; // and any other class you have defined to any depth
    public HashMap nameValuePairs; // Maps are saved and NVP for more efficient storage
    public DAO anotherDAO; // normalised - committed and saved as a database pointer only
    public ArrayList myList; // as are Collections
    public static class PrimaryIndex extends Index { int integer; String string; }
    public static class SecondaryIndex extends Index( String string; }
  }
The javadoc at com.marringtons.database.DAO provides all the usage information and examples you will need to implement the system.
Copyright © 2005 Paul Marrington
http://marringtons.com
SourceForge.net Logo
Support This Project