November 2002
Intermediate to advanced
432 pages
9h 20m
English
One particularly nasty problem that occurs when one is building interception plumbing is the need to prevent non-intercepted references to an object from leaking out to the outside world, thus giving callers an opportunity to bypass the services provided by the interceptors. Consider, for example, the following simple class:
public class Bob : MarshalByRefObject {
public void f() {}
public Bob GetIt() {
return this; // danger!
}
}
In this simple example, the GetIt method returns a reference to the target object. Had a transparent proxy been between the caller and the object, the client would now have two ways to reference the object: one direct and one indirect via the proxy. Now consider the following client code:
static ...
Read now
Unlock full access