SWINGS VS STRUTS/JSF

vijayprabakar
vijayprabakar used Ask the Experts™
on
Hi Experts,

I would like to understand the pros and cons of developing web applications using Swings and Struts/JSF/Servlets/JSP. Basically would like to understand when we will opt for Swings over Struts/JSF/Servlets/JSP.

Please advice.

Thanks
Vijay
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Web clients (using e.g. Struts/JSF/Servlets/JSP) scale better, and are easier to maintain (because they are only installed on the server), but have a less rich user interface.

Swing clients have more functionality, but they can be more difficult to maintain, because a change in the client means you need to redistribute the code to every client machine. Tools like Java WebStart can improve this.
Top Expert 2016

Commented:
Swing is rarely used at all in web apps, since it is client-side code. In certain circumstances, client side code can interact with a web server, and that's where Swing could come in, if a rich interface were required

Author

Commented:
Does Swing make a difference if the internet bandwidth is low in countries like South Africa. I have seen few projects based out in SA use Swings. Please explain.
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Author

Commented:
Also, I guess, if a rich interface is required, we shall opt for JSF Richfaces. Please correct me if I am wrong.
Top Expert 2016

Commented:
Well, you won't get richer than Swing, but as i mentioned, Swing is client-side code

Author

Commented:
Does Swing make a difference if the internet bandwidth is low in countries like South Africa. I have seen few projects based out in SA use Swings. Please explain.
Top Expert 2016

Commented:
No - Swing has nothing to do with bandwidth

Author

Commented:
Actually in one of the projects for SA, the project's UI is developed in SWING. It will make a call to EJB and other layers, and the application is deployed on IBM Websphere application server.

Does that help for operating on low bandwidth countries. This is a running project for SA and there are many more in the same architecture. Please advice.
You might get certain bandwidth advantages with an Swing based application because the server has to send only the required data in case of socket call from Swing instead of the whole web page(including the HTML, images, CSS etc) as would be in case of web applications.

However an application developed with Swing is always a client-server application and never a web application. You would have to always first distribute the client(which gets heavy and download cumbersome) as the application size increases and then have it call your server application.

Whereas with a web application all your changes are centralized on the server and the client can access using a web browser. While Swing might offer you marginal benefit in terms of bandwidth initially, it will always be slower and hog bandwidth when you are trying to distribute the client exe through a central server.

In a nutshell; DON'T use Swing for a web application!! If you design your web application intelligently(with less/smaller sized images), it would be less bandwidth hogging.
Swing is not meant for web-applications, if you are concerned about bandwidth, then you can go for offline caching and web storage feature of HTML5.
read more
http://adam.heroku.com/past/2010/2/25/an_html5_offline_app_example/
http://developer.apple.com/safari/library/documentation/iphone/conceptual/safarijsdatabaseguide/introduction/introduction.html
http://dev.w3.org/html5/webstorage/

Please mention in brief what all you could possibly send to server from client, web-app client can be designed using the above mentioned features that will reduce the bandwidth requirement.

Top Expert 2016

Commented:
>>You would have to always first distribute the client(which gets heavy and download cumbersome) as the application size increases and then have it call your server application.

Yes, although that's only a one-time hit, assuming it's not deleted from the client.

vijayprabakar, why did you ignore all but one contribution to this question?
>>Yes, although that's only a one-time hit, assuming it's not deleted from  the client.

@CEHJ: It would be an on-going process as the client has to be re-distributed again in case of changes/enhancements to the application.
Top Expert 2016

Commented:
>>in case of changes/enhancements to the application.

If that happens, yes, although that's only the case for individual jars as far as JWS is concerned

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial