Skip to Content Java Solaris Communities Partners My Sun Sun Store United States Worldwide

»  Spotlight Articles
»  Projects
»  Publications
»  People
»  Awards
»  Events
»  Downloads
»  Internships
»  Contrarian Minds
»  About Sun Labs

Copying

  • Original object is a prototype.

  • Programming is making prototypes

  • Some SELF prototypes:

    • point, list, sequence, byteVector, set, dictionary, unixFile, process, profiler, time, colorPickerMorph, debugger, paint, webBrowser...

Copying

A running program usually creates lot of objects: things like points, collections and graphical widgets. In Self, these usually possess the same structure and behavior as existing objects, and are made by copying. The master object from which all objects of the same type are copied (directly or indirectly via another copy) is known as a prototype.

Programming in a prototype-based language means creating a collection of prototypical objects with the desired structure and behavior, such that when the program is running new objects are created and interact with each other to achieve the desired overall effect.

Each data type is represented, then, by a prototypical instance of that data type. For example, lists are represented by an empty list object. If we want a new list, we copy the prototypical list.

A Self system has hundreds of prototypes. Here are the names of some:

	point, list, sequence, byteVector, set, dictionary, unixFile,
	process, profiler, time, colorPickerMorph, debugger, paint,
	webBrowser...

[ Previous ] [ Index ] [ Next ]
Would you recommend this Sun site to a friend or colleague?
Contact About Sun News Employment Privacy Terms of Use Trademarks Copyright 1994-2008 Sun Microsystems, Inc.