Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Apple should get behind Cocoa Java



Please forgive my ignorance; I don't know what those Qualifier classes are but from what you described, it seems to me like you were implementing something like the Visitor design pattern <http:// en.wikipedia.org/wiki/Visitor_pattern>. If that's the case, you don't need to subclass every object in the entire structure.

Wagner


I, too, lament the passing of categories. For me, the most important reason is recursion.

In Objective-C, it was extremely elegant to use categories to augment classes that could possibly be in a hierarchical structure. An example I often use is the *Qualifier classes. In Objective-C, if I wanted to augment qualifiers to do something special (today, I have a method "qualifierLimitedToRelationship that pares down the qualifier to just one section), I could add a category on each type of qualifier (including the abstract EOQualifier) so I could ask the new question of any type of EOQualifier. Because it was likely that qualifiers were stacked in a hierarchy, implementing a method on EOAndQualifier and EOOrQualifier that iterated over all its qualifiers and returned an aggregate answer was easy. With Java, I have to subclass every object in the entire structure, AND if someone else's code passes me a qualifier tree that is not my custom subclass, I have to go through the entire hierarchy and re- create my subclass. YUCK!

I miss categories...

Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.