Deferred Instantiation
We have a collection business object that contains business objects. Within
this collection object we have an attribute which is itself a business
collection object. What we would like to do is this. We want to be able to
instantiate the "main" collection object without instantiating its
attribute's collection object (thus we wish to defer instantiation of
subcollections within this collection object).
As it stands to instantiate our subcollection object we perform something
like the following when the user calls a method on the main collection like
GetSubCollectAttrib():
if SubCollectionAttrib = NIL then
SubCollectionAttrib = ServerSO.GetSubCollection();
end if;
return SubCollectionAttrib;
My questions are these. Should a business object have any knowledge that a
ServerSO even exists? What other ways have people gotten around the issue
of deferred instantiation? (Or is there a white paper or tech note we should
be looking at.)
Thanks in advance.
Anthony J. Falabella
tony.falabella@hbo.com
[1144 byte] By [
] at [2007-11-25 5:01:00]

Tony -
There may well be problems with a business data object (BDO) referencing an
SO to fill in the deferred attributes - if the BDO migrates between
partitions the SO reference may become either unsupported or inappropriate.
One approach is to place the deferred instantiation logic in what has been
called a Partition-Visible object; this has been discussed previously in
this list - feel free to contact me for details. The BDO (or any other
party) can call this universal local facility to perform the deferred
instantiation, passing the BDO reference. A related problem is how to
determine which of three states an attribute is in: valued, deferred, or
NIL; using NIL for deferred is obviously a problem if three-way resolution
is needed. Not distinguishing between deferred and NIL states may be
expensive, if database i/o or other overhead is involved in instantiation.
Possible solutions that come to mind are paired flag attributes, flag
attributes reflecting the state of a whole group of value attributes, and
byte-string flags - I'd be interested in hearing othe suggestions on this
issue....
All the best -
Gerard R. Connolly
GRC Associates, Inc. - A Forte Consultancy
610/296-0688
at 2007-6-29 9:20:02 >
