Re: Clean Object Class Design -- Circle/Ellipse
Date: Tue, 2 Oct 2001 10:57:12 +0100
Message-ID: <9pc243$hosvc$1_at_ID-75294.news.dfncis.de>
Do you mean something like this (assume circle inherits from ellipse) ...
/*1*/ circle c = new circle(radius=10) ; /*2*/ ellipse e = c ; /*3*/ print c.focusA() , c.focusB() ; /*4*/ print e.focusA() , e.focusB() ; /*5*/ e = e.setFocusA(123) ; /*6*/ print c.focusA() , c.focusB() ; /*7*/ print e.focusA() , e.focusB() ;
such that we get
3: 10,10
4: 10,10
6: 10,10
7: 123,10
With a suitable op signature for 5, we can achieve the above in OOP quite easily. Such an approach is not without potential grief (maintenance for one) , but acceptable.
JR>I find little merit in your definitions. They don't relate to JR>solving any real problems in development; they don't relate to any JR>useful information at all.
IMHO the "values vs variables" theme is quite a significant point. And provides another viewpoint on the problem fundamentals.
As to whether it has enough to surplant/encompass other very good viewpoints (such as Wegner "subset subtyping" etc) , that is for debate.
>Au contraire, subtype/supertype relationships arise in many, if not
>most, real problems in development. Any language that prohibits the
>user from modelling natural subtype/supertype relationships such as
>Circle/Ellipse interferes with development.
>For any such language, all inheritance will be arbitrary, ad hoc and
>unrelated to either the problem domain or the solution domain. No
>developer will ever have objective guidelines for when to use
>inheritance vs. roles, delegation etc.
>I find it very telling that almost every OO pundit has found it
>necessary to write an apologia explaining why the very real and
>natural subtype/supertype relationship between circle and ellipse
>does not apply in OO.
But "apologia" ... ??
Regards,
Steven Perryman
Received on Tue Oct 02 2001 - 11:57:12 CEST