• 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: Tue, 2 May 2006 22:30:09 +0200

Eric,

On 2.5.2006, at 21:55, Eric Lin wrote:

But take the [[someArray objectAtIndex:0] intValue] example.  For
Java, there needs to be a typecast for the method intValue() to be
accessed, hence the refactoring tool would know whether intValue
should be renamed.

I think (and I do apologize if I am wrong) Marcel would state that intValue (or any other method) should be always polymorphic, and that using a method of the same name with two different semantics in two different classes is a bug (and thus not worth refactoring).


Myself, I think that (a) exactly, that's what re-factoring is for: if I messed up the design and got (for example) two different methods of the same name, I would want the re-factoring tool to re-name one for me, leaving the other unchanged. That, though, it can't reasonably achieve. Catch 22.

Then, (b), the convenience which such a tool would offer would be only slightly better than what a well-designed regexp search&replace does. Namely in such an extent that putting an effort in such a re- factoring tool would be vain; instead the effort should (in my *personal* and perhaps wrong opinion!) to improving the search&replace.

(It is, actually, somewhat unclean where exactly the frontier lays: what level of features in a good regexp search&replace would make it, in fact, a smart re-factoring tool? :))

One could potentially trace the logic of the code and
realize all the types of objects that could have gone into this
array... but that kind of make my head dizzy.

That can be done as a hint (and may even perhaps be useable as such), but you'd have to keep remembering that it's no more than a hint (for actually each time the program runs the returned value *can* be of a different class).
---
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
  • Follow-Ups:
    • Re: Refactoring tools available for Cocoa / ObjC?
      • From: Marcel Weiher <email@hidden>
    • Re: Refactoring tools available for Cocoa / ObjC?
      • From: "Eric Lin" <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>)

  • Prev by Date: Re: Newbe Question: Searching Address Book
  • Next by Date: Re: saveGraphicsState vs. lockFocus
  • Previous by thread: Re: Refactoring tools available for Cocoa / ObjC?
  • Next by thread: Re: Refactoring tools available for Cocoa / ObjC?
  • Index(es):
    • Date
    • Thread