Hi all!
I am seeking opinions. It may or may not lead to a change.
When designing the callback feature of Ruboto we have added an aliasing feature for the callback methods. That means that for the classes that are specially handled by Ruboto (Activity, BroadcastReceiver, and Service), and any classes generated by the Ruboto tooling using "ruboto gen subclass", we check for a snake case method if the camel case method is not implemented in the Ruby subclass.
It seemed like a nice feature at the time.
Recently two arguments against the feature have been raised:
1) By enabling the snake case method use, code corresponds less to the Android documentation. JavaDocs and examples refer to onCreate, not on_create. By using the camel case method name, code is kept closer to the documentation, and it is clearer that this is not some independent method, but an implementation of a defined interface. Googling for examples using the method will probably fail to find snake case instances.
2) The snake case versions of the method names cannot be used everywhere. JRuby itself does NOT alias method calls from Java to Ruby, only from Ruby to Java. That means that if you use the direct subclassing feature to create a Ruby subclass of a Java class, method calls from Java to your class will NOT be aliased, and you cannotuse the snake case method names. This is inconsistent and maybe unexpected. I have forgotten it myself a couple of times.
As with any feature, removing it would simplify the code, and we would need to have a period of deprecation with warning before we could remove it completely.
What do you think? Should we keep this feature, or remove it? Any thoughts are appreciated. Final decision is of course made in the core team :)