more prototypes

Jecel Mattos de Assumpcao Jr. jecel at lsi.usp.br
Thu Feb 26 21:48:41 UTC 1998


It has already been mentioned that there are two ways to
create new objects:

 - ask a factory object to build one from a kind of blueprint
 - ask a similar object for a copy of itself
 
There is also an important variant of the first kind - ask
a special factory (the parser) to build an object from a
textual description, like

    #('help' with this 2)
    
This is sometimes called "creating from nothing" (or
"ex nilo" creation, or something equally silly) which
is only accurate if we consider the parser to be
nothing.

One important use of classes is as a factory object that
understands the #new message. We don't really need this,
as cloning and literal object are quite sufficient. But
classes also are used for reflection - they hold the
meta-level information about their instances that is
needed by the programming environment.

If we eliminate classes, then we will need to create new
objects (Self calls them mirrors) so we can still write
the programming environment within the same language. So
it would seem that nothing is gained by getting rid of
classes, but this is not true as these mirrors can be
created "on the fly" only when needed instead of having
to hang around all the time.

My own experience is that having to create classes before
you can make an instance is as bothersome as having to
declare all of your variable types. It is so much better
to point to something on the screen, copy it, call up its
definition and then start hacking away. With the ability
to drag-n-drop objects, cleaning up the mess you make is
hardly a chore later on.

-- Jecel





More information about the Squeak-dev mailing list