Thursday, January 30, 2014



Why JDO ?

The majority of applications need to persist (or store) data during their lifecycle. There are many ways of doing this with an application written in Java.
  • If your datastore is RDBMS you can handle the persistence (and retrieval) of data yourself using JDBC. Obviously with this route you have the burden of having to write the persistence layer yourself. This gives much control, but also creates significant work, both in writing the code but also in testing and maintenance.
  • You can use JDO, a standardised persistence API. With JDO you can develop plain old java objects (POJOs) and persist them as they are transparently. This requires very little work from the developer. It allows persistence to any type of datastore in principle, being designed with flexibility and datastore agnositicity in mind. This has been a standard since 2002 (JDO1), being upgraded in 2006 (JDO2) and is in the process of being developed further (JDO2.1) by Apache JDO
  • You can use JPA, a standardised persistence API, and part of the EJB3 specification. This also allows you to to develop plain old Java objects (POJOs) and persist them using a standardised API. It's specification is not as mature or as feature rich as the JDO API, nor does it provide the flexibility of using any type of datastore. This was released in 2006 (JPA1) to supercede EJB2. It really only allows persistence to RDBMS datastores. If you want to persist to other datastores you should consider JDO.
  • If you are stuck with using an EJB2.* architecture you could use Entity Beans. This means that you hand off your objects to the EJB part of the J2EE server. This simplifies things for the developer in some respect but places major restrictions in that your objects have to be Entity Beans.
  • You can also use a proprietary persistence API (e.g Hibernates own API, TopLinks own API, iBatis, Castor etc). The disadvantages of going this route are that you cannot easily swap to an alternative implementation of the API if you hit problems with your software choice.
To give a guide, here are a few important consideration points when choosing a persistence layer for your application.
FeatureJDBCJDOJPAEJB2Custom ORM
Standards-Driven
Choice of datastores
Support POJOs
Usable in J2SE
Usable in J2EE
Out of box implementation (1)
Simple to unit test
Dynamic queries (2)
Comprehensive ORM
Primary Key generation (2)
Supports inherited objects (2)
Schema Creation
Existing schema
  1. refers to whether it is necessary to write the persistence yourself (e.g as with JDBC) or whether you can just persist by simple calls.
  2. requires the developer to write this layer.

4 comments:

oakleyses said...

louis vuitton handbags, oakley sunglasses, louboutin, longchamp outlet, nike shoes, louis vuitton outlet stores, chanel handbags, burberry outlet, prada outlet, jordan shoes, tiffany and co, michael kors outlet, tory burch outlet, louis vuitton outlet, longchamp handbags, nike free, true religion jeans, michael kors outlet, kate spade outlet, polo ralph lauren outlet, tiffany and co, prada handbags, polo ralph lauren outlet, michael kors outlet, michael kors outlet, longchamp handbags, oakley sunglasses, ray ban sunglasses, kate spade handbags, burberry outlet, louis vuitton outlet, louboutin outlet, louboutin, coach factory outlet, air max, air max, coach outlet, gucci outlet, christian louboutin shoes, michael kors outlet, coach purses, ray ban sunglasses, michael kors outlet, louis vuitton, coach outlet store online, true religion jeans, oakley sunglasses cheap

oakleyses said...

ralph lauren, lululemon, air max, hollister, north face, nike air max, polo lacoste, vanessa bruno, timberland, vans pas cher, louboutin, louis vuitton, oakley pas cher, air max pas cher, nike roshe run, air max, true religion outlet, barbour, sac longchamp, air force, hollister, sac louis vuitton, nike free, polo ralph lauren, nike trainers, louis vuitton uk, nike roshe, sac hermes, longchamp, michael kors, sac burberry, sac guess, mulberry, new balance pas cher, converse pas cher, sac louis vuitton, hogan outlet, nike tn, north face, true religion outlet, ray ban pas cher, michael kors, air jordan, nike blazer, nike free pas cher, michael kors pas cher, abercrombie and fitch, ray ban sunglasses

oakleyses said...

mac cosmetics, mont blanc, marc jacobs, canada goose outlet, nike huarache, vans shoes, soccer jerseys, hollister, giuseppe zanotti, beats by dre, abercrombie and fitch, longchamp, insanity workout, celine handbags, bottega veneta, ghd, nfl jerseys, north face outlet, chi flat iron, ugg boots, birkin bag, ugg australia, canada goose, herve leger, ugg pas cher, rolex watches, valentino shoes, canada goose uk, canada goose, ferragamo shoes, canada goose, ugg boots, uggs outlet, north face jackets, soccer shoes, asics running shoes, new balance shoes, p90x, lululemon outlet, canada goose jackets, mcm handbags, instyler, babyliss pro, ugg, wedding dresses, jimmy choo outlet, reebok outlet, nike roshe run

oakleyses said...

parajumpers, karen millen, air max, converse, pandora charms, moncler, louboutin, moncler, links of london, lancel, juicy couture outlet, oakley, hollister, pandora charms, supra shoes, thomas sabo, canada goose, gucci, wedding dresses, timberland boots, swarovski crystal, air max, coach outlet store online, moncler, ray ban, canada goose, moncler, ugg, louis vuitton, swarovski, hollister, montre homme, moncler, hollister clothing store, ralph lauren, rolex watches, moncler outlet, moncler, iphone 6 cases, baseball bats, juicy couture outlet, toms shoes, vans, pandora jewelry, ugg, converse shoes