commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject RE: [proxy] vs proxytoys
Date Thu, 25 Aug 2005 07:22:10 GMT
James Carman wrote on Thursday, August 25, 2005 1:09 AM:

> Jörg,
> 
> Out of curiosity, what is the (real-life) use case where you
> would actually have a proxy object which doesn't delegate to
> some implementation?  I'm not saying there isn't one.  I may
> very well be just too ignorant to come up with one on my own.
> :-)  I can be quite narrow-minded at times.

The NullObject does not have a target and interestingly the Echoing toy (and therefore the
decorator as poor man's AOP can do without), but don't ask me why, there are at least unit
tests that ensure this ;-)
Another one is the multicaster that can have a lot or none targets.

> However, we could support a similar concept in commons-proxy
> by just using a MethodInterceptor and not actually calling
> MethodInvocation.proceed().  That way, it would never really
> get to the target object.  We could create a NullProvider
> (actually I just did it) which always returns null (extended
> ConstantProvider) and could be the target for that type of proxy.

Such a proxy seems quite natural <g>

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message