Canvas is-an Encoder?

Lex Spoon lex at cc.gatech.edu
Tue Jun 27 13:14:47 UTC 2000


Why is Canvas a subclass of NullEncoder and FlattenEncoder, lately?  It
seems to be something added to make the Postscript support work, but the
solution seems kinda strang--Encoding and drawing really seem like
separate issues to me.  For example, should the same class implement
drawCircle: and initWithTarget:?  fillRectangle: and writeObject: ?

With multiple inheritance, it would seem reasonalbe to have
PostScriptCanvas be a subclass of both Canvas and Encoder.  But as
things are, making Canvas a subclass of Encoder just for Postscript's
sake seems strange.  Why not just have an 'encoder' instance variable in
PostscriptCanvas?


-Lex





More information about the Squeak-dev mailing list