Terms and Definitions

Team-Fly team-fly    

 
ADO.NET Programming in Visual Basic .NET
By Steve  Holzner, Bob  Howell

Table of Contents
Chapter 2.   Object-Oriented Programming in Visual Basic .NET


Since VB 6 was not an object-oriented language, you may not be familiar with some of the terms. Let's begin with definitions: .

  • Class A programming entity that contains members and methods for accessing the members . A class becomes a data type so that identifiers can be declared that reference instances of the class. The class is not an object; it is the definition of an object. Classes can inherit from other classes and can be inherited by other classes.

  • Object An instance of a class. Once a class is declared and instantiated it becomes an object. There can be many objects of the same class.

  • Structure A structure is similar to a class in that it can contain members and methods, but it cannot be inherited. It is also considered a value class, meaning it does not have to be initialized as new. Simply declaring a variable as the structure type creates an instance. This is an advanced form of the VB 6 user -defined type. I will use the term class to refer to both classes and structures, except where their behavior is different.

  • Member A member is data or methods that are defined within a class definition. They are commonly referred to as member variables , Member Methods, or just members.

  • Methods Methods are procedures that are defined as public and control access to the member data. They can also perform operations on the data, such as printing a report or saving it to disk.

  • Properties Properties are like methods but can appear on the left side of an assignment. They are primarily used as access control mechanisms to provide a way to get and update the member data.

  • Class hierarchy The family tree of a class library. Also called an inheritance tree, it shows the relationship between all of the classes in the library.

  • Derived class A class that was inherited from another.

  • Parent class The class from which the current class was derived.

  • Base class Same as parent class.

  • Abstract class This type of class cannot be instantiated. It is meant to act as a template for other classes and must be derived from to be used. In an abstract class, some methods must be overridden.

  • Overloading Overloading is how we implement polymorphism. You can have many procedures with the same name , as long as the parameter list is different by the data type and/or number of the parameters. This is an important distinction. The names of the parameters don't matter; it's the data types that make the procedures unique.

  • Overriding A method of a derived class can add functionality to that provided by the parent class.

  • Nested class A class declared within another class. Nested classes become subtypes of the type defined by the outer class.

  • Interface Those methods and properties visible to the "outside" from the class. These comprise the way users of your class interact with it.

  • Access modifier This is part of the class access mechanism. The access modifier appears as the first keyword in a procedure or variable declaration. Access modifiers can be applied to members and classes and have slightly different meanings when used with each.

  • Events Events are the programming construct used to pass notifications back from one class (called the event source) to the listening class (called the event sink or target).

  • Event handler A procedure in a listening class that is designated to handle or process the event(s) being sent by the event source.

  • Delegate Part of the event model. A delegate is similar to a function pointer except that it contains information about the function's parameter signature and containing class. Delegates are used mainly to dynamically wire events to procedures at runtime.

Now let's look at some of the less obscure ways OOP is used in VB. This will not be an exhaustive discussion. That is best left for a book on OOP. We will examine the most commonly used techniques as applied to VB. We will also try to help you avoid some common pitfalls.


Team-Fly team-fly    
Top


ADO. NET Programming in Visual Basic. NET
ADO.NET Programming in Visual Basic .NET (2nd Edition)
ISBN: 0131018817
EAN: 2147483647
Year: 2005
Pages: 123

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net