The moose likes EJB and Other Java EE Technologies and the fly likes Can i write C++ component in j2ee Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "Can i write C++ component in j2ee" Watch "Can i write C++ component in j2ee" New topic
Author

Can i write C++ component in j2ee

Shiv Sidhaarth
Ranch Hand

Joined: Aug 06, 2001
Posts: 116
Hi Guys and Gals,
I have one general question. I can uderstand that EJB is specification. Then, it should mean that i can implement that in any language. Can i write C++ component which satisfies EJB sepcification. Or component in any language other than java, for that matter. If so, can i use that component along with java components in J2EE compliant server?
Thanks in advance,
Sankar
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

Nope. The emphasis in the words are on the "Java" part, not the "Enterprise" part. Most of the EJB spec has to do with how interpreted Java code works in a framework of other interpreted Java code -- reinventing that in another language environment would be equivalent to reinventing the entire Java experience.
Also, part of the EJB spec is that in order to be "write-once, use-anywhere" you are explicitly forbidden to invoke "native code", so that ends the whole idea at the start.
However, there is certainly a place for non-Java and Java code to live together happily in the same world - it's called CORBA.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
Jorge Phillips
Ranch Hand

Joined: Jun 03, 2001
Posts: 43
EJB containers run a Java VM so you can't run compiled C++ in the container. Even if you could (assuming a .net like C++ to JVM compiled code) your C++ objects would still have to satisfy the container contracts. Major changes would be needed in the EJB environment to accomodate this.
But you can create a C++ component accessible from your EJB application via RMI-IIOP. You would have to deploy this foreign component using CORBA and generate the corresponding IDL interfaces for both sides so they can interoperate.
 
 
subject: Can i write C++ component in j2ee
 
Threads others viewed
Reading registry values from remote computer
System Computer Engineer (4.5 years in Java)
Do you think we're seeing the end of "the C++ era"
EJB vs CORBA
Difference Between WORA and WODA
MyEclipse, The Clear Choice