Java facade to Ada code?  
Author Message
kk_oop





PostPosted: 2006-3-22 21:03:00 Top

java-programmer, Java facade to Ada code? 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





PostPosted: 2006-3-22 21:15:00 Top

java-programmer >> Java facade to Ada code? On 22 Mar 2006 05:03:20 -0800, email***@***.com wrote:
> 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

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





PostPosted: 2006-3-23 5:37:00 Top

java-programmer >> Java facade to Ada code? On 22 Mar 2006 05:03:20 -0800, email***@***.com wrote, quoted or
indirectly quoted someone who said :

> 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
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
kk_oop





PostPosted: 2006-3-23 7:35:00 Top

java-programmer >> Java facade to Ada code?
Roedy Green wrote:
> On 22 Mar 2006 05:03:20 -0800, email***@***.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





PostPosted: 2006-3-23 8:41:00 Top

java-programmer >> Java facade to Ada code? On 22 Mar 2006 15:35:21 -0800, email***@***.com wrote, quoted or
indirectly quoted someone who said :

>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.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
TechBookReport





PostPosted: 2006-3-23 22:17:00 Top

java-programmer >> Java facade to Ada code? email***@***.com wrote:
> 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
>
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.

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