SCJP 1.4, SCWCD 1.3, SCBCD 1.3
I have following senario
Swing client (send/receive java object)-----Internet/JNDI----Controller at server(send/ receive java object)
Now since i have to send and receive java objects on client and server end so should i use a stateless session bean to act as a controller and allow my swing client to access that ejb controller's remote interface(through JNDI) and send receive java object through it or is there anyother good approach to do that...
I have been trying to do that senario using servlet on server end...You can found discussion abut taht topic on following link
http://forum.java.sun.com/thread.jspa?threadID=627481&tstart=0
but i have found that i cann't send/receive jaav object at client/servlet end .....
I think, therefore I exist -- Rene Descartes
You can do that, but it might result in a very high number of unnecessary rmi calls.
Hmm but i don't there could be a lot of those rmi calls when i am simply accessing a my controller EJB and calling it's only remote execute method...what do you say
You might consider implementing the controller as a POJO. This basically means that every client will have a local copy of the controller, which will dispatch the calls to the remote server. You�ll achieve better performances while you�ll still benefit from all advantages that the MVC paradigm provides.
very good that seems to be a very good approach but unfortunatly i havent done that thing before so if you can provide me any example code or atleast a good source to learn then it would help me a lot....
With servlets you have to use the stateless HTTP protocol: you always send httpRequests and get back httpResponses. If your clients are swing based, then you need to get the stream from the server, parse it and map it to some OO model. The same when sending messages: get the user input, translate it to an http stream, etc. This without adding the extra complications if some server side default objects (like httpSession or app context) must to be accessed. You�ll mostly get into a procedural approach and your application will be hard to maintain and enhance.
yeah i am already trying to do that... i can write an object to the ObjectOutPutstream in servlet but once i get that stream in client how i can get the same object from that stream ... i have no idea about that can you please tell me what should i do at client end to get the same object from server stream(which i did set in my servlet at server end)
thank for replying in that much detail and i am hoping same kind of good response from you this time
reagard
sajjad ahmed paracha
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Hmm but i don't there could be a lot of those rmi calls when i am simply accessing a my controller EJB and calling it's only remote execute method...what do you say
very good that seems to be a very good approach but unfortunatly i havent done that thing before so if you can provide me any example code or atleast a good source to learn then it would help me a lot....
yeah i am already trying to do that... i can write an object to the ObjectOutPutstream in servlet but once i get that stream in client how i can get the same object from that stream ... i have no idea about that can you please tell me what should i do at client end to get the same object from server stream(which i did set in my servlet at server end)
thank for replying in that much detail and i am hoping same kind of good response from you this time
I think, therefore I exist -- Rene Descartes
Their achilles heel is the noogie! Give them noogies tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|