wood burning stoves 2.0*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes SCAE - Question regarding consuming C++ applicaiton  in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "SCAE - Question regarding consuming C++ applicaiton  in Java" Watch "SCAE - Question regarding consuming C++ applicaiton  in Java" New topic
Author

SCAE - Question regarding consuming C++ applicaiton in Java

Vinod Iyer
Ranch Hand

Joined: Apr 13, 2006
Posts: 53
MegaDreamDating Inc. is expanding from one office to five throughout the US. As part of this expansion they wish to upgrade their 'Dream date match' application, which matches requirements an ideal partner will have with registered users. Currently the 'Dream date match' is a standalone application (no network code), written on C++. It is likely that the requirements for this application may be extended yet again.

How should you extend this application so that it can be deployed in all the five offices?
Choose one answer.
a. As there is no built in network code, a complete rewrite will be required.
b. There is no need to extend the application, instead run five separate versions (one in each office).
c. Extend the application by integrating CORBA (create a CORBA server at head office) then use Java IDL at the regional offices to connect to the CORBA server.
d. Use JNI and RMI. Create a RMI server at head office and then create a client for use at the regional offices.
e. Use JNI and applets as in choice D but applets will connect to the JNI code at the head office.


I would prefer option e, since that would give more flexibility compared to option d where a client needs to be installed. and better manageability also .

But option d is given as correct

"Making the application available at all five regional offices will involve adding network code. But before this can be done, the C++ application needs to be able to talk to the network code. The most appropriate way of doing this is through the use of JNI. The new business logic can be added to the existing application and then made available to the other offices via RMI."

How many of you guys agree with the mock exam author ??
sriram sankar
Ranch Hand

Joined: Feb 26, 2008
Posts: 43
Yes Option D is better since if you deploy the c++ application in one location and access it from RMI server, it makes lot of things easier like

1) We don't need to make JNI calls from every client, since this will be done at the server end.

2) Security will be major issue when accessed from applets.

3) Use your web application to communicate with RMI instead of applet.


SCJP 1.5 , SCBCD 5.0, SCEA 5.0
Kumar Ala
Ranch Hand

Joined: Apr 30, 2009
Posts: 53
As per my understanding we can not make calls to C++ application only through RMI, we should use IDL(through CORBA) or RMI IIOP. So Option C might be suitable in this case.

kumar
SCEA5 P1
Vinod Iyer
Ranch Hand

Joined: Apr 13, 2006
Posts: 53
sriram sankar wrote:Yes Option D is better since if you deploy the c++ application in one location and access it from RMI server, it makes lot of things easier like

1) We don't need to make JNI calls from every client, since this will be done at the server end.

2) Security will be major issue when accessed from applets.

3) Use your web application to communicate with RMI instead of applet.



Thanks Sriram, very reasonable explanation. I am now convinced
Vinod Iyer
Ranch Hand

Joined: Apr 13, 2006
Posts: 53
Kumar Ala wrote:As per my understanding we can not make calls to C++ application only through RMI, we should use IDL(through CORBA) or RMI IIOP. So Option C might be suitable in this case.


JNI can be used to make calls to C++
prathap venkata naga yelugula
Ranch Hand

Joined: Aug 13, 2008
Posts: 243
Appling the JNI is correct Way.


Cheers!
Prathap.
Kumar Ala
Ranch Hand

Joined: Apr 30, 2009
Posts: 53
I do agree that we can use JNI to connect to C++, Can anyone explain why not the choice C.
Vinod Iyer
Ranch Hand

Joined: Apr 13, 2006
Posts: 53
Kumar Ala wrote:I do agree that we can use JNI to connect to C++, Can anyone explain why not the choice C.

yes corba can be used but won't it be an overkill for solving the current problem ??
 
 
subject: SCAE - Question regarding consuming C++ applicaiton in Java
 
Similar Threads
Cleared Part I today with 79%
JNI versus CORBA
Scenerio.. Discussion?
Question about JNI and RMI-IIOP
Question for SCEA part I