From: gabriele renzi Date: 2003-06-27T05:39:28+09:00 Subject: Re: API for Ruby/Java integration through JNI (feedback needed!) il Thu, 26 Jun 2003 03:34:10 +0900, Mauricio Fern�ndez ha scritto:: > >OK, I'm going quite fast so I need now to decide how Java classes and >objects are gonna work in Ruby. I'd appreciate some comments on what >kind of mapping you'd like. here we are > reflector = Reflect.new vm # create the "reflector", only need one > theklass = reflector["Simple"] > object = theklass.new # mimic Ruby's object creation reflector sounds wierd to me.. somthing better? :) >Now, the things I need feedback on: > * static methods: should they magically pop up in theklass, so that they > work as in Class objects in Ruby? it would be cool if Reflect.new worked like Class.new, so that static java methods would automagically become class methods. anyway, a solution that just mimic this would be good enough. > * should I provide #instance_methods and such? > at the moment I've made #java_instance_methods that returns an Array > with RJNI::Object objects that represent the methods. are you talking about ruby reflection's apis? anyway, I supose yes > * should instance methods be directly invocable such as in the example > above, or by doing object.send_java("doStuff", *args) or such? > It is not as pretty, but OTOH this way there's no name collisions. what kind of name collision could happen ? anyway I have no idea about the possibility to do this stuff, so forget my desires if you wish :)