This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Thanks for your response. Solution 1 seems fine. I would however like to use soultion 2. When I tried it, I got an error- Cannot convert IMPL to type boolean. Is there any way, I can use solution 2 or something similar?
Originally posted by Lucky Singh: Hi, I have a package ABC. In that package, I have an interface, an implementation for the interface and a Driver that uses tests the application.
The object obviously does not recognize the method check. How do I overcome this problem so that I could use check() in the Driver but not include it in my interface?
Simply using interface inheritance, or horribly using a cast to a concrete type.
Now your implementation should implement the CheckableGreetings interface (if that indeed what it should do). Note that your provided source code sample contains errors, so I won't try to fix them based on assumptions. I hope the point is clear. Casting can always be avoided with a more approopriate abstraction. [ August 24, 2005: Message edited by: Tony Morris ]