[ome-devel] Bio-Formats Ice bindings

Curtis Rueden ctrueden at wisc.edu
Fri Jun 17 10:17:52 BST 2011


Hi everyone,

Yesterday Mario Emmenlauer and I discussed the Bio-Formats Ice bindings, and
how it would be nice to resurrect them so that Bio-Formats has an
inter-process, cross-language integration solution.

I started looking at how best to resurrect them. The way they were being
done before was very ad hoc. We generated them from a Velocity template that
was quite hard-coded in many ways compared to the way the way the C++
bindings work. See:


http://git.openmicroscopy.org/?p=bioformats.git;a=blob;f=components/autogen/src/ice/bio-formats.vm;hb=HEAD

In contrast, the C++ bindings wrap every method of every Java class in
bio-formats.jar, loci-common.jar and ome-xml.jar.

We could do something similar for the Bio-Formats Ice bindings—generate a
Slice file mirroring the Bio-Formats API as fully as possible—but it would
require a bit of work. And of course it results in a very granular remoting
API compared to how people often use Ice. Nonetheless, it would make for an
intuitive API, as long as people exercise some care not to make too many
remote calls as Mario mentioned in his XuvTools talk yesterday.

Do others agree that such a thing would be useful? If so, I am thinking
about how best to implement it. My initial inclination is to write some Java
code that takes a JAR file as input, and generates a Slice file with
interfaces mirroring each class in the JAR, as well as the Java server
implementation code that simply delegates to the wrapped JAR.

My questions, mostly to those who know more about Ice, are:

1) Is there already a tool out there for doing this? Or a better way in
general?
2) Are there any roadblocks you can foresee with this approach, aside from
bad performance in some cases?

One potential roadblock: years ago I had trouble with methods of one
interface returning objects of a different interface. At the time, Josh
Moore and I concluded that it was sort of infeasible to have these sorts of
methods. E.g., IFormatReader.getCoreMetadata() returns a CoreMetadata
object, but this is difficult to implement properly in the server-side
implementation due to how Ice proxies work. But my intuition is that there
may be a clever workaround...

Thoughts welcome!

-Curtis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20110617/c3abf698/attachment.html>


More information about the ome-devel mailing list