Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
ProtoObject
Last updated at 12:13 pm UTC on 23 March 2005
ProtoObject establishes minimal behavior required of any object in Squeak, even objects that should balk at normal object behavior. Generally these are proxy objects designed to read themselves in from the disk, or to perform some wrapper behavior, before responding to a message. Current examples are ObjectOut and ImageSegmentRootStub, and one could argue that ObjectTracer should also inherit from this class.

ProtoObject has no instance variables, nor should any be added.


Yar Hwee Boon January 05, 2005 Is there any reason why ProtoObject>>becomeForward: is not implemented?

Chris Muller My understanding for the purpose of ProtoObject is to provide a slimmed-down inherited API for proxies and such. Therefore, I'll bet it is merely an oversight that becomeForward: is not included.
But I'd also like to pose the inverse question as to why some methods are there. Mainly, doOnlyOnce:, initialize, rehash, flag:, ifNil: and its other three variants, rearmOneShot. If the whole point of ProtoObject is to have a minimal API, then aren't these rather extranneous?

Doug Way Yes, I'd argue that these two doOnlyOnce:,rearmOneShot)at least should be moved out. In fact, they should probably be moved to BlockContext rather than Object. Certainly any convenience methods such as the ifNil: variants should be moved out too (to Object).