Next: , Previous: , Up: lib-objects   [Contents][Index]


10.25.7 Glossary

abstract class

A class that cannot have instances. Abstract classes are helpful in designing a class hierarchy, to contain the common parts of several concrete classes.

ancestor

One of a class’s superclasses, one of its superclasses’s superclasses, etc. Sometimes, for convenience, ancestor includes the class itself, along with its proper ancestors.

child

A synonym for subclass.

class

A class is defined by a description of the information its instances contain and the messages they respond to. Every object is an instance of one and only one class.

concrete class

A class that can have instances. Most classes are concrete.

create method

Specifies what actions should be taken when an instance of a class is created. A create method frequently provides initial slot values or specifies an action to be performed by the new object. A create message is sent to each new object by the create/2 predicate. A create message is a kind of send message.

descendant

One of a class’s subclasses, one of its subclasses’s subclasses, etc. Sometimes the word descendant includes the class itself, along with its proper descendants.

destroy method

Specifies what actions should be taken when an instance of a class is destroyed. A destroy message is sent to an object by the destroy/1 predicate. A destroy message is a kind of send message.

direct slot access

Fetching or storing a slot value without sending a message to the object. This should be used with care!

SICStus Objects allows direct access to a class’s slots only within its method definitions, via the fetch_slot/2 and store_slot/2 predicates.

get message

A message that inquires about some aspect of an object. Typically used to fetch slot values. Get methods are automatically generated for public slots. Get messages are written with the ‘>>’ operator.

inheritance

The process by which a class’s slots and methods are determined from an ancestor.

initial value

The value a slot is initialized to when an object is created. Every slot has a default initial value, which depends upon its type. You may specify different initial values in a class definition.

instance

Another word for object. The word instance draws attention to the class of which the object is an instance.

instance method

A method that may be defined differently for each instance of a class. The class may have a default method for this message, which is overridden by installing an instance method for a particular object.

message

A command to an object to perform an operation or to modify itself, or an inquiry into some aspect of the object. In SICStus Objects, a message is either a get message, a put message or a send message. The syntax for sending a message to an object is

Object Operator Message

where Operator is one of the following:

>>

get message

<<

put message

<-

send message

method

A class’s implementation of a particular message. You send messages to an object, but you define methods for a class.

method clause

A Prolog clause used to define a method for a class. A method clause has one of <-/2, <</2 or >>/2 as the principal functor of its head, and it can only appear within the scope of its class’s definition. A method’s definition may contain more than one message clause.

mixin class

A class that is intended to be combined (mixed in) with other classes, via multiple inheritance, to define new subclasses.

multiple inheritance

When a class names more than one superclass. Typically, it inherits slots and methods from each. In SICStus Objects, two different superclasses should not use the same slot name. And, if a message is defined by more than one superclass, then the class definition must specify which method to inherit.

object

A modifiable data item that holds information and responds to messages. Another word for instance.

parent class

A synonym for superclass.

private slot

A private slot is, by default, only accessible within methods of the class itself. Not even the descendants of the class may access its private slots, except through the class’s methods. Get and put methods are not automatically generated for a private slot, so it is only accessed via the methods you define. If the visibility of a slot is not specified, then it is private, rather than public or protected.

protected slot

A protected slot is, by default, only accessible within methods of the class itself and its descendants. Get and put methods are not automatically generated for a protected slot, so it is only accessed via the methods you define. If the visibility of a slot is not specified, then it is private, rather than public or protected.

SICStus Objects protected is similar to protected in C++.

public slot

A public slot is accessible via its own get and put methods, which are generated for it automatically. If no visibility is specified, then a slot is private, rather than public or protected.

put message

A message that modifies some aspect of an object. Typically used to store slot values. Put methods are automatically generated for public slots. Put messages are written with the ‘<<’ operator.

send message

The most common sort of message. Used for performing an operation on an object or for performing an action that depends upon an object. Send messages are written with the ‘<-’ operator.

send super

When a method for a class executes a shadowed superclass’s method. This allows a class to put a “wrapper” around its superclass’s method, making it unnecessary to duplicate the method just to make a small extension to it.

shadow

When a class defines its own method for a message defined by one of its ancestors, the new method hides or “shadows” the ancestor’s method. The new class’s descendants will inherit its method for that message, rather than its ancestors. That is, a class always inherits the “closer” of two methods for a message.

slot

A part of an instance that holds an individual datum. Like a member of a C struct or a field of a Pascal record.

subclass

A class that is a more specific case of a particular class. This is the opposite of superclass. A class does not name its subclasses; they are inferred.

superclass

A class that is a more general case of a particular class. Each class lists its superclasses.

term class

A class whose instances are represented as ordinary Prolog terms. The functor of these objects need not be the name of the class, and the arity need not be one.

term slot

A slot that can hold any Prolog term.

uninherit

Specify that a method from a superclass should not be inherited. This is similar to shadowing the superclass’s method, but does not specify a replacement for it.

visibility

A slot may be defined to be either public, protected, or private. By default, if no visibility is specified, then a slot is private.



Send feedback on this subject.