CLASSES, OBJECTS, METHODS

We have said that, in Squeak, we have objects with a visual aspect and abstracts objects, like: Ordered Collection.

But when we talk about the "object" Ordered Collection we are doing a usual "mistake". Ordered Collection IS NOT an "object" ! It is the name of a "class". For the creation of the "object" we do:

                 ordCol := OrderedCollection new.

Really, the "object" is ordCol. It is an object of the "class" Ordered Collection.

For the creation of objects having a visual aspect we usualy don't use a line of code having "new"; we drag the icon of its class from somewhere to the "Squeak world".

We have talked about some of the methods of the class Ordered Collection. But it has many more methods. To see all the methods of the class you can open this page

Clicking in the name of the class you will have a new page:

Squeak has MANY classes. There are an "administractive structure", using a tree system, where the first level is the "category".

Look in the figure: the category of the class Ordered Collection is: "Collections-Sequenceable". This structure has not any technical significance.

The structure of classes that has technical significance is the structure of "inheritance": a class has a "superclass" and can have "subclasses". By example: Ordered Collecion has some classes "over it" and some "under it".

The important fact about this "inheritance thing" is: a subclass has all the methods of its superclasses.

Opening the Squeak desktop you can drag a "System Browser" where you will find all the classes of the "image" of Squeak you are working. The "image" of the "Squeak plugin" doesn't have all the classes of the "Squeak for Desktop" we are working now.(Please try not to make any confusion between projects and classes...)

In the "System Browser" we have another "admnistractive" level in the structure: methods are grouped (the 3th window).

Sometimes will be interesting that YOU create a new Class. WOW! One more!

A new class, created by you, will only work at the "Squeak for Desktop", not for the "Squeak plugin".

Creation of new classes are not in the scope of this course. Sorry.

This course was only an introduction of Squeak programming for beginners. We hope you have learned many things and can go ahead now by your foots, trying to read the many tutorials about Squeak you will find in the Internet.


PREVIOUS LESSON
T. CONTENTS HOMEPAGE