Re: Clean Object Class Design -- Circle/Ellipse
Date: Thu, 19 Jul 2001 15:50:06 -0400
Message-ID: <EZG57.172$o07.44117090_at_radon.golden.net>
>I must admit that I judged the article upon it's ability to answer a set of
>questions I have in mind, which is not quite fair. Here it is:
>
>1. Is the case Square/Rectangle really similar to Circle/Ellipse?
Yes.
>i. What methods/operations in Rectangle signature would make it different
from
>Ellipse?
A rectangle, like any quadrilateral, has four vertices. A rectangle, like any polygon, has a property that describes the number of sides.
>If they are identical from signature perspective, then, maybe,
>Rectangle and Ellipse are just 2 different implementations of same type?
Why would they be identical?
>ii. Is there a method in Square/Rectangle case that one might want to
override
>for performance reasons? It seems to me that we don't need to introduce
Square
>type at all.
Unless one wants a variable that is a square and must always be a square for reasons other than performance. Received on Thu Jul 19 2001 - 21:50:06 CEST