Does it make sense to remove slots ?

Pupeno pupeno at pupeno.com
Sun Nov 7 01:36:49 PST 2004


I'm creating some objects for Ellipses and circles and I have the following 
code:

Graphics addPrototype: #Ellipse derivedFrom: {Area}.
Ellipse addSlot: #center.
Ellipse addSlot: #xRadius.
Ellipse addSlot: #yRadius.

Graphics addPrototype: #Circle derivedFrom: {Ellipse}.
Circle addSlot: #radius.
Circle removeSlot: #xRadius.
Circle removeSlot: #yRadius.

c@(Circle traits) xRadius [ c radius ].
c@(Circle traits) xRadius: r [ c radius: r ].
c@(Circle traits) yRadius [ c radius ].
c@(Circle traits) yRadius: r [ c radius: r ].

for me it makes sense since Circles are special cases of Ellipses where both 
radius are the same, so, whatever method I can apply to an Ellipse should be 
also available to Circle, except that a Circle can have only one radius. 
That's why I removed the slots, created another one, and then created 
accessors as if it was an Ellipse. Maybe the write accessors shouldn't be 
there.
Or, am I totally confused ? Does this make sense ?
-- 
Pupeno: pupeno at pupeno.com - http://www.pupeno.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /archives/slate/attachments/20041107/92d0c322/attachment.pgp


More information about the Slate mailing list