asked on
ASKER
ASKER
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY
An interface defines a contract - something anything implementing that interface MUST do. It can NEVER specify how that something is done.
An abstract class is similar in that it also defines what must be done by a class implementing it, but it can have some implementation as well. In many cases, these implementations are considered as default implementations and can be overridden in derived classes. If derived classes don't ovverride it, than the abstract class's implementation is used. If you want something that can be used in all derived classes, you can put it in the base class.
Although they both provide a contract of sorts, they are different. A class can implement many intrerfaces, but can only have a single base class. Using an interface, when you publish it, it's pretty much sealed. Any change in the interface will require you to change every implementation of that interface. If you publish the interface to many developers, that's not really an option. Using an abstract base class, you can add some behaviour / data to the base class and if done properly, it won't need any changes in code for classes deriving from the base class. All existing code will exist to work. But this takes away the single base class a class can derive from and enforces the "evil" of inheritance.
Think of an interface in terms of behaviour and abstract base classes in terms of implementation.
Reference articles:
http://forums.asp.net/t/1523088.aspx
http://www.codeproject.com/Questions/43970/Real-world-examples-of-abstract-classes-and-interf.aspx