From: Dai Date: 2001-08-20T08:22:54+09:00 Subject: [ruby-talk:19998] Re: CORBA Ruby mapping hello. > First of all, I attach my vision about the CORBA Ruby Specification. > I'll comment on your document in this weekend. following is my comment on Tobin's README. --- > 1. Modules IDL modules map directly to Ruby modules. The fact that Ruby has true nested modules makes for an especially natural mapping from IDL to Ruby. E.g., //IDL module Foo { module Bar { }; }; #Ruby module Foo module Bar end end > It should be noted that since Ruby module names must begin with capital > letters, using IDL files with lowercase module names could be a problem. I also think IDL's module or constant name should be capitalized in Ruby. But there are one problem. If its name conflicts with language predefined name, other language bindings prefixes it with `_' while mapping from IDL name. As you know, Ruby's constant cannot start with a underscore. > 2. Interfaces IDL interfaces are also mapped to Ruby modules. > Each Ruby module > corresponding to an IDL interface includes the base module CORBA::Object, > which declares all the methods found in the IDL CORBA::Object interface, > prefixed with an underscore, along with an additional method, repo_id, > which returns the interface's Repository ID. In other language binding, a method like repo_id() defined in its Portability Specification. In Java, the _ids() method id defined in the class of org.omg.CORBA.portable.ObjectImpl. > myBaz = CORBA::ORBit::Stub.new() > myBaz.extend(Foo::Bar::Baz) I prefer to use Stub's _narrow() method for it. myBaz = CORBA::ORBit::Stub.new() myBaz._narrow!(Foo::Bar::Baz) _narrow!() checks both ids are match. > 3. Operations It's time for work...please wait.