Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Large Composite Objects

 
Bobby Jakachira
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I would like to ask a question that has been troubling me a lot, both in Java and PHP

Lets say i have a POJO called Journal [variables - Articles List, Volumes List, Issues List]

Lets say I'm suppose to show Journal titles on the homepage.. what is the best way to load up the data from the repository?

Can I load say 20 journals each with all the lists and save in the cache?

Or should I only load what I think its necessary at the time (making round trips to the database).

Some of these objects becomes very large because of class composition. I page the results

or how far can anyone load data in a hierachy like this

journal->volume->issue->absctract : Which means a JOURNAL object will have a list of volumes, each having a list of Issues. Each issue a list of abstracts.


Is there a danger of loading the complete Journal object with paged lists results? Problem
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general I would avoid loading anything that you don't need.

If you just want the Journal titles, then just load the Journals, not any of their relationships.
I would recommend always making all relationships LAZY.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic