Jan 20, 2012 11:00 AM|gerrylowry|LINK
@ Surendiran you "wanted to know the problem in using the above in the wrong place".
You may wish to refer to:
"Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries", Second Edition, Krzysztof Cwalina; Brad Abrams; Addison-Wesley Professional, October
22, 2008; Print ISBN-10: 0-321-54561-3, Print ISBN-13: 978-0-321-54561-9, Web ISBN-10: 0-321-54567-2, Web ISBN-13: 978-0-321-54567-1, Pages in Print Edition: 480
classes are the preferred construct for exposing
The main drawback of
interfaces is that they are much less flexible than
classes when it comes to allowing for evolution of APIs. After you ship an
interface, the set of its members is fixed forever. Any additions to the
interface would break existing types that implement the
A class offers much more flexibility. You can add members to
classes that have already shipped. As long as the method is not
abstract (i.e., as long as you provide a default implementation of the method), any existing derived
classes continue to function unchanged.
note: while the book is mainly applicable to designing API's, much of its information is also applicable generically.