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: Mona Wagner   on May 29

As i told before , it is so important why someone choose this idea for retrieving object graph by the lazy association in the client-tier? Is it for researching or learning goals or not ? or just to create a phone book project and not more ?

We should be careful about its side-effects if we can't manage it well :
More round-trips [network and database] ( massive n+1 requests problems )
More marshaling and serialization latency
Data aliasing problems in the client-side
Loss of referential integrity in the client-side object graph
OutOfMemoryException
Less control
More restrictions
It can be an ideal conceptual solution  but it's not practical in action.



For some application  ranges (mission-critical OLTP systems) and scales it is not practical which you apply a transparent generic data loading/persisting proxy pattern for the lazy-associations of all entities, at least you need pagination as a first-class need and sometimes filtered collections (e.g snapshot of historical data) or detached on-the-fly objects without database transparent update and it seems these activities are more context-oriented.

I have just applied this pattern in the logic-layer (not the client-tier) which encapsulated into a service as a default transparent mechanism to decrease line of code and automated management to use the second level entity  cache, but it couldn't satisfied me because our services depends on data access helper technology  aspects (hibernate transparent tasks), however it has some important benefits for us and this a possible trade-off.

I believe, the transparent entity loading/persisting proxy pattern can be helpful for some cases and it can be poison for other cases or it is better to say whenever you use an ORM framework and Pojo model you should be careful, if you can't handle it well consequently you will loose the performance.

In the last project which we have developed ( integrated core banking services based on ERP concepts with more than 200 business entities and 300 tables ) i have reviewed all of mappings more than 5 times depends on usage to ensure everything is in the best way to get a better TPS.

Finally, i prefer to use passive business entities ( DTO ) in the client  side and i recommend you follow this way as a best practice if you want to control risks and you are not interested to fail your real project.

Share: 

 

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

 


Tagged: