I wish there was a FAQ somewhere that explained when objects were initialized. I am totally baffled as 90% of my objects always return true for isInitialized, then I have a few that return false.
I am using some lazy collections, but it seems as if just asking isInitialized is causing them to be initialized? Furthermore, do I ask if my object is initialized, or should I be asking if the objects collection is initialized? I am lost there two so I ask for both the object and the collection it holds. So I have a jumbo almost recursive method that initializes everything but usually does nothing because most objects are either already initialized, or get initialized as soon as I pass them to 'isInitialized.'
Exactly what is a candidate for initialization? is it the object, or is it the reference held by another object? For example
Code:
class One{
List l;
B b;
}
class B {
List x;
}
Which of these make sense? And under what conditions? proxy/noproxy/lazy collection/eager collection? The only one that ever shows need for initialization to me is "D"
One object = getOne();
A. isInitialized(object);
B. isInitialized(object.l);
C. isInitialized(object.b);
D. isInitialized(object.b.x);
Thanks. As it stands, even calling 'initialize' has not been sufficient to ensure my objects/collections are all loaded, but maybe I just missed a few!?