• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Refactoring tools available for Cocoa / ObjC?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Refactoring tools available for Cocoa / ObjC?


  • Subject: Re: Refactoring tools available for Cocoa / ObjC?
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 3 May 2006 19:36:52 +0200

Greg,

On 3.5.2006, at 19:18, Greg Titus wrote:

You guys are both getting confused

Not a bit :)

by Java/C++ making 'abstract' into a language keyword. When we are talking about refactoring tools we are talking about class patterns. Abstract Superclass is a pattern, not necessarily a language feature. It is _not_ a language feature in either Smalltalk or in Objective-C. That does _not_ mean that you can't detect the _pattern_.

The problem is that the pattern is undetectable (with a realiability which would make such a detecting useable).


Each programmer makes his "abstract" (pattern-meaning) classes a different way. Some would implement "abstract methods" to explicitly raise the appropriate exception (through doesNotRecognizeSelector:). Others would choose to return nil/NO/nothing from all such classes. Others would (for logging, for example) reasons call *their own* method which would eventually raise the exception, which can be auto- detectable only far as the calling pattern is primitive; it may not though, and the tool is SOL, whilst the code is *perfectly clean and intention-revealing*, very far from the example of #defining keywords to something different.

Worse: there can be (and actually are) classes in the sense you seem to be using *semi-abstract*: they can be instantied and used, but for *some of their methods*, which may be implemented using doesNotRecognizeSelector, and which have to be overridden if (and only if) the instance of the subclass is about to use them. What now?

I am terribly sorry, but the plain fact is that you *cannot* detect the pattern. At best, you can let the programmer declare it -- with all the ugly consequences of expanding thus the chance (and probability) of simple typo or I-have-overlooked-this errors with comparatively serious consequences.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc



_______________________________________________ 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
References: 
 >Refactoring tools available for Cocoa / ObjC? (From: "Eric Lin" <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Marcel Weiher <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: "Eric Lin" <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Ondra Cada <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Marcel Weiher <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Ondra Cada <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Marcel Weiher <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Ondra Cada <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Horst Hoesel <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Ondra Cada <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Greg Titus <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Ondra Cada <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Greg Titus <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: glenn andreas <email@hidden>)
 >Re: Refactoring tools available for Cocoa / ObjC? (From: Greg Titus <email@hidden>)

  • Prev by Date: Re: Refactoring tools available for Cocoa / ObjC?
  • Next by Date: Re: Keyboard short-cuts edit field
  • Previous by thread: Re: Refactoring tools available for Cocoa / ObjC?
  • Next by thread: Re: Refactoring tools available for Cocoa / ObjC?
  • Index(es):
    • Date
    • Thread