[ome-devel] Bio-Formats Ice bindings

Josh Moore josh at glencoesoftware.com
Tue Jun 21 13:12:56 BST 2011


On Jun 17, 2011, at 11:17 AM, Curtis Rueden wrote:

> Hi everyone,

Hi,

> 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.

Was your and Mario's primary goal to get away from the in-process issues of the JVM? Would it be an option to fork, create the JVM, and then use Ice rather than raw sockets for the communication? In that case would you need all objects? Or does the API that Mario is already using come close to sufficing? What are the other features/requirements that need to be added?

> 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?

None that I know of.

> 2) Are there any roadblocks you can foresee with this approach, aside from
> bad performance in some cases?

Curtis, I assume your plan is to turn everything into an Ice Prx? e.g. would you have an IRandomAccessPrx? If so, I'm skeptical that this would work as well as you want.

> 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...

I can't remember the specific problem we were having, Curtis. To you have that email still and/or link on ome-devel? I found only http://lists.openmicroscopy.org.uk/pipermail/ome-devel/2010-October/001733.html

> Thoughts welcome!
> -Curtis

Cheers,
~Josh


More information about the ome-devel mailing list