Object Oriented Programming (OOP) Concepts April 19 2006
Abstraction (Abstract Class): 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. An abstract class is a parent class that allows inheritance but can never be instantiated. An example is the Shape Class. Creating an instance of a generic shape does not make sense but using the Shape Class to create a Square class does make sense.
Assembly:
An Assembly is a logical unit of code
- Assembly physically exist as DLLs or EXEs
- One assembly can contain one or more files
- The constituent files can include any file types like image files, text files etc. along with DLLs or EXEs
- When you compile your source code by default the exe/dll generated is actually an assembly
- Unless your code is bundled as assembly it can not be used in any other application
- When you talk about version of a component you are actually talking about version of the assembly to which the component belongs.
- Every assembly file contains information about itself. This information is called as Assembly Manifest.
Base Class: A parent Class.
Behavior: See Object Behavior
Child Class: A class that has inherited its state and behavior from another class.: A class that has inherited its state and behavior from another class.
Class: A class is a template for an object (e.g. A shape is a template, but a square is a specific object)
Class Block: The code area within a class, but not within class members.
Class declaration: A line of code where the class name and type are defined.
Class Members: These are the building blocks of a class. They include Namespace, Class Declaration, Fields, Constants, constructors, Properties, Events, Methods and Destructors.
Constants: A set of fields declared as constant within the class block.
Constructors: A method or group of method that contains code to initialize the class. Usually New(). When instantiating an Object, the constructor (New) is called.
Derived Class: A child Class.
Destructor: A method that is called when a class is destroyed.
Inheritance: The ability for a class (parent) to inherit its behavior and state to child classes. In the .NET framework, everything is derived from the System.Object class. This allows developers to manage generalization and specialization between objects.
Instance: An object that has been created (instantiated)
Internal: Allows access to the class member only in the same assembly.
Events: Responses that get “fired” or “triggered” after a specific user or application action.
Fields: A set of variables declared in a class block. These exist outside of methods (subs, functions), event handlers, constructors and destructors. They float in the class itself.
Generalization: An object encapsulates common state and behavior for a category of objects. Example is the Shape Class.
Method: Set of functions and sub-routines within a class.
Multiple Inheritance: The possibility that a child class can have multiple parents. The .NET framework does not support this but can be tricked to do this.
Namespace: A distinctive name for a class. This is used to organize a class within an assembly.
Object: An instance of a class. An instantiated class. (myShape = new Shape(); ) Objects are the building blocks of OOP and are commonly defined as variables or data structures that encapsulate behavior and data in a programmed unit.
Object Behavior: What the object can do as defined by methods
Object Identity: Every object is unique and can be differentiated from other objects. Each time an object is created (instantiated) the object identity is created.
Object State: The data (fields, constants, properties) stored within an object at any given moment.
Override (Keyword): Overriding is the action of modifying or replacing a method in a parent class with one in the child. Parent classes with virtual or abstract members allow derived classes to override them.
Polymorphism: Allows objects to be represented in multiple forms and contain their own behaviors. An example would be overriding a specific method that was defined in the parent class. The Shape class may have an abstract CalculateArea() method but the Square Class overrides this method with its own. Thus the object keeps the same general syntactical behavior as the parent while providing its own unique behavior. Facilitates an organized object hierarchy.
Private: Allows access to the class member only in the same class
Properties: The set of descriptive data of an object. These are basically was for the public to get at the Fields of an object.
Protected: Allows access to the class member only within the same class and from inherited classes.
Protected Internal: Protected and internal.
Public: Allows access to a class member from any other class
Sealed Class: A class that does not allow inheritance.
Specialization: An object can inherit the common state and behavior of a generic object. For example the Square class is a specialization of the Shape Class.
Static: Indicates that the member can be called without first instantiating the class.
Structures: Lightweight representations of objects that can have methods and properties. Similar to classes that contain arbitrary composite fields. Commonly used to act as user-defined primitives.
Subclass: A child class
Superclass: A parent Class
Virtual (Keyword): A virtual property or method has an implementation in the parent (base) class and can be overridden in the derived class. This facilitates Polymorphism.

Comments»
no comments yet - be the first?