Talk:Circle-ellipse problem
From Wikipedia, the free encyclopedia
[edit] An anti-pattern?
PJTraill 06:06, 23 January 2007 (UTC) I see you, User:EngineerScotty, have removed my assertion that it is an anti-pattern. Is that because you disagree, or because it is not generally said to be one? I reckon it fulfills the requirements (which are not actually strictly sepecified at anti-pattern). Good luck with your restructuring efforts, I shall look again in a while.
- It isn't an anti-pattern per se; anti-patterns usually refer to practices which are consistently bad. This is more of a theoretical issue. One comment I did remove is the bit about OO not being well-grounded theoretically (the "OO lacks math" argument, I guess)--it's not relevant to this issue. While the formal footings of OO are still being debated; the circle-ellipse problem is quite easily explained in terms of type theory.
- A few suggestions:
- Don't cite dbdebunk as a source. Pretty much everything Date said about this can be found in The Third Manifesto and its successors (the recently published Types and the Relational Model, which I'll buy when I can find a cheap used copy...). As a printed, published work it's a much more reliable source that Fabian Pascal's website.
- Other useful sources: [1], Object-Oriented Software Construction, More Effective C++ by Scott Myers, Alistair Cockburn's paper Constructive Deconstruction of Subtyping [2], [3].
- Related topics: Predicate types, Four out of five rule.
- --EngineerScotty 17:34, 23 January 2007 (UTC)
[edit] Introduction
I do not want to get into describing the nonsense of the "problem". However, I would like to suggest that the following phrase : "The problem concerns what subtyping/inheritance relationship should exist between classes which represent circles and ellipses."
should be written as
"Assuming there is a relationship between circles and ellipses, the problem concerns what subtyping/inheritance relationship should exist between classes which represent these two notions." Dpser 15:46, 29 January 2007 (UTC)
- PJTraill 17:04, 4 February 2007 (UTC) How strange! ...
- Circles and ellipses are well-defined and well-known mathematical objects with at least one very clear relationship, namely that every circle is an ellipse. So it would be better to say something more like "the problem is whether inheritance should be used to represent the relationship between circles and ellipses.". It is, of course, representative of a wide class of design problems, in many or most of which the relationship is less clear cut. If there are other concepts of circle and ellipse out there, they are a distraction from the question of OO modelling of sub-classes.
- I don't understand what you mean by "describing the nonsense of the problem". It is definitely a topic on which a good deal has been written, dealing with genuine pitfalls into which I believe many have stumbled. My personal feeling is that many contributions, while correct, have caused more confusion than they have cleared up.
-
- Hello PJTraill, I agree with the quoted sentence in point one above to some extent. However, I think you are slightly mislead to think that there is such a relationship namely that a circle is an ellipse. This is by no means true, since they are both merely conic sections. Therefore you should also create an article about whether a hyperbolla is a circle in exactly the same sense.
- I regret I cannot get into the esoterics of the nonsense of this problem. I try to restrict myself from getting too much into original research even in the talk page ;-). Just to give a hint, I personally classify this problem in this kind of problems that are simply badly formulated just like "do chicken come from eggs or eggs from chicken?". I take the expression of your personal feeling like an indication that I may be right and here I stop. However and in order to justify my proposal for modification of the wording, I could say that within the scope of object orientation, the problem is also completely badly formulated because OO and in particular OOP is a representation of knowledge: therefore one needs first to describe the world the classes will live in. The phrase "is a circle a parent of an elipse or vice-versa" cannot exist on its own because it tells us nothing about the context the "circle" and "ellipse" live in. Depending on the world, I can translate the above in many ways (and I suspect there are more):
- * Analytical geometry: both are subclasses of conic section.
- * Function space: circle is a specialization of an ellipse
- * Topology and graphics: they are unrelated
- * Geometrically: among others, they are both aggregations of arcs
- * As orbits: the ellipse extends a circle
- * Lexically: they are unrelated
- * In a world of projections there may be only circles or ellipses
- * In a world of transformations (including non-affine) you might live only with circles
- Therefore on its own this question is (in my opinion) nonsense, as it assumes a very particular relationship between circle and ellipse, namely that one is always parent and the other child. I think this should be made clear in the article.Dpser 22:50, 4 February 2007 (UTC)