This introduction is written for domain experts, participating in the process of knowledge engineering. More specifically it is intended for domain experts participating in IMT project. It does not require any programming experience as a prerequisite.
Non-programmers hearing about classes and objects often think of them as a part of computer jargon. Yet the meaning of these concepts is close to one they have in the context of the common language. Class usually mean a class of objects - that is a group of objects sharing similar features. Objects in the world of computers are data structures which often represent real world objects. Thus, Object Oriented Programming (OOP) employ the notion of taxonomy or classification as a metaphor for structuring of data.
You can look around you now and see many examples of real-world objects: your cat, your desk, your computer, your bicycle and so on. These real-world objects share two characteristics: they all have state and behavior. For example, cats have state (name, color, breed, hunger) and behavior (playing, eating, sleeping). Bicycles have state (current gear, current pedal cadence, two wheels, number of gears) and behavior (braking, accelerating, slowing down, changing gears).
Software objects are modeled after real-world objects in that they too have state and behavior. A software object maintains its state in one or more attributes. Attributes are identified by their names. A software object implements its behavior with methods. Thus, a software object is a bundle of related attributes and methods.
You can represent real-world objects by using software objects. In the real world, you often have many objects of the same kind. For example, your bicycle is just one of many bicycles in the world. Using object-oriented terminology, we say that your bicycle object is an instance of the class bicycle. The class for our bicycle example would declare the attributes necessary to represent the current gear, the current cadence, and so on, for each bicycle object. The class would also declare and provide implementations for the instance methods that allow the rider to change gears, brake, and change the pedaling cadence. All instances of the class bicycle will contain these attributes and methods.
The classes in the real world are often grouped into hierarchies or taxonomies. For example, mountain bikes, racing bikes, and tandems are 3 different types of bicycles. In object-oriented terminology, mountain bikes, racing bikes, and tandems are all subclasses of the bicycle class. Similarly, the bicycle class is the superclass for these 3 classes.
Inheritance provides a powerful and natural mechanism for organizing and structuring software programs. Each subclass inherits its attributes from the superclass. Mountain bikes, racing bikes, and tandems share some attributes: cadence, speed, and the like. Also, each subclass inherits methods from the superclass. Mountain bikes, racing bikes, and tandems share some behaviors: for example, braking and changing pedaling speed.
However, subclasses are not limited to the state and behaviors provided to them by their superclass. Subclasses can add attributes and methods to the ones they inherit from the superclass. Tandem bicycles have two seats and two sets of handle bars; some mountain bikes have an extra set of gears with a lower gear ratio. Subclasses can also override inherited methods and provide specialized implementations for those methods.
Given above is a description of the most common ideas of OOP. And here is the difficult part: although all Object -Oriented languages use the same underlying metaphor, classes and objects have slightly different properties and functions in various languages. Thus, the precise meaning of these concepts can be defined only in the context of a particular computer language.
C 2003 S. Krivov Send your comments to skrivov@zoo.uvm.edu