Object-Oriented Terminology

To begin, you will take a look at the word object itself, along with the related class and instance terms. Then you will move on to discuss the four terms that define the major functionality in the object-oriented world: abstraction, encapsulation, polymorphism, and inheritance.

Objects, Classes, and Instances

An object is a code-based abstraction of a real-world entity or relationship. For instance, you might have a Customer object that represents a real-world customer, such as customer number 123, or you might have a File object that represents C:\config.sys on your computer's hard drive.

A closely related term is class. A class is the code that defines an object, and all objects are created based on a class. A class is the definition which explains the properties and behavior of an object. It provides the basis from which you create instances of specific objects. For example, in order to have a Customer object representing customer number 123, you must first have a Customer class that contains all of the code (methods, properties, events, variables, and so on) necessary to create Customer objects. Based on that class, you can create any number of Customer instances. Each instance of the object Customer is identical to the others, except that it may contain different data. This means that each object represents a different customer.

Composition of an Object

You use an interface to get access to an object's data and behaviors. This defines a contract ...

Get Professional Visual Basic 2012 and .NET 4.5 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.