<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="moz-cite-prefix">Le 01/09/2024 à 17:55, Juan Vuletich a
écrit :<br>
</div>
<blockquote type="cite" cite="mid:66D48E68.3060303@cuis.st">
<blockquote
cite="mid:25bbb752-996c-4fb0-a657-2d00746be2a3@free.fr"
type="cite">
<p><font size="4">Indeed, PlacedMorph has BoxedMorph as its only
heir. Moreover, there is no instance of PlacedMorph.</font></p>
</blockquote>
<br>
Not quite: <br>
PlacedMorph subclasses -><br>
#(BoxedMorph Sample01Star Sample02Bezier Sample03Smiley
Sample04Pacman Sample06EasyToGrab Sample07Clipping Sample08Form
Sample09Clock Sample09ClockHourHand Sample09ClockMinuteHand
Sample09ClockSecondHand Sample10PythagorasTree) .<br>
</blockquote>
<p>I obviously miss looked. I also have PlacedMoprh subclasses of my
own I forgot about, to represent geometric instruments.<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:66D48E68.3060303@cuis.st"> <br>
PlacedMorphs are not expected to be "boxes". That's the big
difference. They are also not assumed to be resizable. That's why
having an instance variable to hold something like 'extent' is not
appropriate for them.<br>
<br>
<blockquote
cite="mid:25bbb752-996c-4fb0-a657-2d00746be2a3@free.fr"
type="cite">
<p><font size="4"><b>I am wondering if moving the extent
attribute of BoxedMorph to PlacedMorph </b>would be
useful.<br>
</font></p>
</blockquote>
<br>
I don't think so. It is important to have a superclass for Morphs
that are not rectangular shapes, or have their own idea of how to
handle their size / extent.<br>
</blockquote>
<p>Ok, thanks for the recall.<br>
</p>
<blockquote type="cite" cite="mid:66D48E68.3060303@cuis.st"> <br>
I understand your need. I think a better hierachy would be
something like:<br>
Morph<br>
PlacedMorph (location)<br>
BoxedMorph (extent)<br>
ColoredBoxedMorph (color, borderWidth, borderColor)<br>
Many subclasses here<br>
<br>
The problem with this approach is that a lot of code is already
subclassing BoxedMorph. It may be more reasonable to add a new
class between PlacedMorph and BoxedMorph. Something like:<br>
Morph<br>
PlacedMorph (location)<br>
BasicBoxedMorph (extent)<br>
BoxedMorph (color, borderWidth, borderColor)</blockquote>
<p><br>
</p>
<p>No, please don't. I think it will add unnecessary complexity. I
prefer to have unused attributes in some cases.<br>
</p>
<p>Bernhard prospective are interesting, it is a refoundation of the
architecture. It will make the system less easy to understand
IMHO.<br>
</p>
<p>Hilaire<br>
</p>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://gnu.org/s/dr-geo/">http://gnu.org/s/dr-geo/</a>
<a class="moz-txt-link-freetext" href="http://gnu-drgeo.blogspot.com/">http://gnu-drgeo.blogspot.com/</a></pre>
</body>
</html>