Eswar Rao wrote:I have an object retrived from the factory method of a thirdparty library and I want to override a method on this object.
Please clarify How best I can do this.
If it implements an interface (as most factory objects do), write a wrapper class that implements the same interface, and:
1. Implement your own version of the particular method.
2. Implement the rest of the methods as forwarders.
You might want to look at the Decorator Pattern for more info.
If it doesn't, you have more of a problem.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here