From: Arno P. <ar...@pu...> - 2011-03-28 16:35:16
|
I wanted to make one more comment concerning the overall issue: you may have noticed that there is a branch called branches/wp7. Markus and Oren are working in that branch to add another backend to XMLVM for WP7. The current version of XMLVM's Android Compat Lib is tied to iOS and the discussion we've had here with NSSelector is a good example. NSObject.performSelectorOnMainThread() is currently used in various places in the Android Compat Lib to run tasks on the UI thread, however, that class and method are iOS specific. One job that Oren and Markus will soon be working on is to refactor the Android Compat Lib and add a well-defined "Common Device API" that will make it easier to add new backends to XMLVM. So, instead of using NSObject/NSSelector all over the Android Compat Lib, the plan is to create an abstraction. Same is true for other iOS API that is used liberally throughout the Android Compat Lib, e.g., NSXMLParser, NSData, etc. Now, I just mention this to give a glimpse on things to come with XMLVM. It doesn't affect the current discussion and decisions regarding NSSelector. Panayotis patch is already introducing NSSelector within the Android Compat Lib. Once we advance with WP7, this will change again to the aforementioned Common Device API. I'm sure the WP7 guys will introduce their refactoring plans on this list for general discussion. Arno On 3/26/11 12:34 PM, Paul Poley wrote: > That's fine with me too. > > Paul > > On Sat, Mar 26, 2011 at 11:55 AM, Arno Puder <ar...@pu... > <mailto:ar...@pu...>> wrote: > > > I agree with you that (1) the name of a class/method should reflect its > semantics and (2) we should stick to the official API as much as > possible. In light of this, I also opt for the first option I mentioned > NSObject.performSelectorOnMainThread(NSSelector). > > Arno > > > On 3/26/11 3:46 AM, Panayotis Katsaloulis wrote: > > > > On Mar 25, 2011, at 3:19 AM, Arno Puder wrote: > > > >> > >> I guess the question boils down to the way to define the callback in > >> Java. Introduce a new interface (NSSelector) or use existing Java > >> interface (Runnable)? The method in question is > >> NSObject.performSelectorOnMainThread(). Considering the name of the > >> method, it might be awkward to pass a runnable. Perhaps renaming the > >> method to NSObject.performRunnableOnMainThread() although it doesn't > >> exists on the Objective-C side. > >> > >> So, the options are: > >> > >> 1. NSObject.performSelectorOnMainThread(NSSelector) > > > > I am actually more in favor of this solution, because it is > similar (or practically the same) with NSTimerDelegate > > > >> 2. NSObject.performSelectorOnMainThread(Runnable) > >> 3. NSObject.performRunnableOnMainThread(Runnable) > > > > I am afraid that this is not standard and nowhere documented, and > I am not really in favor for introducing non-existive API. > > > > > > More importantly though, it is required the others to express > their opinion. > |