From: gabriele renzi Date: 2003-06-27T08:00:18+09:00 Subject: Re: API for Ruby/Java integration through JNI (feedback needed!) il Fri, 27 Jun 2003 06:05:28 +0900, Mauricio Fern�ndez ha scritto:: >It does now. Static methods seem to become singleton methods of the >class objects. You can do > aklass.java_instance_methods >to get an array of Method objects, and > aklass.java_methods >to get the static methods (singleton methods) of the class. well, I suppose having the java_(reflecting) method separated from the ruby one could be useful.. but I wonder if someone would prefer full consistency with "the rest of the world". Possibly a JRNI::FULL_MIMIC flag for Reflect.new? ^_^ >> what kind of name collision could happen ? > >classes in Java with methods like object_id, instance_methods, class, >method_missing, etc... I suppose that this kind of collision should be handled by the user. I strongly prefer using my_java_obj.method over my_java_obj.send( :method) I suppose the name collision for common methods (like 'class') would be few (looking at Class or Object, for example, I can't see a cooomn method) Moreover, common methods such as Object.class or Array.length would collide but would give an equal result.. BTW, if someone is taking the approach of using a remote Java object he should be aware if some needed ruby method gets messed up from java. Possibly a best way could be aliasing colliding methods such that a colliding :meth would make java_obj respond to :ruby_meth and :meth (or :java_meth and :meth). Ugly, but this should be really rare imVho >> anyway I have no idea about the possibility to do this stuff, so >> forget my desires if you wish :) > >everything doable, by experience: I have done most of it by now :) Yeah, but now I'm waiting for the CORBA binding in the next few days ;)