Hi. My team has a bunch of legacy Ada code. Our new code is being
written in Java. However, we still have many complex algorithms
written in thousands of lines of Ada. Rather than rewriting the
tested/validated Ada code in Java, we'd like to create a Java facade
that would delegate to the Ada code, thereby making the Ada code
available to newer Java client objects. Is this reasonable (as opposed
to rewriting everything in Java)? Anyone know what
mechanisms/libraries would support such an approach?
Thanks!
Ken
Gordon Beaton - 22 Mar 2006 14:15 GMT
> Hi. My team has a bunch of legacy Ada code. Our new code is being
> written in Java. However, we still have many complex algorithms
> written in thousands of lines of Ada. Rather than rewriting the
> tested/validated Ada code in Java, we'd like to create a Java facade
> that would delegate to the Ada code, thereby making the Ada code
> available to newer Java client objects.
If Ada has a C binding you can use JNI to incorporate the code more or
less directly into your Java application.
Otherwise your best bet is probably to use a socket to communicate
between the Java and Ada parts of the application.
/gordon

Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Roedy Green - 22 Mar 2006 22:37 GMT
> Anyone know what
>mechanisms/libraries would support such an approach?
It is a lot of work. You might try porting and gluing a small pilot
to see which is more work.
You need JNI and some C code to interface between Java and Ada.
Another approach is to write an Ada server that accepts requests on a
socket, much as if it were a web app.
see http://mindprod.com/jgloss/jni.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
kk_oop@yahoo.com - 23 Mar 2006 00:35 GMT
> On 22 Mar 2006 05:03:20 -0800, kk_oop@yahoo.com wrote, quoted or
<snip>
> You need JNI and some C code to interface between Java and Ada.
Would this enable communication in both directions (Java to C to Ada
and Ada to C to Java)? Do you know where I could find more information
on this approach?
Thanks!
Ken
Roedy Green - 23 Mar 2006 01:41 GMT
>Would this enable communication in both directions (Java to C to Ada
>and Ada to C to Java)? Do you know where I could find more information
>on this approach?
yes. look at the link I gave you in my previous post.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
TechBookReport - 23 Mar 2006 15:17 GMT
> Hi. My team has a bunch of legacy Ada code. Our new code is being
> written in Java. However, we still have many complex algorithms
[quoted text clipped - 8 lines]
>
> Ken
Is it possible to expose the ADA functionality as a web service? If so
then this is likely to be more flexible than trying to rewrite or
resorting to JNI.

Signature
TechBookReport Java http://www.techbookreport.com/JavaIndex.html