Programming terminology: objects, properties and classes

This note introduces some key programming terms, which are illustrated by this message output program:

This user interface of this program has four objects:

Each of these objects has several properties and those properties have values. For example:

In this example, we have used objects that appear in a user interface. Not all objects appear in the user interface. For example, in writing a personal scheduling program, you might define an object that was an appointment with properties like date, time, and purpose.

We will focus on user interface objects for now. There are many others beside Forms, Buttons and TextBoxes, for example:

Every object is an instance of a class. For example, Buttons are a class of object, and two of the objects in the user interface of our message output program are instances of the class Button. The other object in the form is an instance of the class TextBox.

You can think of a class as a template for creating objects. The computer uses that template to create new instances of the class. When a new object is created, the class template tells the computer how much memory to set aside, how many properties the object should have, what their default values are, etc.

Every object has a name so the program can refer to it. Do not confuse the name of an object with the value of its Text property. You must see the program to know the name of an object -- it is not shown in the user interface.

Note that this terminology can be used to describe real world objects as well as objects in computer programs. For example, Dog is a class of object. I have two particular dogs, Maggie and Minnie. Maggie and Minnie are instances of the class dog. One of the properties of dogs is color," and the value of Maggie's color property is white. The value of Minnie's color property is brown.


Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.