Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to write client server code for Network Virtual Environment in java? Is it like Threaded Chat Application in java? Should we use J2EE Servlet & EJB?

I am writing java code for"A Network Virtual Environment".I have Already written Multithreaded Client server Application in java where i used "Threaded server Handler" as an interface between server and client,can i use the same code in Network Virtual Environment.

user-image
Question added by Deleted user
Date Posted: 2014/02/04
muhammad Hanif
by muhammad Hanif , Research , ACF international at Dadu

otally depends on your desgin, if you need to use servlets and depend on the servlet contair or the application server on doing common tasks like security, thread pooling and data source handling if you use databases, this will be a good choice but you will need to decide whether to use the http servlets or to implement your own stuff using raw servlets not the http ones

Mohamed Alesh
by Mohamed Alesh , Independent Contractor / Consultant , Upwork (Engineering Team - APIs)

It totally depends on your desgin, if you need to use servlets and depend on the servlet contair or the application server on doing common tasks like security, thread pooling and data source handling if you use databases, this will be a good choice but you will need to decide whether to use the http servlets or to implement your own stuff using raw servlets not the http ones. At the end of the day you can always look for open source implementations of thread pools and other stuff and just use them in your code instead of using a full application server stack. A good option also maybe the Spring framework.

Usman Liaqat
by Usman Liaqat , Principal Software Engineer , Soliton Technologies

Well, i never been to such in Networking mode. But yes we had a scenario where we were testing our Web app on a client machine(Thin Clients) which do not have its own Operating system. More or less the code should work for that But you cannot eliminate the JVM behaviours, accessibiity and Netwrok virual memory, traffic, thread creations on it i.e. no of running threads.

Servlets are for HTTP request responses. if you are having any HTTP requests u may use it but but HTTP requests and threading are bit complex tpics in a sense u need to monitor thread syncronizing as well if u are doing some IOs. But y u need EJBs ? they are not recommended as they have development cost + Netwrok over heads.

More Questions Like This