[sclug] like a wheel within a wheel ...

Ciaran McHale ciaran_mchale at yahoo.co.uk
Fri Jul 26 06:33:11 UTC 2013


On Thu, 2013-07-25 at 20:05 +0100, Graham wrote:
> [In OOP, what is the inheritance relationship between a Circle and Oval?]

Some programming languages make a distinction between "type inheritance"
and "implementation inheritance". Perhaps the conceptual difficulty you
are encountering is due to the "type inheritance" and "implementation
inheritance" getting misaligned:

Circle "type inherits" Oval (because a Circle "isA" Oval)
Oval "implementation inherits" Circle (because Oval adds new data)

I once watched a video introduction to the "Go" programming language
invented at Google. I was intrigued how its designers managed to do
away with class hierarchies entirely.

http://golang.org/doc/faq#inheritance

I suspect the confusion between the relationship of a Circle to an
Oval will be less of an issue in Go than in, say, C++.


Regards,
Ciaran.
-- 
Ciaran McHale (ciaran_mchale at yahoo.co.uk) www.CiaranMcHale.com
Mobile: +44-(0)7866-416-134 Home office: +44-(0)118-327-9847




More information about the Sclug mailing list