Re: Abstract classes and methods
Re: Abstract classes and methods
- Subject: Re: Abstract classes and methods
- From: Ondra Cada <email@hidden>
- Date: Wed, 29 Aug 2001 20:30:32 +0200
Chris,
>
>>>>> Chris Gehlker (CG) wrote at Wed, 29 Aug 2001 10:15:58 -0700:
CG> To make shape virtual, you carefully don't define a simple init method
CG> for it. To make it abstract non-virtual you go ahead and define the
CG> simple init method.
right. Worth to add though that each class inherits the plain init from
NSObject (you can reimplement it, of course).
CG> The old ObjC hands will tell you that ObjC is a simple extension to C but
CG> they lie. ObjC is full of conventions that aren't enforced by the
CG> compiler, extra-linguistic conventions?, but that "everybody knows" and
CG> that are really necessary to make the language useful. The complexity of
CG> ObjC + ObjC extra-linguistic conventions approaches the complexity of C++
CG> + C++ extra-linguistic conventions.
Not really. First, a vast majority of those are not "ObjC" conventions, but
"Foundation" (or, rather, "Cocoa") ones -- that's a world of difference.
Adn even if you sum it all, the result is still *ways* simpler than C++.
Actually you can forget this "abstract" debate and you won't make any serious
mistakes. More or less the important conventions I can recall firsthand are
- naming (a trifle, but the most visible one);
- designated initializer;
- any other???
Well, then there are some nice patterns (like object embedding instead of
subclassing, protocols, smart using of categories etc), but it goes ways
outside "conventions".
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc