Hi everyone,<br><br>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.<br><br>
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:<br>
<br> <a href="http://git.openmicroscopy.org/?p=bioformats.git;a=blob;f=components/autogen/src/ice/bio-formats.vm;hb=HEAD">http://git.openmicroscopy.org/?p=bioformats.git;a=blob;f=components/autogen/src/ice/bio-formats.vm;hb=HEAD</a><br>
<br>In contrast, the C++ bindings wrap every method of every Java class in bio-formats.jar, loci-common.jar and ome-xml.jar.<br><br>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.<br>
<br>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.<br>
<br>My questions, mostly to those who know more about Ice, are:<br><br>1) Is there already a tool out there for doing this? Or a better way in general?<br>2) Are there any roadblocks you can foresee with this approach, aside from bad performance in some cases?<br>
<br>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...<br>
<br>Thoughts welcome!<br><br>-Curtis<br><br>