Java Forum / General / October 2007
C++ , Java Kommunizieren
traktour7@googlemail.com - 02 Oct 2007 14:46 GMT Hallo
ich habe zwei Programme , der eine in Java der andere in C++. die zwei Programme kommunizieren miteinander, (datenaustausch, methodenaufrufe...)
welche Technicken kann ich da anwenden ?
ich habe mir jni und soap angeschaut und kann sie aus system- restriction nicht benutzen.
gibts noch andere mechanismen die ich benutzen kann.
Danke Sehr Traktour
Arne Vajhøj - 02 Oct 2007 15:31 GMT > ich habe zwei Programme , der eine in Java der andere in C++. > die zwei Programme kommunizieren miteinander, (datenaustausch, [quoted text clipped - 6 lines] > > gibts noch andere mechanismen die ich benutzen kann. I will strongly recommend english in this forum.
There are some complex solutions including CORBA, COM etc..
But the simple solution is to use plain old sockets and have your own little message protocol to send both data and processing directives.
Arne
casperbang - 02 Oct 2007 15:51 GMT Not sure I understand what it is you need to do (please write in english). Anyway, you might want to take a look at Hessian: http://www.caucho.com/resin-3.0/protocols/hessian.xtp
/Casper
On Oct 2, 4:31 pm, Arne Vajh?j <a...@vajhoej.dk> wrote:
> trakto...@googlemail.com wrote: > > ich habe zwei Programme , der eine in Java der andere in C++. [quoted text clipped - 17 lines] > > Arne Arne Vajhøj - 02 Oct 2007 16:05 GMT > Not sure I understand what it is you need to do (please write in > english). Anyway, you might want to take a look at Hessian: > http://www.caucho.com/resin-3.0/protocols/hessian.xtp Please don't top post.
Please reply to the post you are actually replying to.
Arne
PS: Are you sure Hessian supports C++ ?
Piotr Kobzda - 02 Oct 2007 16:31 GMT > PS: Are you sure Hessian supports C++ ? Yes, see: <http://sourceforge.net/projects/hessiancpp/>
There are also Java, Flash, Python, C#, D, Erlang, PHP, and Ruby implementations available.
All linked there: <http://hessian.caucho.com/>
piotr
Christian - 02 Oct 2007 16:31 GMT traktour7@googlemail.com schrieb:
> Hallo > [quoted text clipped - 11 lines] > Danke Sehr > Traktour An easy way for communication is always a tcp connection. thoug for mwthod calls and more sophisticated interface you might want to take a look at CORBA it might be what you are looking for.
Bent C Dalager - 03 Oct 2007 10:11 GMT >An easy way for communication is always a tcp connection. Or UDP (java.net.DatagramSocket in Java) if you don't really care whether the messages make it or not.
Cheers Bent D
 Signature Bent Dalager - bcd@pvv.org - http://www.pvv.org/~bcd powered by emacs
Roedy Green - 03 Oct 2007 02:01 GMT >Hallo > [quoted text clipped - 11 lines] >Danke Sehr >Traktour Here is stab at a translation. I had one year of German back in high school, and access to Babelfish.
Hello. I have two programs, one in Java the other in C++. The two programs need to communicate with one another, (data exchange, method-calls...) What techniques can I used? I looked at JNI and SOAP but I cannot tolerate the system restrictions. Please suggest other mechanisms I can use..
Thanks very much,
Traktour
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Roedy Green - 03 Oct 2007 02:03 GMT On Wed, 03 Oct 2007 01:01:31 GMT, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said :
>I have two programs, one in Java the other in C++. The two programs >need to communicate with one another, (data exchange, method-calls...) >What techniques can I used? I looked at JNI and SOAP but I cannot >tolerate the system restrictions. Please suggest other mechanisms I >can use.. check out http://mindprod.com/jgloss/remotefileaccess.html
For program intercommunication methods.
In addition you have shared local files.
The most likely candidates are: JNI (which you have discarded) TCP/IP raw socket SQL database.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Roedy Green - 03 Oct 2007 03:10 GMT On Wed, 03 Oct 2007 01:03:27 GMT, Roedy Green <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted someone who said :
>The most likely candidates are: >JNI (which you have discarded) JNI is bewildering. It would take a superhuman effort to learn it purely from Sun documentation. I suggest reading a book on how it works. see http://mindprod.com/jgloss/jni.html. It is not as bad as it looks, just incredibly clumsy, like eating with metre long chopsticks.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Lew - 03 Oct 2007 03:44 GMT > It is not as bad as > it looks, just incredibly clumsy, like eating with metre long > chopsticks. One hokey parable tells of a visitor to Hades, where all the inmates were forced to eat with metre-long chopsticks. Needless to say, they were cranky and hungry there. The visitor then went to Heaven, where he was surprised to find that there, also, they ate with metre-long chopsticks. "But, but," he sputtered to St. Peter, "this is is how they torment people in Hades!"
"Yes," replied St. Peter serenely, "but here in Heaven, we feed each other."
 Signature Lew
Gordon Beaton - 03 Oct 2007 07:00 GMT > JNI is bewildering. It would take a superhuman effort to learn it > purely from Sun documentation. When you've finished exaggerating, you can stop for a moment to realize that it's just a C API to Java reflection. Perhaps it's C itself that you find bewildering?
/gordon
--
Roedy Green - 03 Oct 2007 08:57 GMT >When you've finished exaggerating, you can stop for a moment to >realize that it's just a C API to Java reflection. Perhaps it's C >itself that you find bewildering? Reflection too has that crab-like awkwardness where even the simplest thing takes many lines of code that has nothing to do with the application. It is all housekeeping.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Wildemar Wildenburger - 03 Oct 2007 16:40 GMT > Reflection too has that crab-like awkwardness where even the simplest > thing takes many lines of code that has nothing to do with the > application. It is all housekeeping. Sounds like Java alright :)
/W
Lew - 03 Oct 2007 17:03 GMT Roedy Green wrote:
>> Reflection too has that crab-like awkwardness where even the simplest >> thing takes many lines of code that has nothing to do with the >> application. It is all housekeeping.
> Sounds like Java alright :) Cute, but unfair.
Reflection would be messy in any language; it's a messy domain.
People love to slam Java for certain complexities, when such complexities in many cases are simply a reflection of the problem domain.
 Signature Lew
