Skip navigation.
 
mlRe: Category or Protocol? (sidetrack)
FROM : Scott Ellsworth
DATE : Fri Apr 22 02:01:09 2005

On Apr 21, 2005, at 4:45 PM, Ondra Cada wrote:

> John,
>
> On 21.4.2005, at 1:41, John Stiles wrote:
>
>

>> theoretically if you had two classes with a Foo() method, you 
>> could add a parameter to Foo() in class A and not class B, and the 
>> editor could find all the instances of the Foo() method in class A 
>> and not class B. This isn't possible with grep :)
>>

>
> More than that: in fact, it is not possible *at all* :))


Actually, it is possible.  I do this all the time with IDEA.

If you add a parameter to a base class, it asks if you want it 
propagated to the implementations in all of the implementing 
classes.  Similarly, if you change a method in an interface, it 
updates all the implementing classes, and vice versa.  It also finds 
all usages of the method via instances of the class, subclasses, and 
via interfaces.

> (Not even with Java, see reflection/NSSelector/action-target/first 
> responder stuff... And of course, even *considerably* less with 
> ObjC or another decent language.)


You can certainly break reflection, but catching direct method calls 
covers a lot of ground.  The majority of cases, in my experience.

Believe me, this makes life run a lot faster, and does reward typical 
usage of the Java type system.

Scott

Related mailsAuthorDate
mlRE: Category or Protocol? (sidetrack) Jeff Laing Apr 19, 06:57
mlRe: Category or Protocol? (sidetrack) Andrew White Apr 20, 02:34
mlRe: Category or Protocol? (sidetrack) Rick Kitts Apr 21, 00:25
mlRe: Category or Protocol? (sidetrack) Ondra Cada Apr 21, 00:45
mlRe: Category or Protocol? (sidetrack) Scott Ellsworth Apr 21, 01:15
mlRe: Category or Protocol? (sidetrack) Rick Kitts Apr 21, 01:40
mlRe: Category or Protocol? (sidetrack) John Stiles Apr 21, 01:41
mlRe: Category or Protocol? (sidetrack) Dirk van Oosterbos… Apr 21, 10:32
mlRe: Category or Protocol? (sidetrack) Rick Kitts Apr 21, 14:12
mlRe: Category or Protocol? (sidetrack) Mark Dalrymple Apr 22, 00:03
mlRe: Category or Protocol? (sidetrack) Ondra Cada Apr 22, 01:45
mlRe: Category or Protocol? (sidetrack) Scott Ellsworth Apr 22, 02:01
mlRe: Category or Protocol? (sidetrack) Ondra Cada Apr 22, 02:19
mlRe: Category or Protocol? (sidetrack) John Stiles Apr 22, 02:58