OOP Concepts:
1. POLYMORPHISM: In object-oriented programming, polymorphism (from the Greek meaning "having multiple forms") is the characteristic of being able to assign a different meaning or usage to something in different contexts - specifically, to allow an entity such as a variable, a function, or an object to have more than one form.
2.ENCAPSULATION: Conceptually, encapsulation means hiding the internal details of a class's operation.Goal of encapsulation: use an object without understanding or depending on its internal details.
3.INHERITANCE: Inheritance is used to establish hierarchical class relationships.In inheritance, one class (the subclass) adopts (inherits) the features of another class (the superclass).
4.ABSTRACTION:In object technology, determining the essential characteristics of an object. Abstraction is one of the basic principles of object-oriented design, which allows for creating user-defined data types, known as objects.
Thursday, March 20, 2008
OOP Concepts
Posted by
dotneteasy
at
5:16 PM
0
comments
Labels: oop
Wednesday, March 19, 2008
Dispose(), Destructor/Finalizer
Destructors are called by GC (non-deterministic) ~ClassName() in C# & Finalize() method in VB.NET when GC determines it is time for garbage collection.
Not the best place to put cleanup code.
Ex: open a database connection and put the cleanup code in the Destructor. That DB connection might stay open for the life of the entire application. Not good!
Dispose() method:
A better place to put cleanup code.
Mostly used to cleanup unmanaged resources.
using{} statement automatically calls the Dispose() before exiting.
Recommended to be called only if the object is resource intensive.
References:
http://www.dotnetspider.com/qa/Question1450.aspx
Posted by
dotneteasy
at
6:12 PM
0
comments