-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: CGLib, how to use?
PostPosted: Thu Aug 05, 2004 5:47 am 
Beginner
Beginner

Joined: Tue Apr 06, 2004 6:13 pm
Posts: 39
Location: Pune, Maharashtra, INDIA
Hi,

Hibernate uses CGLib to avoid using reflection (and uses the runtime generated code).

Where can I find - How to use CGLib in my own project?

In a layered app one would have a DAO class which will use Hibernate fill up a POJO
and then map the Pojo to a Value Object (for use by the rest of the app)
and vice versa (map VO to a POJO for persisting)

Basically the POJO and VO are almost the same!

So would like to experiment with CGLib to write a single piece to achieve this mapping.
CGLib = optomized reflection is'nt it? :-)

_________________
thks
G1


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2004 5:49 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
In a Hibernate app, there are not many good reasons to use a VO (or DTO).

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2004 5:59 am 
Beginner
Beginner

Joined: Tue Apr 06, 2004 6:13 pm
Posts: 39
Location: Pune, Maharashtra, INDIA
here-in VO is not Value Objects per se.

Those objects in my app are perfixed with 'VO'.

They are populated by business objects (by invoking JDBC) and made avalable to the UI layer. On the other side, values updated by users in the JSP, are received by the business object (in a VO) and persisted.

The goal - not to expose the objects handled by the database to objects handled by the UI layer.

_________________
thks
G1


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2004 6:01 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Why?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2004 6:09 am 
Beginner
Beginner

Joined: Tue Apr 06, 2004 6:13 pm
Posts: 39
Location: Pune, Maharashtra, INDIA
Well thats the sad part.

I have joined this project midway and this VO + BO + DAO + JDBC layer is already in place. I had a hard time convincing my peers to incorporate Hibernate.
(Had been restricted to changing the JDBC layer alone. Cannot change the BO or VO)

But finally failed!

Reasons -
1. Time that will be required develop the 'binder' methods. Binding POJO to VO and vice versa. (so was looking up CGLib)
2. Trust! My peers have had a bad experience in the past with another open source OR tool - Castor.
3. They are not convinced about Hibernate performance as no public statistics are available.
4. Finally it looks like the existing architecture would have to be changed to incorporate Hibernate - especially because of the in-house transaction protocol built in.

PS: I have use hibernate in my previous projects and will always stand by it.

_________________
thks
G1


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2004 6:11 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
What you are looking for is called a DTO Assembler. It's not really Hibernate related, so you will find better answers if you Google for it.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2004 6:46 am 
Beginner
Beginner

Joined: Tue Apr 06, 2004 6:13 pm
Posts: 39
Location: Pune, Maharashtra, INDIA
thx

_________________
thks
G1


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.