> -----Original Message-----
> From: Henri Tremblay [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 23, 2004 5:26 PM
> To: Joshua Davis; 'Gavin King'; 'hibernate-devel'
> Subject: Re: [Hibernate] Lazy components

[snip] 

> That said, the benefit of having lazy loading on components 
> will be to allow to load only a part of a db table row. The 
> fields mapped in the component won't be selected by 
> hibernate. 

The database might read the row anyway, so it may or may not make any
difference from the database server's perspective.  Speaking from experience
with applications that have many, complex domain objects my own preference
would be to use separate tables and one-to-one mappings.

> From my point of view, selecting a little less 
> fields in the same table will rarely provide a big 
> performance gain. Especially if you then lazy load them 
> later. If there's a real gain, you should have put them in 
> another table anyway I think.

Yes, two queries are much more likely to take longer than one.  The
application must be analyzed carefully to see which components are
infrequently referenced in order to add the overhead.  Again, in my
experience most applications change enough over their lifetime that lazy
loading may become inappropriate (or appropriate) as the application
evolves.  Given that, I'd say that choosing the one-to-one mapping is the
best because configuring the lazy loading behavior is a simple configuration
parameter.





-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to