Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Carolina Lopez   on May 29 In Java Category.

  
Question Answered By: Dang Tran   on May 29

Based on what you explained, I assume you have a fat client  project and you are trying to use lazy loading on the client side. There are some ORMs that have this feature. And I remember that Mr. Gavin King once addressed this issue on a thread in hibernate forum and insisted that this is not a good  design and he will never consider this to be implemented in Hibernate. I am sure you can find the discussion in Hibernate forum.

But apart from what he said, I believe that this is not a good design. Why?

Because You can justify your fetching  strategy and take away all of these complications.
Of course you can use JDK dynamic proxy, javassist or cglib to do this .Technically you are on the right track and there is no doubt about it. You can use an introduction advice using any AOP framework to do this but this is beyond the scope of a project that needs lazyloading on its client side. This is what must be done inside a framework.
And it cannot be used widely because in order to use it, a developer that just wants to load an object from database must be familiar with Aspect Oriented Patterns and restrictions, JDBC, Object Relational Mapping techniques along with Caching and this is beyond the abilities of a normal developer to be used extensively. And a framework is to facilitate problems along with hiding the complexities. This is complexity itself.
My answer is no. Never go there. Learn how to improve your fetching strategy instead...

Share: 

 

This Question has 13 more answer(s). View Complete Question Thread

 


Tagged: