← The Tao of Objects 1990

The Tao of Objects 1990

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

PDF page 12

THE TAO OF OBJECTS

THE TAO OF OBJECTS History and Concepts When the Simula language was developed in Scandinavia in the late sixties, its designers were trying to make the process of simulation easier (hence the name). Simulations always seem to involve a group of things -customers in line in a bank, molecules of air, migrating animals - in short, a lot of objects. An object knows things about itself: It has an internal state, or characteristics. It can also do things: It has external operations, or behaviors. It turns out that this also describes the data types built into a programming language. It's just that the data types cannot express the features necessary to model a real-world system. Existing languages engendered very messy code when a simulation was created because their types were so limited. It looked like the only way to make simulation easy was to change the language so the programmer could add new types of data. This abstract data typing is a fundamental concept in object-oriented programming. Abstract data types work almost exactly like built-in types: You can create variables of a type (called instances in object-oriented parlance) and manipulate those vari- ables (called sending messages; you send a message and the variable figures out what to do with it). The language designers also discovered that a type does more than describe the constraints on a set of objects; it also has a relationship with other types. Two types can have characteristics and behaviors in common, but one type may contain more characteristics than another and may also handle more messages (or handle them differently). Inheritance was developed to express this relationship between types. It uses the concept of base types and derived types. A base type has all the characteristics and behaviors that are shared among the types derived from it. You create a base type to represent the core of your ideas about the objects in your system. From it, you derive other types to express the different ways that core can be realized. For example, a garbage-recycling machine sorts pieces of garbage. The base type is garbage, and each piece of garbage has a weight, a value, and so on and can be shredded, melted, or decomposed. From this, we derive specific types of garbage that may have additional characteristics (a bottle has a color) or behaviors (an aluminum can may be crushed, a steel can is magnetic). In addition, some behaviors 4

Languages
English