What's All This About Objects?

The term "object," which was once a fairly well-defined technical term, has recently turned into a catch-all phrase for computer "things." When object-oriented programming came up in conversation recently, a personnel manager with little computer experience asked, "What's an object?" I answered, almost without thinking, "A thing." Any thing. The key to understanding computer objects is to understand how they compare with tangible objects in the real world.

One aspect of real-world objects is that the tasks they perform are inherent in the objects themselves. For example, you can use a teacup only for tasks physically suited to a small, open container with a flat bottom and a handle; you can drink liquid from a cup or use it to scoop sugar. Likewise, the tasks that users perform with a computer object must be inherent in the object itself. Computer objects should also represent real-world things that contain information--such as charts, worksheets, customer lists, or sales reports.

Technically, a computer object combines data with functions for using the data. It used to be that data was stored in one place (for example, in a database), and the means for accessing and using that data was stored elsewhere (for example, in a particular business application). Object-oriented programming languages such as Small Talk® and C++ let you bundle the data and the mechanism for accessing it into a single object. You can then build applications with these objects. For example, you can use Microsoft Excel's objects to build spreadsheet-based business applications.

Microsoft has expanded the notion of objects to include "programmable objects," which you can control through OLE automation. This increases usablity and reusability by making it possible to build applications that control another application's objects. For example, any application that supports OLE automation can use Microsoft Excel's objects. In fact, when you write VBA code to control Microsoft Excel, you're actually manipulating Microsoft Excel's objects through OLE automation.