.
Abstraction
Abstraction is "the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a means for specifying which variation to use" (Richard Gabriel).
An abstract class is a parent class that allows inheritance but can never be instantiated. Abstract classes contain one or more abstract methods that do not have implementation. Abstract classes allow specialization of inherited classes.
Polymorphism
Polymorphism allows objects to be represented in multiple forms. Even though classes are derived or inherited from the same parent class, each derived class will have its own behavior. Polymorphism is a concept linked to inheritance and assures that derived classes have the same functions even though each derived class performs different operations.
Virtual keyword
The virtual keyword allows polymorphism too. A virtual property or method has an implementation in the base class, and can be overriden in the derived classes.
To create a virtual member in C#, use the virtual keyword:
public virtual void Draw()
To create a virtual member in VB.NET, use the Overridable keyword:
Public Overridable Function Draw()
Override keyword
Overriding is the action of modifying or replacing the implementation of the parent class with a new one. Parent classes with virtual or abstract members allow derived classes to override them.
Solution for the QlikView, Biztalk, DotNet and MSBI real time development problems
Search This Blog
Monday, June 1, 2009
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Error : Could not store transport type data for Receive Location 'EAISolutionReceiveRequestLocation' to config store. Prima...
-
Difference between C# var and Javascript var C# var i = 10; // implicitly typed int i = 10; //explicitly typed //Initialization is man...
-
I am getting below error while executing stored procedure from C# (Ado.net, entity framework) String[2]: the Size property has an invalid ...
-
Review the permissions of the user that you're trying to impersonate. In my situation, I was only getting the error on my development ...
-
Migration from Visual Studio 2008 to 2013 Without any code changes I successfully migrated from VS 2008 to 2013 but when running website f...
No comments:
Post a Comment