hi all, Am Son, 2003-02-16 um 10.32 schrieb Ugo Cei: > ivelin wrote: > > Ugo, can you can share experience with Hibernate vs. Jakarta OJB, Cayenne > > or another Open Source O/R tool. > > > > There is a reasonably objective comparison here > > http://c2.com/cgi-bin/wiki?ObjectRelationalToolComparison > > but I would like to hear more from a usability, flexibility and performance > > perspective. >
I am working with Castor/JDO which is insofar good, as it can be easily integreated with javax.transaction environemnts. Querying is done using a subset of ODMG OQL. I have used it in a number of projects sofar. I have also done a kind of xpath to oql mapping, for efficient xml extraction via the cocoon:/ protocol. Minor issue is for instance some extra overhead for wrapping the result in java.util.Collection classes. I think the community is reestablishing, since they have done 2 minor releases already this year - which I think looks promising. You can also use the xml package to do marshal the object to xml, but care must be taken, as it currently uses SAX1 (DocumentHandler), which must be wrapped with the namespace feature turned on. Also check out the xdoclet tags (which I have modified a little bit for my purpose) for castor, which are handy for mapping generation. In my experience, using a simple Bean Object as the form model and then using this model to fill in a DataObject is the better approach than direct binding the data object to the form, as you can't always do a 1:1 mapping between all the fields. just my 2 cents -- Jakob > I cannot really do a comparison here. Hibernate is the first O/R mapping > tool I've used (after a few home-made attempts) and I haven't tried > either OJB or Cayenne or anything else. > > Apart from what I've already said, I like Hibernate also because: > > 1. It follows the principles outlined in Scott Ambler's papers ([1] and > [2]), which I heppen to mostly agree with. > 2. It has a lively community behind itself and is being very actively > developed. > > I think usability is great and is immensely helped by good docs. I > cannot comment much on flexibility, I have just one application > developed with Hibernate and it was designed in a top-down fashion (i.e. > design your ojbects first, than derive the DB structure from them), > which is IMHO the best, if you can afford to get DBAs to do what you ask > ;-). But Hibernate purports to support all styles of design (top-down, > bottom-up, middle-out, meet-in-the-middle, see [3]), so flexibility > should be guaranteed. > > With respect to performance, I haven't any data and in my application we > haven't done any benchmarking or optimization yet. I have the feeling > that it is executing a little too many queries behind the scenes, but > that by tweaking Hibernate's settings (eager vs. lazy loading, caching) > we could get very good performance without mucking with the code. > > Biggest problem so far (mostly with some of my co-workers, who have a > good SQL background) is that sometimes you get a feeling of loss of > control. Not being able to control what SQL statements you application > is executing can be intimitading to some. Not to me, I always loathed > SQL ;-), but sometimes, when the thing does not work as you expect it to > (and most of the times this is due to your misreading of the docs), you > wonder whether the Law of Leaky Abstractions [4] is going to apply. > > Ugo --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]