Patrick May - 04 Oct 2007 02:57 GMT > Roedy Green wrote: >>> Reflection too has that crab-like awkwardness where even the [quoted text clipped - 6 lines] > > Reflection would be messy in any language; it's a messy domain. I seem to be disagreeing with you on multiple topics in this newsgroup. It's not personal. ;-)
The equivalent of reflection in Common Lisp is so straightforward that it's part of the language called defmacro. The limitations of reflection are truly limitations of Java (and similar languages).
Regards,
Patrick
------------------------------------------------------------------------ S P Engineering, Inc. | Large scale, mission-critical, distributed OO | systems design and implementation. pjm@spe.com | (C++, Java, Common Lisp, Jini, middleware, SOA)
Mark Rafn - 04 Oct 2007 19:10 GMT >> Reflection would be messy in any language; it's a messy domain.
> The equivalent of reflection in Common Lisp is so straightforward >that it's part of the language called defmacro. The limitations of >reflection are truly limitations of Java (and similar languages). Reflection in any type-safe language is messy. Reflection in untyped (or "dynamically typed" if you prefer) languages is far easier to the point of being unnecessary in many situations. -- Mark Rafn dagon@dagon.net <http://www.dagon.net/>
Lew - 04 Oct 2007 21:21 GMT >>> Reflection would be messy in any language; it's a messy domain. > [quoted text clipped - 5 lines] > "dynamically typed" if you prefer) languages is far easier to the point of > being unnecessary in many situations. I had to shudder at the presence of "Lisp" and "straightforward" in the same sentence to begin with.
 Signature Lew
Arne Vajhøj - 04 Oct 2007 02:33 GMT > On Wed, 03 Oct 2007 01:03:27 GMT, Roedy Green > <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted [quoted text clipped - 4 lines] > JNI is bewildering. It would take a superhuman effort to learn it > purely from Sun documentation. I would not call JNI difficult to learn.
It is a bit cumbersome to use.
But creating a Java-native interface that can be expected to work on all platforms where Java works is probably not easy.
.NET DllImport is much much easier to use. But even that can be cumbersome. And I belive the Mono people has had a lot of work with that on non-Windows platforms.
Arne
Roedy Green - 04 Oct 2007 02:57 GMT >It is a bit cumbersome to use. I wonder what you could do with a preprocessor to generate the Java glue on the C++ side. The end result might more mysterious, but it might let people bang out more maintainable code. I supposed most of the time the programs are short enough the pain threshold in not high enough yet.
 Signature Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|