You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Glen Stampoultzis <gs...@iinet.net.au> on 2004/08/02 13:06:03 UTC
Tapestry and hibernate
Thomas Dolby has put forward some of his idea's on using tapestry and
hibernate together (http://www.jroller.com/page/cardsharp/20040728) and I
was wondering what people thought about this.
To be honest I'm not sure I agree with his thoughts on using objects
instead of id's. Most of the problems I've had when developing my app with
hibernate and tapestry have been related to detached objects causing all
sorts of exceptions. My most recent thinking was to avoid creating
detached objects by using id's in preference to persistent objects. It's
usually not too much work to retrieve the object given the id and hibernate
is pretty efficient about it.
What have other people found? Which approach is better?
Regards,
Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/
RE: Tapestry and hibernate
Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
AFAIK, a proxied object's lazily initialized collections are not serialized,
so this might not be a problem.
-----Original Message-----
From: Scott Ellsworth [mailto:scott@alodar.com]
Sent: Monday, August 02, 2004 6:54 PM
To: Tapestry users
Subject: Re: Tapestry and hibernate
On Aug 2, 2004, at 4:06 AM, Glen Stampoultzis wrote:
>
> Thomas Dolby has put forward some of his idea's on using tapestry and
> hibernate together (http://www.jroller.com/page/cardsharp/20040728)
> and I was wondering what people thought about this.
>
> To be honest I'm not sure I agree with his thoughts on using objects
> instead of id's.
If nothing else, a detached object takes up a lot of room when you
serialize it, and thus if you ever want to refer to a list, you are
going to have very large pages that take forever to load. A list of
ids is usually a bit smaller. It also can make your direct links more
robust to bookmarking.
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and hibernate
Posted by Scott Ellsworth <sc...@alodar.com>.
On Aug 2, 2004, at 4:06 AM, Glen Stampoultzis wrote:
>
> Thomas Dolby has put forward some of his idea's on using tapestry and
> hibernate together (http://www.jroller.com/page/cardsharp/20040728)
> and I was wondering what people thought about this.
>
> To be honest I'm not sure I agree with his thoughts on using objects
> instead of id's.
If nothing else, a detached object takes up a lot of room when you
serialize it, and thus if you ever want to refer to a list, you are
going to have very large pages that take forever to load. A list of
ids is usually a bit smaller. It also can make your direct links more
robust to bookmarking.
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and hibernate
Posted by Eric Schneider <er...@centralparksoftware.com>.
Yeah, I'm sure there are scenarios where using the fully inflated
object would not be ideal. But, this is more of an issue with the
component (and ie's handling of long urls), not the whole framework.
e.
On Aug 2, 2004, at 11:57 AM, Ido M. Tamir wrote:
> On Monday 02 August 2004 17:10, Eric Schneider wrote:
>
>> I'd also have to agree with Thomas Dolby's suggestions on
>> Tapestry/Hibernate development. Passing around object ids instead of
>> fully inflated objects exposes your pks and waters down the usefulness
>> of Tapestry.
>>
>
> But if you use the contrib:table component and try to create a link to
> a
> detailed sheet with the fully initialized object for one of your
> objects in
> the table you have to pass around the id and not the object.
> The object would create overlong urls, which would be a little bit ugly
> and they make IE5 stall.
>
> best wishes
> ido
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and hibernate
Posted by "Ido M. Tamir" <ta...@imp.univie.ac.at>.
On Monday 02 August 2004 17:10, Eric Schneider wrote:
> I'd also have to agree with Thomas Dolby's suggestions on
> Tapestry/Hibernate development. Passing around object ids instead of
> fully inflated objects exposes your pks and waters down the usefulness
> of Tapestry.
>
But if you use the contrib:table component and try to create a link to a
detailed sheet with the fully initialized object for one of your objects in
the table you have to pass around the id and not the object.
The object would create overlong urls, which would be a little bit ugly
and they make IE5 stall.
best wishes
ido
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and hibernate
Posted by Eric Schneider <er...@centralparksoftware.com>.
> The biggest issue is the loose coupling of hibernate with tapestry.
> I'm waiting to find a good support for Cayenne in Spring (which I am
> not using on nowadays' project) so that I can transparently replace
> hibernate by cayenne and vice versa anyday I want (I prefer Cayenne,
> even though I think Hibernate is great)
Spring support for Cayenne is definitely on the way.
I'd also have to agree with Thomas Dolby's suggestions on
Tapestry/Hibernate development. Passing around object ids instead of
fully inflated objects exposes your pks and waters down the usefulness
of Tapestry.
e.
On Aug 2, 2004, at 10:10 AM, Cyril Godefroy wrote:
> To be honest, I totally agree with his thoughts on that matter.
> Actually, I felt happy when I found that his recommendations were the
> one I used. The id issue seems a little bit strange to me. Remembers
> me of php ;-) If you are happy with objects, why use ids? If you are
> happy with ids, why use orm? jdbc is 'pretty efficient' and it's
> usually not too much work.
>
> The biggest issue is the loose coupling of hibernate with tapestry.
> I'm waiting to find a good support for Cayenne in Spring (which I am
> not using on nowadays' project) so that I can transparently replace
> hibernate by cayenne and vice versa anyday I want (I prefer Cayenne,
> even though I think Hibernate is great)
>
> On Aug 2, 2004, at 3:47 PM, Filip S. Adamsen wrote:
>
>> I only keep the state necessary to restore the object in question, as
>> I find
>> this to be the better approach.
>>
>> -Filip S. Adamsen
>>
>> -----Original Message-----
>> From: Glen Stampoultzis [mailto:gstamp@iinet.net.au]
>> Sent: Monday, August 02, 2004 1:06 PM
>> To: Tapestry users
>> Subject: Tapestry and hibernate
>>
>>
>> Thomas Dolby has put forward some of his idea's on using tapestry and
>> hibernate together (http://www.jroller.com/page/cardsharp/20040728)
>> and I
>> was wondering what people thought about this.
>>
>> To be honest I'm not sure I agree with his thoughts on using objects
>> instead of id's. Most of the problems I've had when developing my
>> app with
>> hibernate and tapestry have been related to detached objects causing
>> all
>> sorts of exceptions. My most recent thinking was to avoid creating
>> detached objects by using id's in preference to persistent objects.
>> It's
>> usually not too much work to retrieve the object given the id and
>> hibernate
>> is pretty efficient about it.
>>
>> What have other people found? Which approach is better?
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and hibernate
Posted by Cyril Godefroy <cy...@ecomposite.fr>.
To be honest, I totally agree with his thoughts on that matter.
Actually, I felt happy when I found that his recommendations were the
one I used. The id issue seems a little bit strange to me. Remembers me
of php ;-) If you are happy with objects, why use ids? If you are happy
with ids, why use orm? jdbc is 'pretty efficient' and it's usually not
too much work.
The biggest issue is the loose coupling of hibernate with tapestry. I'm
waiting to find a good support for Cayenne in Spring (which I am not
using on nowadays' project) so that I can transparently replace
hibernate by cayenne and vice versa anyday I want (I prefer Cayenne,
even though I think Hibernate is great)
On Aug 2, 2004, at 3:47 PM, Filip S. Adamsen wrote:
> I only keep the state necessary to restore the object in question, as
> I find
> this to be the better approach.
>
> -Filip S. Adamsen
>
> -----Original Message-----
> From: Glen Stampoultzis [mailto:gstamp@iinet.net.au]
> Sent: Monday, August 02, 2004 1:06 PM
> To: Tapestry users
> Subject: Tapestry and hibernate
>
>
> Thomas Dolby has put forward some of his idea's on using tapestry and
> hibernate together (http://www.jroller.com/page/cardsharp/20040728)
> and I
> was wondering what people thought about this.
>
> To be honest I'm not sure I agree with his thoughts on using objects
> instead of id's. Most of the problems I've had when developing my app
> with
> hibernate and tapestry have been related to detached objects causing
> all
> sorts of exceptions. My most recent thinking was to avoid creating
> detached objects by using id's in preference to persistent objects.
> It's
> usually not too much work to retrieve the object given the id and
> hibernate
> is pretty efficient about it.
>
> What have other people found? Which approach is better?
RE: Tapestry and hibernate
Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
I only keep the state necessary to restore the object in question, as I find
this to be the better approach.
-Filip S. Adamsen
-----Original Message-----
From: Glen Stampoultzis [mailto:gstamp@iinet.net.au]
Sent: Monday, August 02, 2004 1:06 PM
To: Tapestry users
Subject: Tapestry and hibernate
Thomas Dolby has put forward some of his idea's on using tapestry and
hibernate together (http://www.jroller.com/page/cardsharp/20040728) and I
was wondering what people thought about this.
To be honest I'm not sure I agree with his thoughts on using objects
instead of id's. Most of the problems I've had when developing my app with
hibernate and tapestry have been related to detached objects causing all
sorts of exceptions. My most recent thinking was to avoid creating
detached objects by using id's in preference to persistent objects. It's
usually not too much work to retrieve the object given the id and hibernate
is pretty efficient about it.
What have other people found? Which approach is better?
Regards,
Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org