Hey all. I want to play with with JDO and I found three option : 1. JPOX 2. Castor JDO 3. Hibernate which version to go with ? is one of them is easier to work with or more powerfull ? any way, why to use JDO technologis if we already have JDBC (except for OODBMS)? when to use JDO ? when to use JDBC ? which technology offers a better performance , JDO or JDBC ? it seems to me that technologies like JDO or Hibernate consumes a lot of time. thanks.
JPOX is a true JDO implementation, but I have no experience with it. Castor JDO is not an implementation of the JDO spec, but a proprietary API, and I do not recommend it as an O/R mapper. Hibernate is proprietary as well but it's an excellent tool with a large user base.
why to use JDO technologis if we already have JDBC (except for OODBMS)?
Because JDBC code is both very boring and very hard to write well, and it does not support an object oriented approach to problem solving. To put that last bit differently, it's a lot of work to persist an object model using JDBC.
when to use JDO ?
I would use an O/R tool such as JDO or Hibernate whenever I had a nontrivial problem domain and some nontrivial logic or process to apply to it. In other words, in most applications.
when to use JDBC ?
When the problem domain is trivial, or when I'm not interested in applying any logic or process to it. A good example is the F.A. Premier League statistics action station (on stats.premierleague.com). This is essentially a data warehouse with 12 years' worth of F.A. Premier League football history in a few dozen fact tables. All that the Java web application basically does is execute database queries and shovel the results straight into HTML pages. There is no need to perform any processing on the data or apply nontrivial logic to it; so there is no object model. It uses plain JDBC to query the database and passes the data around in Maps. (Obviously, at >10M page hits/month, the Java code also performs caching, load management, caching, performance monitoring, and did I mention caching?)
which technology offers a better performance , JDO or JDBC ? it seems to me that technologies like JDO or Hibernate consumes a lot of time.
What is performance? Ultimately, Java O/R mappers use JDBC, so given enough time and budget you can always make JDBC as fast as or faster than O/R mapping. But given a more typical scenario of limited timescales and budget, O/R mapping is faster in many situations because O/R tools tend to support statement batching, query/update optimisation, object and query caching and so on out of the box. Such performance-enhancing features are usually not practical to implement if you were to use JDBC. Also, more effective development with an O/R mapper gives you more time to spare for some performance tuning.
- Peter [ August 21, 2004: Message edited by: Peter den Haan ]