Talk:Polymorphism: Difference between revisions

Circle and Point both deriving from Printable looks better to me
(No conceptual error)
(Circle and Point both deriving from Printable looks better to me)
Line 68:
Of course in that case it would make sense to add a few more functions to Shape (e.g. a move function, or a function returning a bounding box). --[[User:Ce|Ce]] 08:26, 25 February 2007 (EST)
: The relation ''is-a'' is a notion of Liskov substitutability principle [LSP]. It is not necessarily related to inheritance and dynamic polymorphism. Sometimes the relation between types keeping all properties of the type (defined in some definite technical sense) is called '''LSP-subtyping''', and '''subclassing''', the latter, more loose relation. So-called LSP circle-ellipse controversy shows that the LSP notion of subtyping is practically (and theoretically too) unusable. Programming languages tend to more pragmatical "subclassing." --[[User:Dmitry-kazakov|Dmitry-kazakov]] 11:39, 3 November 2008 (UTC)
 
:'''Agree''' Circle derived from Point is poor design in this case, which might confuse the issue for the casual reader. The fix of having a common Shape subclass or interface looks much better to me. (In fact "Printable" would be a better name in the example above.) If you want to show off [[Inheritance]], perhaps split it into a different task. --[[User:IanOsgood|IanOsgood]] 13:01, 3 November 2008 (UTC)
Anonymous user