Welcome Guest  |  Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 4619 times and has 4 replies Next Thread
Male chrisco
Expert
Member's Avatar

Australia
Joined: Nov 24, 2005
Post Count: 562
Status: Offline
Reply to this Post  Reply with Quote 
JPOX better than Hibernate according to Hibernate trainer!

My company is currently contracting to another company that provides financial services software. One of the employees at that company recently attended a Spring training course. He was talking to the trainer, who also gave Hibernate training courses, and he asked the trainer about the different between JPOX and Hibernate. The Hibernate trainer told him that JPOX was undoubtably the better product!!!

I have to agree with the Hibernate trainer. I actually started with Hibernate 3.x for no other reason than Hibernate seemed to be the tool than "most people used" and therefore must be better. After trying to use it for a few months I realized that my assumption that "popular == better" was wrong.

I kept hitting "issues" with certain modelling patterns and had to read strange explanations in the documentation about what you have to do in case 'A' to work around issue 'B' with feature 'C'. In some cases I found myself changing my design to make it work with Hibernate - I should never have to change my design to suit my "transparent" persistence engine otherwise it ain't too "transparent" is it?

Hibernate performance was another touchy issue: using reflection to check if objects are 'dirty' and need to be updated in the database at commit time is one god almighty ugly and slow mechanism - you can get away with it when you have very few objects contained in shallow object graphs - the type you get in trivial, non object oriented designs projects - but when you build real world, well crafted object oriented designs that model real world entities you end up with non trivial, non shallow object graphs: that's just the nature of our game and you end up in a lot of pain if you use a persistence engine that can't perform well with such designs.

I had to find a solution to end all of that pain so I looked for something else and found JPOX - arhhhh! Have you ever driven a Hyundai and then stepped into a late model Audi or Mercedes? That's the kind of feeling you get with you start using JPOX after using Hibernate. The engineering, the style: you get the feeling that the German engineers have really spent the right amount of time working on every detail, thinking through every possible scenario: everythings just "flows naturally" and works - there's no compromising, there are no "workarounds".

