Java Still Struggles With Persistence



Email    print   
July 15, 2004 —  (Page 1 of 2)
When it comes to persistence-storing an object in some place external to your program, ideally in a database-there's a strong need for simplicity.

The Holy Grail of persistence is transparent object storage. I just want to put some object in the persistent store and pull it out again later, as if I were storing the object in a local data structure like a hash table.

I don't want to know anything about databases, XML files or whatever physical storage is used under the covers. Achieving this level of simplicity is very difficult. Sometimes I need to use complex criteria to find a particular object or group of objects, but I want the complexity out of the way when it's not relevant.

You can find proof of the difficulty of building a simple-to-use but powerful persistence system by looking at all the bad implementation floating around.

Roll-your-own systems built on JDBC are too complex, and require specialized knowledge of databases. Object databases looked promising for a while, but they were never trusted enough to be commonly used or sufficiently standardized, and forced you to learn complex new query languages.

I don't want to open the Enterprise JavaBeans can of worms in this column, but unfortunately, many misguided people used EJB to implement persistence-at a huge cost in up-front development time, long-term maintenance problems and runtime performance.

An entity bean is not the same thing as a persistent object. EJB-based O/R-mapping systems such as Thought Inc.'s CocoBase cover the zits with a thin layer of makeup, but they don't solve the problems inherent in the underlying EJB system.

Java's other persistence solutions have also been far from ideal. JDBC doesn't get along very well with the notion of objects, it doesn't provide enough in the way of APIs to let you write in a database-independent way, and at the same time doesn't do many common database-related tasks (like transactions) very well.

The various XML APIs don't talk to relational databases, and introducing an XML-to-database translation layer adds too much inefficiency. Java Data Objects is a step in the right direction, but JDO is way too complicated for my taste, and requires a post-processor that manipulates your bytecode to make an object persistable-something that's bound to cause maintenance problems and also ties your code to a specific vendor.




Pages 1 2 


Share this link: http://sdt.bz/28000
 
Most Read Latest News Blog Resources

Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
Look what 2011 washed in: The return of Java
Oracle's stewardship has led to real progress for the venerable coding language Read More...
 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
FEBRUARY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Are you at risk for burnout?
Burnout is a severe problem and it can strike at any time. Here's how to tell if you are nearing the edge.
02/09/2012 02:16 PM EST

Agility, mom, and apple pie
If we're to evaluate the state-of-the-art in software development, we should start with the values espoused in the Agile Manifesto.
02/07/2012 11:57 AM EST

RIM woos developers with free tablet
How do you get more apps ported to the BlackBerry PlayBook? By giving every developer a free tablet, of course!
02/04/2012 01:57 PM EST

GitHire: Use Headhunters to Find Your Perfect Programmer
Are you a hiring manager tired of scouring the job boards? Check out this new service that will find 5 people interested in your jobs.
02/03/2012 12:17 PM EST

Facebook claims hacker cred
Facebook's SEC S-1 filing form includes a short essay on the Hacker Way by Mark Zuckerberg himself.
02/02/2012 08:26 AM EST

Ryan Dahl steps down
Ryan Dahl, creator of Node.js, steps back from his position as gatekeeper for the project.
02/01/2012 04:58 PM EST

 
Events calendar tab
2/13/2012 to 2/16/2012
Santa Clara
TechWeb

2/26/2012 to 2/29/2012
San Francisco
BZ Media

2/27/2012 to 3/2/2012
San Francisco
RSA

3/4/2012 to 3/7/2012
Las Vegas
IBM Tivoli

3/5/2012 to 3/9/2012
San Francisco
TechWeb