HP SunSoft Pascal 4.0 User Manual

Page 246

Advertising
background image

222

Pascal 4.0 User’s Guide

10

Tools

This kit is a collection of functions. The runtime system is based on each
application having access to a server-based Notifier, which distributes input to
the appropriate window, and a Window Manager, which manages overlapping
windows. There is also a Selection Service for exchanging data between
windows (in the same or different processes).

Objects

XView is an object-oriented system. XView applications create and manipulate
XView objects that are associated with XView packages. Objects in the same
package share common properties. The major objects are windows, icons,
cursors, menus, scrollbars, and frames. A frame contains non-overlapping
subwindows within its borders. You manipulate an object by passing a unique
identifier or handle for that object to procedures associated with that object.

Object-Oriented Programming

Traditional programs are made up of procedures. When you need to operate
on some data, you pass the data to a procedure. This style of programming
can be referred to as procedure-oriented programming.

In object-oriented programming, the data are organized into objects, which are
similar to records in that an object can contain data fields of different types. In
addition to data, though, objects also have associated procedures, called
methods. The methods of an object generally perform all operations that can
be performed on the data of the object. When you need to operate on the data
in an object, you direct the object to do the operation. This is referred to as
sending a message to the object, and is similar to calling a procedure.

Each object is an instance of a given class. A class is much like a type in that it
defines a kind of object. Creating an instance of a given class is much like
declaring a variable of a given type, since creating an instance of a class creates
an object that has the properties and characteristics defined for its class.

Classes are different from types in that a class can inherit data fields and
methods from another class. In fact, you always define a new class by
declaring it a subclass of some class. The new class is called a child or
descendant class; the old class is called a superclass, parent, or ancestor class.
A descendant can itself have descendants. Thus, classes form a tree structure,

Advertising