More people drive Hyundai's that Mercedes but I know what I'd rather drive...
----------------------------------------
Chris Colman
http://visualclassworks.com
Javelin: Visual modeling & coding with automatic JDO 2/DataNucleus meta data generation.
http://expojo.com
expojo: Simple dependency injection and exposed POJO domain model pattern
[Oct 30, 2007 6:26:35 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male ganzuoni
Expert
Member's Avatar


Joined: Nov 16, 2005
Post Count: 844
Status: Offline
Reply to this Post  Reply with Quote 
Re: JPOX better than Hibernate according to Hibernate trainer!

Hi Chris.
You are totally right.
OK, let's agree upon one general thing.
ORMs based on Scott Ambler pattern are miles and miles ahead the tipical DAO approach. (I have tried/still trying to port JForum from DAO to JDO but it is a nightmare to realize the twisting you have to make in a DAO based implementation).
In this respect JDO, Hibernate, JPA are great.
Back to our popular ORM wink, what I have found really disappointing is the proxy/lazy initialization.
I agree that is the only possible solution granted the general approach (reflection) but the impossibility to get real class of an object with the
simple o.getClass() made impossible the use of extensions based on the class.
We use a templating engine that binds HTML/XML templates to object classes and so in a project where I was forced to use hibernate I had to disable lazy intialization. With all the consequences on performances.

Guido
----------------------------------------
Guido Anzuoni
http://www.objectmagic.org
[Oct 31, 2007 8:33:49 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male chrisco
Expert
Member's Avatar

Australia
Joined: Nov 24, 2005
Post Count: 562
Status: Offline
Reply to this Post  Reply with Quote 
Re: JPOX better than Hibernate according to Hibernate trainer!

Hi Chris.
You are totally right.
OK, let's agree upon one general thing.
ORMs based on Scott Ambler pattern are miles and miles ahead the tipical DAO approach. (I have tried/still trying to port JForum from DAO to JDO but it is a nightmare to realize the twisting you have to make in a DAO based implementation).

That's amazing! I was considering doing that exact same thing: porting JForum to JDO. The DAO pattern really sucks. Sure it might have had a place in the pre-transparent persistence days but people should really get over it now. I read that JForum are porting to an ORM (the popular but slow one) so I thought I'd wait until version 3 because that would be a much simpler port to JPOX. Version 3 is taking them a long time to develop though - perhaps they should have cut to the chase and developed using JPOX themselves.

In this respect JDO, Hibernate, JPA are great.
Back to our popular ORM wink, what I have found really disappointing is the proxy/lazy initialization.

Proxy - one of those ideas that sounded like a good idea at the time.

At a place I was consulting at in 2002 we developed a proxy based solution for "transparent" persistence. I saw all the pit falls of such a solution first hand back then and I still see them today. When JDO arrived with byte code enhancement I welcomed it with open arms - at last we had real transparent persistence without the draw backs of a proxy base solution including the performance hit you get when you use reflection.

I agree that is the only possible solution granted the general approach (reflection) but the impossibility to get real class of an object with the simple o.getClass() made impossible the use of extensions based on the class.

Yes that's when you realize that a proxy based persistence engine isn't as "transparent" as you expected it to be.

We use a templating engine that binds HTML/XML templates to object classes and so in a project where I was forced to use hibernate I had to disable lazy intialization. With all the consequences on performances.

Guido

OMIGOD! Having to disable lazy initialization is when your persistence engine ceases to become transparent and reverts back to merely a sophisticated SQL glue code factory.

The ONLY negative somebody may bring up about JDO is byte code enhancement but that is such a non issue these days. The new ASM byte code enhancer does it's job in the blink of an eye!

Byte code enhancement is becoming much more popularly accepted now days: it's starting to be used by so many different products for so many different things: AOP, a feature made available in the Spring framework uses it. Plus there's many more different areas of programming, not just transparent persistence, that are seeing the benefits of byte code enhancement. Terracotta uses it for massive clustering via a single "distributed" Java Virtual Machine.
----------------------------------------
Chris Colman
http://visualclassworks.com
Javelin: Visual modeling & coding with automatic JDO 2/DataNucleus meta data generation.
http://expojo.com
expojo: Simple dependency injection and exposed POJO domain model pattern
[Nov 4, 2007 8:23:00 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male o_swas
Member




Joined: Aug 8, 2007
Post Count: 54
Status: Offline
Reply to this Post  Reply with Quote 
Re: JPOX better than Hibernate according to Hibernate trainer!


ORMs based on Scott Ambler pattern are miles and miles ahead the tipical DAO approach.


My apologies, I don't wish to hijack the thread, but you could explain more about the "Scott Ambler pattern" approach to ORM, or where I might find some nice documentation? I googled it and found a bunch of stuff about Scott Ambler, but I'd like to know more about the specific pattern to which you're referring. Thank you!!

By the way, I find JPOX to be superior to Hibernate in most areas, too. Not having to override equals/hashcode is a godsend.

Ryan
[Jan 29, 2008 4:13:44 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male ganzuoni
Expert
Member's Avatar


Joined: Nov 16, 2005
Post Count: 844
Status: Offline
Reply to this Post  Reply with Quote 
Re: JPOX better than Hibernate according to Hibernate trainer!


ORMs based on Scott Ambler pattern are miles and miles ahead the tipical DAO approach.


My apologies, I don't wish to hijack the thread, but you could explain more about the "Scott Ambler pattern" approach to ORM, or where I might find some nice documentation? I googled it and found a bunch of stuff about Scott Ambler, but I'd like to know more about the specific pattern to which you're referring. Thank you!!

By the way, I find JPOX to be superior to Hibernate in most areas, too. Not having to override equals/hashcode is a godsend.

Ryan

Mainly these.
http://www.ambysoft.com/essays/persistenceLayer.html
http://www.agiledata.org/essays/impedanceMismatch.html
http://www.agiledata.org/essays/mappingObjects.html
http://www.agiledata.org/essays/keys.html

But the whole site www.ambysoft.com is worth a tour.
Have a nice reading.

Guido
----------------------------------------
Guido Anzuoni
http://www.objectmagic.org
[Jan 29, 2008 4:42:24 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread