Object-Oriented Concepts
topic Objects and Classes
issue What is the difference between an object and a class?
applies to OO

Before we can discuss object-oriented (OO) concepts in any detail, we need to define some common OO terms. Objects and classes are two important terms for understanding OO. There are several different ways to look at the definition of objects and classes:

Metaphorical Class -> cookie cutter;
Object -> cookie
A class is like a cookie cutter. It defines the size and shape of the cookies. You can create objects from a class similar to creating cookies from a cookie cutter.
Visual Class->icon in toolbox;
Object-> control
If you use a visual drawing tool like the forms package in Visual Basic or the drawing features of the Microsoft Office products, you can think of the classes as represented in the toolbox. When you select a tool and draw a rectangle, you are creating an instance of the rectangle class.
Programmatical Class -> UDT;
Object -> values for UDT
A class is basically a user-defined data type, or abstract data type. Just as you used UDTs or structs, you can instead define classes. The objects represent a specific set of values for the UDT.
Philosophical Object -> thing;
Class -> description of like things
Basically, an object is just a thing. From a programmer's point of view, it is any thing involved in an application. For example, for an employee time tracking system, each employee is an object. However, you would not write routines for each employee at the company. Rather, you would write routines that described that general class of objects. So you would define an employee class that described the attributes and processing required for all employees.
OLE Class -> Interfaces;
Object -> Instantiation of the class
More precisely, a class is a unit of source code with one or more interfaces. of which some may be specified as public for external use. An object is a runtime instantiation of a class.
topic Properties and Methods
issue What is the difference between a property and a method?
applies to OO

Every object has some attributes associated with it. An employee has a name, employee number, address, and so on. These attributes are called properties.

Most objects also have behaviors. They do something within the scope of an application. An employee object may need to read itself from the disk or save itself back to the disk, for example. These behaviors are called methods.

All contents © 2004 InStep Technologies, Inc. All rights reserved.