| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.