Re: Retrieving context from a shared lib
Saturday, October 20, 2007 07:15 PM
Maybe this is a chance to consider a "proxy" (isn't that one of the original GOF design patterns?) ...... you could inject a "proxy" that implements the same interface, does its logging on the side, and then invokes the original api.
So the client/invoking applications call your proxy class's methods, and it does some internal monitoring or whatever, before turning around and actually calling the library api's 'real' implementation classes.
And you add an explicit argument, to the method calls in the proxy's interface, to make it easy for you to track and identify the caller.