[plug] Data Abstraction
James Devenish
devenish at guild.uwa.edu.au
Wed Dec 17 15:41:47 WST 2003
In message <1071646383.9449.161.camel at latte.internal.itmaze.com.au>
on Wed, Dec 17, 2003 at 06:33:03PM +1100, Onno Benschop wrote:
> > Item_ref.blobname = Item_ref.descriptor_ref.blob_ref.name
>
> Which is exactly what I'm talking about, but of course, I can't refer to
> something that doesn't yet exist, nor can I use this particular
> construct in PHP AFAIK...
You can do that type of thing. But the above shows the Item storing the
name of the blob directly? That bit I don't understand. But as for the
"doesn't yet exist" problem, you'd replace the variable with a "method"
(in the OOP terminology). So:
$somevar = $item->get_descriptor()->get_blob()->get_name()
The get_descriptor() method would create the descriptor and could return
a reference to it (or to a fully-formed object hierarchy). Likewise, if
you have lazy instantiation then the blob object might not existing
until the descriptor's get_blob() method is called. It's up to you.
More information about the plug
mailing list