From: <bar...@ao...> - 2010-07-07 17:31:45
|
I think that having java_util_ArrayList.m be a category on NSMutableArray is a clever use of categories, but wouldn't encapsulation generally be a more flexible option? One potential issue I see with the category approach is that since java_util_ArrayList.m and java_util_LinkedList.m are both categories on NSMutableArray, what happens if the client java code relies on checking the kind of the list using reflection? Won't java_util_ArrayList and java_util_LinkedList then be indistinguishable from each other at runtime? The same goes for the other classes where categories are used: String, StringBuffer, HashMap/Set, URI/URL, etc. |