Domain Model Pattern
Use exPOJO, the free, open source framework for exposing your POJOs and get productive today!
Hibernate and JDO Support:
See how easy it is to create and manage and persiste sophisticated object models with Javelin
New! Sample persistence projects!
Want the perfect solution for persisting your object model? Use Javelin and an object relational mapper like JDO or Hibernate and Javelin will automatically produce your meta files for you based on the rich source of knowledge it accumulates in your object model
For years Java programmers have been able to develop clever object models that accurately model their problem domains but they have experienced road blocks when trying to persist those object models because of the impedance mismatch between an object model and tables in a relational database. In recent times the technologies available for mapping an object model to a relational database have matured and are now "prime time". The two most popular technologies in the Java object relational mapping world are Hibernate (open source) and JDO (open source eg., JPOX and proprietary implementations).
Javelin performs powerful "model to meta-data" generation not weak "code to meta-data" generation
There are many "code to meta-data" tools available but in reality there isn't enough information about your model contained in just the source code to produce good meta-data for JDO or Hibernate. Invariably these types of generators need auxiliary information to produce a meta data file - either provided by a extra, separate XML file or files (and aren't we all excited when we realize that we might have one more XML file in our lives to create and manage!) or via annotations sprayed throughout your Java code which lock you into a specific persistence solution - developers don't easily forget bad lock-in experiences - and take away, by stealth, the chance your Java objects have of remaining POJOs (Plain Old Java Objects).
The aim of truly transparent persistence solutions like JDO and to a lesser extent Hibernate (Hibernate dictates some inclusions in each persistence class - which Javelin generates for you automatically) is to allow you to develop an object model consisting solely of POJOs ie., they contain no persistence technology specific references. It seems inconsistent with this aim that we should be polluting our Java class files with vendor specific annotations - avoid it at all costs if you like the freedom that POJOs bring you.
Javelin generates your meta-data from the rich source of knowledge that you have, implicitly, endowed to it while building your object model. Relationship names, types, multiplicity, ownership, etc., are all excellent pieces of data for use by Javelin's meta-data generator - data that is just not always available in your source code. Add to this Javelin's extensive customization options and choice of strategies (for inheritance mapping, optimistic locking configuration etc.,) and the amazing power of instant, automatic, hassle free, customizable meta-data generation is in your hands!
J3PO: A shiny, golden combination of technologies = Java + Javelin + JDO + POJO
In recent years there has been a return to the popularity of developing with POJOs (Plain Old Java Objects). A POJO is a plain simple Java object that contains no special code required for persistence or transaction management or session management or anything else. It only contains the attributes methods and relationships necessary to implement its behavour in your domain model. POJOs simplify the developers world because they are decoupled from other technologies - they are just a plain Java object representing a real world entity in their particular problem domain with no reference to any supporting technology. Truly transparent persistence enables developers to create entire object models without a adding a single line of Java code to any model object that is mandated by the persistence technology. For this reason POJO development is not possible with the current EJB specification (an entire set of auxiliary supporting objects need to be created as well) and probably explains the backlash against EJBs (as well as the inability to express inheritence type relationships in Entity Beans - which is a major disadvantage if you're an object oriented software engineer). JDO is a truly transparent persistence solution as it can persist pure POJOs. Hibernate is an "almost transparent" solution - it requires the developer to make a few changes to their Java classes to allow it to work - which Javelin generates for you.
Javelin supports automatic generation of meta files to facilitate persisting your POJOs to both Hibernate and JDO but because JDO is a truly transparent solution (and because it starts with the letter 'J' :] ) we've created the 'J3PO' acronym to represent developing software using the following combination of technologies: Java + Javelin + Jdo + POjo = J3PO.
Can't decide between JDO and Hibernate?
Javelin now supports the automatic generation of JDO or Hibernate mapping files and you can switch between them by changing a simple persistence setting and press a button to regenerate the appropriate mapping files. You can switch between mapping files for different persistence engines in less than a second! With Javelin you don't have to make a choice between JDO or Hibernate before building your object model. Defer your final choice of Hibernate or JDO until near the end of your project if you want to. Analyse the performance of each one by simply flicking the persistence engine from one to the other to try them out. You can even evaluate different JDO implementations. Currently Javelin supports any generic JDO 2 implementation, JPOX and Versant Open Access.
Getting started with Javelin 7
Essentially no effort is required to create mappings for your object model. Learn how to create a model and persist it using Javelin and an O/R Mapping technology in the Javelin/Hibernate tutorial. This tutorial uses Hibernate for the example but the steps are essentially the same for JDO/JPOX: simply select the appropriate JDO implementation instead of Hibernate in the persistence options of your project. (We recommend that you first work through the animated demonstrations above to get a feel for navigating around a design in Javelin.)
Read the Javelin Hibernate Support Reference.
Read the Javelin Hibernate Support Reference.
If you have any questions about Javelin™ please go to our Javelin™ support page and take advantage of our FREE live online support, the forums or just send us an email.
1996, 2009 Step Ahead Software Pty Ltd. All rights reserved.
Java™ and Java™-based marks are trademarks or registered trademarks of Sun Microsystems.
Flash™ is a trade mark of Macromedia Inc.