Re: Refactoring tools available for Cocoa / ObjC?
Re: Refactoring tools available for Cocoa / ObjC?
- Subject: Re: Refactoring tools available for Cocoa / ObjC?
- From: Horst Hoesel <email@hidden>
- Date: Wed, 3 May 2006 18:30:49 +0200
Ondra,
Greg,
On May 3, 2006, at 5:22 PM, Greg Titus wrote:
Try actually reading about the Smalltalk refactoring browser and
Smalltalk in general. There is no 'abstract' keyword or equivalent
in Smalltalk either, but it still is possible to determine
abstract classes. You could use exactly the same methods to
determine abstract classes in Objective C.
Although I agree I am not a Smalltalk guru by far, I can still say
that's wrong.
The reason is that, just again, whilst in Smalltalk there can be
some (whatever sweet way unknown to me they are achieved and
detected), in ObjC *there are no abstract classes*. Period. You
encounter NSObject instances pretty often, a few times I've even
instantiated NSArrays. I haven't ever instantiate an NSString, but
I bet some other one did :) And so forth.
As I've said, I am about to study the Smalltalk refactoring (am
actually looking forward to that), but regardless Smalltalk-
savviness, I do know ObjC pretty well. There is *no way* to use and/
or detect abstract classes reliably there (unless compiler and
runtime both get seriously limited). Sure, the tool may scan the
project whether the class is instantiated or not--which is bound to
fail since a class may be instantiated dynamically without ever
mentioning its name anywhere. Or from a loadable bundle. And so
forth...
You are putting the cart before the horse here. If a tool can't
determine whether a class is abstract or not does _not_ mean that the
class isn't abstract. Its a question of design. NSObject is by
concept an abstract class, though it makes a pretty bad example as it
can be put to uses never dreamed of when the class was designed,
probably mostly due to it being the one connection to the runtime and
low level structures.
Anyway, you don't have to take my word for this. Open up your copy of
"The Objective-C Programming Language" a read the paragraph about
abstract classes on page 47.
Cheers,
Horst
P.S. Since I don't speak a single word of SmallTalk I'll stop here.
The only reason I ever entered this thread was that the "ObjC has no
abstract classes" struck out as wrong, for me.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden