C++ , Java Kommunizieren

T

traktour7

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
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

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.

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
 
C

Christian

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

Roedy Green

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

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
 
R

Roedy Green

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

Roedy Green

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

Lew

Roedy said:
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."
 
G

Gordon Beaton

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

--
 
R

Roedy Green

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

Bent C Dalager

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
 
W

Wildemar Wildenburger

Roedy said:
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
 
L

Lew

Wildemar said:
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.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Roedy said:
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
 
R

Roedy Green

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

Patrick May

Lew said:
Cute, but unfair.

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
 
M

Mark Rafn

Patrick May said:
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.
 
L

Lew

Mark said:
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.

I had to shudder at the presence of "Lisp" and "straightforward" in the same
sentence to begin with.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,260
Messages
2,571,038
Members
48,768
Latest member
first4landlord

Latest Threads

Top