swift2 - Benefit of class inheritance, when you could use protocol extensions? -
i fascinated possibilities of beautiful code protocol extensions. not seem grasp real difference between class inheritance.
i know there different ways model something, use composition instead of class inheritance.
but knew features of class inheritance, subclass use implementations of superclass easily. protocol extensions have feature too, value types.
so question features class inheritance have, protocol extensions not; or when use class inheritance instead of protocol extensions.
the "benefit" of class inheritance can inherit stored properties , initializers can have default implementation subclass.
but these minor benefits @ least me.
Comments
Post a Comment