Hello,
I am still wondering how to use proxies appropriately.
Someone else must have done this before.
> -----Original Message-----
>
> I think it is not always necessary to load the referenced object to
> find whether it is null, since the key of the referenced object is
> known when the first object is loaded. For example, in a particular
> application a key of zero might mean the referenced object is null.
> Maybe the reference descriptor could be extended to include
> an attribute
> such as null-key="0" to represent this knowledge.
I agree, that would be a nice feature.
> >In short: Is is intended that a null-reference
> >is wrapped by a proxy?
> >
> >It is unconvenient for several reasons. It
> >particular, proxies are not as transparent
> >as they could be.
Suppose I want to output a.b.getMsg()
if and only if a.b != null.
If b is not proxied, I simply write
if (a.b!=null)
System.out.println(a.b.getMsg())
If b is proxied, however, the above will throw
a NullPointerException. So, what's the solution?
(An unacceptable solution would be to allow that exception
to be thrown and then catch and ignore it.)
Do I have to test the field-ref field in some way?
Thank you for your help.
Olli
P.S. I had troubles accessing the list
the last two days.
--
Dr. Oliver Matz
ppi Media GmbH
Deliusstra�e 10
D-24114 Kiel
phone +49 (0) 43 1-53 53-422
fax +49 (0) 43 1-53 53-2 22
email mailto:[EMAIL PROTECTED]
web www.ppi.de
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]