Why is it not possible to create abstract classes in objective-c -
Why is it not possible to create abstract classes in objective-c -
because not really* possible create abstract classes in objective-c wondering if tell me why creators of objective-c didn't add together feature language.
*of course of study there few workarounds create -kind of- abstract classes thats not mean.
if mean why can't declare class abstract rather implement abstract class, suppose it's because doesn't interact objective-c's extremely dynamic, types-optional, smalltalky message-passing style (smalltalk doesn't have built-in back upwards declaring them either). example:
you might not know class you're sending alloc or init to, pretty weak guarantee
subclasses might still need pass alloc , init class hierarchy, we'd need allow that, making weaker guarantee
categories modify classes @ runtime, making abstract contract weaker still
in end, you'd wind keyword did same thing implement abstract classes (i.e. maybe override init bail if receiver isn't subclass).
type modifiers specify contract become more useful more rely on static type scheme — objective-c designed not rely on type scheme much, putting contract in type scheme less useful in other languages.
objective-c abstract-class
Comments
Post a Comment