Linguistic Foundation

Before I get too far, I should probably synchronize our vocabulary a bit. Until now, I've been a little general regarding some of the terms used to describe object-oriented programming concepts. In order to discuss object-oriented programming concepts in any detail, I need to be a little more precise with my vocabulary. The following list represents the most common object-oriented terms that I'll use in this chapter and throughout the rest of the book.

Class A class is the programmatic definition of an object. A class doesn't become an object until a client application or process instantiates the class. The common metaphor is to think of a class as a cookie cutter and an object as a cookie.

Class module A class module is your canvas, so to speak. It's a special code module in the development environment that is used solely to define classes.

Instantiate To instantiate an object is to give it life. Using the cookie cutter metaphor, a cookie is instantiated when you use the cookie cutter to create the cookie by separating it from the mass of cookie dough. There are a few ways that you can instantiate an object. Generally objects are instantiated using the New keyword. I'll show you the specifics of instantiation later in this chapter.

Interface An interface is the public face of a class. It represents the parts of the class that can be accessed by external processes.

Member A member refers to either a method or a property. The members of a class are the combination of all of the properties and methods of the class.

Method A method is an action that can be performed on or with an object.

Object To be precise, an object represents a specific instantiation of a class. However, many times the term object is used in conversation (and in writing) to refer to what is technically a class.

Object-Oriented Programming This is a programming paradigm in which a program is developed by creating numerous objects that work together to provide the desired functionality. An object comprises the data structures and algorithms necessary for the object to exhibit properties and methods that model the natural characteristics and actions of the object. VBA lacks a few capabilities that prevent it from being classified as a true object-oriented programming language.

Nonetheless, it has enough object-oriented features to allow you to think in terms of objects and realize much of the value of object-oriented programming.

Property A property is a characteristic of an object such as color, height, or name.

0 0

Post a comment