The Last Example Object Hierarchy You’ll Ever Need
Explaining OO concepts to people is tricky when you’re using abstract names like class A extends B implements C. So over the years I’ve come up with a system that I’m very happy with. I share it with you here, dear reader. It’s in Java, but it applies equally well to .NET languages. C++ and other multiple inheritance developers need modify it only slightly to make Flier a mixin base class.
interface Flier {
public void fly (int howFar);
}
abstract class Bird { }
abstract class FlyingBird extends Bird implements Flier { }
abstract class FlightlessBird extends Bird { }
abstract class Mammal { }
public class Robin extends FlyingBird {
public void fly () { flapWings(); }
}
public class Penguin extends FlightlessBird { }
public class Squirrel extends Mammal { }
public class FlyingSquirrel extends Squirrel implements Flier {
public void fly () { glide(); }
}
Tags: oop
April 12th, 2010 at 3:40 am
Пожалуйста, поподробнее…
Директор магазина Explaining OO concepts to people is tricky when you’re using abstract names like class A extends B implements C…..
April 15th, 2010 at 10:48 pm
Подтверждаю. Я согласен со всем выше сказанным. Давайте обсудим этот вопрос. Здесь или в PM….
Кассир валютный Explaining OO concepts to people is tricky when you’re using abstract names like class A extends B implements C…..
July 15th, 2010 at 12:18 pm
Buy:Levitra.Viagra Soft Tabs.Propecia.VPXL.Maxaman.Soma.Viagra.Cialis Super Active+.Viagra Super Force.Super Active ED Pack.Tramadol.Cialis.Cialis Soft Tabs.Zithromax.Viagra Super Active+.Viagra Professional.Cialis Professional….
August 29th, 2010 at 11:36 pm
Planters http://mupright9j9-24g.AUTOSECTIONS.INFO/tag/Contemporary+Planters+And+Greenery+planters+greenery/ : planters…
Greenery…