Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lazy Properties in NHibernate
Message
From
27/01/2010 12:13:55
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
General information
Forum:
ASP.NET
Category:
Third party products
Miscellaneous
Thread ID:
01446159
Message ID:
01446188
Views:
33
>>>>New feature coming to NHibernate: http://ayende.com/Blog/archive/2010/01/27/nhibernate-new-feature-lazy-properties.aspx
>>>>
>>>>Does EF have this functionality available?
>>>
>>>Looks like it's in EF in .NET 4 - but I haven't tried it
>>>
>>>One thing I noticed in the link:
>>>
>>>"What about multiple lazy properties? NHibernate support them, but you need to keep one thing in mind. NHibernate will load *all* the entity’s lazy properties, not just the one that was immediately accessed."
>>>
>>>Not sure whether this is a good thing or a bad thing - bottom line is it will depend on the circumstances but there's nothing you can do about it. Also I've no idea whether EF will have the same behaviour.......
>>
>>Sure, but I would imagine that a lazy property would be an exception rather than the norm, right? So maybe it wouldn't be that big of a deal to load all of entity's lazy properties.
>
>Depends. Assume that you *do* have multiple properties with large storage requirements. To argue that it is important to be able to delay the loading of one of these until it is actually required obviously makes sense from an efficiency POV. But to force the loading of all other such properties as soon as one of them is needed seems to pretty much negate the benefit. Seems to me that if you are going to implement lazy loading then you should be able to load on demand on a property-by-property basis (or at least have the option of doing so)
>
>Again I've no idea what the EF behaviour will be in this respect.....

Yeah, I understand your point, but the existing functionality is still better than nothing.
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform