List Info

Thread: Re: Creating UNO-Ruby bridge?




Re: Creating UNO-Ruby bridge?
user name
2007-05-29 09:37:09
Hi Girish,

Girish Chandran wrote:
> Hi All,
> 
> I am analyzing the effort required for implementing a
UNO Bridge for Ruby.
I am happy to hear that 

> As part of this exercise I am going through the
documentation available at
> the following urls:
>  - http
://udk.openoffice.org/common/man/bridge.html
>  -
> http://api.openoffice.org/docs/Devel
opersGuide/AdvancedUNO/AdvancedUNO.xhtml
All documentation should be reachable from
   htt
p://wiki.services.openoffice.org/wiki/Uno/Spec

respectively
   http://wiki.services.openoffice.org/wiki/Uno/Ar
ticles%26Tutorials

> 
> I have some experience in working with UNO components
but this is the first
> time I am trying to write a Bridge. I am also going
through some of the
> existing bridges to get some understanding of the
design/architecture to be
> followed when developing a new bridge. It would be
really helpful if I can
> get some pointers in this regards which would speed up
my study.
> Is there any tutorial about writing Bridges? Can some
body  share their
> experiences?

You actually have the choice to write a
* remote Uno or
* a Binary Uno bridge,
though in theory you could use any language binding for
which a bridge 
already exits (e.g. you could use JRuby and implement the
bridge in Java).

A remote bridge basically marshalles all requests and sends
these 
through a connection (e.g. TCP/IP) respectively it receives
and 
unmarshalls requests. It needs to manage threads and to
preserve thread 
identities etc. Documentation for Remote Uno is tight and
can be found here:
h
ttp://wiki.services.openoffice.org/wiki/Uno/Remote

A Binary Uno bridge would use the Ruby runtime in process.
Despite 
synchronization etc. you wouldn't need to deal with threads
or thread 
pools, but would need to use some Ruby native interface. The
PyUno 
python Uno bridge is implemented as a Binary Uno bridge. You
may want to 
use the PyUno bridge 
(ht
tp://wiki.services.openoffice.org/wiki/Uno/PyUno) as a
template. 
Documentation for Binary Uno can be found here:
h
ttp://wiki.services.openoffice.org/wiki/Uno/Binary


If you are going to create a Ruby bridge, please create a
page

   htt
p://wiki.services.openoffice.org/wiki/Uno/Ruby

as the root for documentation. You may also want to create
a

   http://wiki.services.openoffice.org/wiki/Uno/Effort/Cr
eate Ruby Bridge

for managing the tasks, states etc.

> 
> thanks and best regards,
> Girish

Best regards

   Kay

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeudk.openoffice.org
For additional commands, e-mail: dev-helpudk.openoffice.org


RE: Creating UNO-Ruby bridge?
user name
2007-05-31 03:10:44
Hi Kay,

Thank you for the encouraging response. This is the first
time that I am
posting on the UDK mailing list and hence if there are any
rules regarding
the format of the postings please do let me know. 

> -----Original Message-----
> From: Kay Ramme - Sun Germany - Hamburg
[mailto:Kay.Rammesun.com] 
> Sent: Tuesday, May 29, 2007 8:07 PM
> To: devudk.openoffice.org
> Subject: Re: [udk-dev] Creating UNO-Ruby bridge?
> 
> Hi Girish,
> 
> Girish Chandran wrote:
> > Hi All,
> > 
> > I am analyzing the effort required for
implementing a UNO 
> Bridge for Ruby.
> I am happy to hear that 
> 
>
> > As part of this exercise I am going through the
documentation 
> > available at the following urls:
> >  - http
://udk.openoffice.org/common/man/bridge.html
> >  -
> > 
> http://api.openoffice.org/docs/DevelopersG
uide/AdvancedUNO/AdvancedUNO
> > .xhtml
> All documentation should be reachable from
>    htt
p://wiki.services.openoffice.org/wiki/Uno/Spec
> 
> respectively
>    http://wiki.services.openoffice.org/wiki/Uno/Ar
ticles%26Tutorials
> 

I have started studying the documents available under these
links. Are there
some specific documents which I should be studying in
greater detail? 

> > 
> > I have some experience in working with UNO
components but 
> this is the 
> > first time I am trying to write a Bridge. I am
also going 
> through some 
> > of the existing bridges to get some understanding
of the 
> > design/architecture to be followed when developing
a new bridge. It 
> > would be really helpful if I can get some pointers
in this 
> regards which would speed up my study.
> > Is there any tutorial about writing Bridges? Can
some body  share 
> > their experiences?
> 
> You actually have the choice to write a
> * remote Uno or
> * a Binary Uno bridge,
> though in theory you could use any language binding for
which 
> a bridge already exits (e.g. you could use JRuby and 
> implement the bridge in Java).
> 

Thank you for pointing out the choices. Let me also give you
some details
about my requirement. I have a set of C++ UNO Components as
part of an
application. Each component is having well defined
interfaces and component
implementation. The requirement now is that I should be able
to access these
components from Ruby script and also I should be able to
execute Ruby
scripts from the UNO Components (by supporting
embed-ability). Also the
bridge should be dynamic so that if I request for an
interface that is part
of a component, the bridge does some kind of internal UNO
type lookup and
allow me the access to the interface. This would allow me to
extend my
current application without having to change the bridge.

I hope I was able to clearly present my requirements.


> A remote bridge basically marshalles all requests and
sends 
> these through a connection (e.g. TCP/IP) respectively
it 
> receives and unmarshalls requests. It needs to manage
threads 
> and to preserve thread identities etc. Documentation
for 
> Remote Uno is tight and can be found here:
> h
ttp://wiki.services.openoffice.org/wiki/Uno/Remote
> 
> A Binary Uno bridge would use the Ruby runtime in
process. 
> Despite synchronization etc. you wouldn't need to deal
with 
> threads or thread pools, but would need to use some
Ruby 
> native interface. The PyUno python Uno bridge is
implemented 
> as a Binary Uno bridge. You may want to use the PyUno
bridge
> (ht
tp://wiki.services.openoffice.org/wiki/Uno/PyUno) as a
template. 
> Documentation for Binary Uno can be found here:
> h
ttp://wiki.services.openoffice.org/wiki/Uno/Binary
> 

Based on your comments I feel that the Binary Uno Bridge
would be the way to
go. I will also start looking at the PyUNO implementation in
detail to get a
better perspective of the whole task.
I know I am being lazy here , but is
there some document which describes
what are the key areas of focus when developing a bridge for
a new language?
To be very frank the amount of documentation just overwhelms
one.
>From my preliminary study I understand that I have to
work on the mapping,
language bindings and the corresponding support  in the
bridge.

> 
> If you are going to create a Ruby bridge, please create
a page
> 
>    htt
p://wiki.services.openoffice.org/wiki/Uno/Ruby
> 
> as the root for documentation. You may also want to
create a
> 
>    http://wiki.services.openoffice.org/wiki/Uno/Effort/Cr
eate 
> Ruby Bridge
> 
> for managing the tasks, states etc.

At present I am also evaluating various Ruby implementations
in order to
select one on which the bridge can be based. As soon as I
have something
concrete I will seek your help in initiating the project.

> 
> > 
> > thanks and best regards,
> > Girish
> 
> Best regards
> 
>    Kay
> 

Thanks and best regards,
Girish


DISCLAIMER
==========
This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Pvt.
Ltd. It is intended only for the use of the individual or
entity to which it is addressed. If you are not the intended
recipient, you are not authorized to read, retain, copy,
print, distribute or use this message. If you have received
this communication in error, please notify the sender and
delete all copies of this message. Persistent Systems Pvt.
Ltd. does not accept any liability for virus infected
mails.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeudk.openoffice.org
For additional commands, e-mail: dev-helpudk.openoffice.org


Re: Creating UNO-Ruby bridge?
user name
2007-05-31 05:18:04
Girish,

Girish Chandran wrote:
> Hi Kay,
> 
> Thank you for the encouraging response. This is the
first time that I am
> posting on the UDK mailing list and hence if there are
any rules regarding
> the format of the postings please do let me know. 
I think only the standard rules for quoting etc. apply.
Though, you 
don't need to put me on CC:, as I am reading the lists
anyway ... unless 
you actually want to reach me personally only 
> 
> 
> I have started studying the documents available under
these links. Are there
> some specific documents which I should be studying in
greater detail? 
Not that I am aware of, you may want to take a look at the
code of some 
bridges, e.g.
  bridges/source/jni_uno - for the JNI (Java Native
Interface) Uno 
bridge, or
  jurt/source - for the Java Uno runtime, or
  pyuno/source - for the Python Uno bridge.
> 
> 
> Thank you for pointing out the choices. Let me also
give you some details
> about my requirement. I have a set of C++ UNO
Components as part of an
> application. Each component is having well defined
interfaces and component
> implementation. The requirement now is that I should be
able to access these
> components from Ruby script and also I should be able
to execute Ruby
> scripts from the UNO Components (by supporting
embed-ability). Also the
> bridge should be dynamic so that if I request for an
interface that is part
> of a component, the bridge does some kind of internal
UNO type lookup and
> allow me the access to the interface. This would allow
me to extend my
> current application without having to change the
bridge.
This is actually all what Uno is about, you don't need to
change the 
runtime(s) just because of introducing a new type.
> 
> I hope I was able to clearly present my requirements.
I think so ...
> 
> 
> 
> Based on your comments I feel that the Binary Uno
Bridge would be the way to
> go. I will also start looking at the PyUNO
implementation in detail to get a
> better perspective of the whole task.
> I know I am being lazy here , but is
there some document which describes
Me too, me too ... 
> what are the key areas of focus when developing a
bridge for a new language?
Did you find http
://udk.openoffice.org/common/man/bridge.html already?

Anyway, just from memory:

- You need to map the Uno IDL types (see 

http://udk.openoffice.org/common/man/typesystem.html) to
Ruby, you want 
to look at the PyUno type mapping (see 
http://udk.openoffice.org/python/python-bridge.html#m
apping) as an example.

- You need to implement a Bin Uno <-> Ruby Uno bridge
(e.g. a shared 
library may be called "ruby_uno", exporting
  uno_initEnvironment
respectively
  uno_ext_getMapping

A little tutorial (though not complete yet) can be found in
the wiki:
http://wik
i.services.openoffice.org/wiki/Uno/Article/Working_with_Envi
ronments%2C_Mappings_%26_Objects
more details are available in the developers guide:
http://api.openoffice.org/docs/Devel
opersGuide/AdvancedUNO/AdvancedUNO.xhtml

- You need to implement some core services, e.g.
  - a component loader
  - a service manager
  - a typedescription provider
  - ...

- You may need / want to implement some helpers, e.g. for
  - accessing Anys,
  - implementing components (e.g. automatically adding
support for 
XTypeProvider, ...)

> To be very frank the amount of documentation just
overwhelms one.
There are plans to move all/most docu into the wiki, which
should allow 
us to consolidate somewhat and which should make it easier
to contribute ...
> From my preliminary study I understand that I have to
work on the mapping,
> language bindings and the corresponding support  in the
bridge.
Yes, please see above.

> 
> At present I am also evaluating various Ruby
implementations in order to
> select one on which the bridge can be based. As soon as
I have something
> concrete I will seek your help in initiating the
project.
You are very welcome ... 
> 
> 
> Thanks and best regards,
> Girish

Best regards

   Kay

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeudk.openoffice.org
For additional commands, e-mail: dev-helpudk.openoffice.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )