Discussions

Web tier: servlets, JSP, Web frameworks: Swing vs Web App

  1. Swing vs Web App (5 messages)

    Given business logic developed in a J2EE architecture, when is is better to develop a Swing client that accesses the business logic vs a web front end (say in JSPs/Struts) accessing the business logic?

    If there are moderate visualization requirements like drawing an outline of country or scanning over a timeline, would these requirements be better met using Swing clients than a web app? Will Swing be more performant showing this data?

    If there is a large amount of data, say thousands of rows from a database, is it better to use a Swing client to display this than a web app so that you can display more rows? Will Swing perform better? Or will you still need to implement a paging mechanism? Will paging be more performant in Swing?

    If you developed a Swing client and deployed it to one server, could you deploy something like pcAnyhere or vnc to user PCs for them to access the Swing client? Does this make sense or this idiotic? Is there a better to do this so you don't have to deploy the Swing client to each user PC? What does Swing use to communicate with the business layer? RMI? Can this be secured with SSL or PKI?

    Thanks a bunch.

    Threaded Messages (5)

  2. Swing vs Web App[ Go to top ]

    Given business logic developed in a J2EE architecture, when is is better to develop a Swing client that accesses the business logic vs a web front end (say in JSPs/Struts) accessing the business logic?
    The difference really THICK or THIN. Exactly that. Also the web technologies are abundant in frameworks and future growth
    perspective. I even rememeber Gartner predicting web development will zoom further by 2007. Looking at the way standards and webservices progress, I would rarely opt for a swing based development unless there are some particulars. Accessibility and number of users would be another criteria for the selection. For instance, I would develop an application as web-app with admin interfaces as a swing app for obvious reasons. There are great web components in DHTML / Javascript as well as products like Sitraka JClass GUI components, that can make any rich client experience in web. I cant do justice to this question, but this is something off my head.
    If there are moderate visualization requirements like drawing an outline of country or scanning over a timeline, would these requirements be better met using Swing clients than a web app?

    No. Web can do it equally well with DHTML / Javascript / JClass like GUI widgets as applets.
    Will Swing be more performant showing this data?
    Both (web or swing) will depend on the capability of the client machine. One cant be faster than other.
    If there is a large amount of data, say thousands of rows from a database, is it better to use a Swing client to display this than a web app so that you can display more rows? Will Swing perform better? Or will you still need to implement a paging mechanism? Will paging be more performant in Swing?
    Web would be better as memory capacity of various client machines will differ and so your performance will vary depending on your client machine capability. Also reusability of cached components will not be much.
    If you developed a Swing client and deployed it to one server, could you deploy something like pcAnyhere or vnc to user PCs for them to access the Swing client? Does this make sense or this idiotic? Is there a better to do this so you don't have to deploy the Swing client to each user PC?
    Normally you use Citrix Metaframe for these kind of requirements - Not PCAnywhere ;-).
    What does Swing use to communicate with the business layer? RMI? Can this be secured with SSL or PKI?Thanks a bunch.
    Any protocol can be used. But if your thick client is going to hit a firewall on way - your IT admin is probably not going to allow you deploy the app - or will throw you out of the window looking at the holes he has to punch in the firewall. Also no control on which IP addresses will pass thru the firewall - as all swing clients will need a hole :-)

    -Sanjay.
  3. Swing vs Web App[ Go to top ]

    You can try with WebOnSwing Web Application Framework (http://webonswing.sf.net).
    This framework can create web pages using Swing components, keeping the same source code for both environment. The idea is make use of Swing arquitecture with all its advantages to create web applications, as its components are enough generic to use them in almost any presentation layer, like HTML. Also, this framework, provides some mechanisms, based on a powerful template engine, that adapts the look of applications to acquire a professional graphic design in web. It has some similar aproach to .NET webforms, like a kind of viewstate to maintain the page state through successive requests, and a set of validators (required, regular expression, compare, range, group).
    Using custom html renderes for Swing components, some javascript and dhtml you can use an existing web component or create your own, that will help you to show the data you want.
  4. Swing vs Web App[ Go to top ]

    My experience is that you should use swing if ALL the conditions are met:
    1. You have control over the user environment.
    2. You are replacing an MDI app.
    3. Users work with master/detail information where there is a lot of detail tables.
    4. A lot of tabs on the same page (see point 3).
    5. You do not want to pay $$ for new app server machines.
    6. Users have 1GHz or better AMD XP or Celeron machines with +128MB.
    7. Your seesion data exceeds 1GB RAM for server side persistance. (Depends upon Server memory and OS.)
    8. Users want under 2sec transaction response times (viewed at client) and you have over 1,000 concurrent users. Again, depends upon app server hardware.

    Good luck!
    -Tony
  5. Do you have specific links to the cost benefit involved in swing vs jsp clients? I have a project where a subsystem is already developed in swing j2ee business tier type of architecture and we are investigating the possibility of changing that architecture to a thin client for the other two subsystems. Remember that the user population is intranet not internet. Can you think of advantages given that user group? Can you share any statistical information that you may have?
  6. Swing - Web[ Go to top ]

    My late answer for post. I see that I must say some criticism out and and that I disagree with some things. Also I try to show things, that our IT group see. Our company have more than 800 computers. Different computers: 80% Windows machines, Linux machines and some Mac workstations. With that huge collections computers we must a have IT support for our computers and users. Also we have developers, because company need special programs to run. For windows we have Active Directory activated and no problems to install Java runtime with silent installation for all Active Directory clients. With Linux we have some short scripts, for installing software for all Linux machines. All things are under our control. That's important. With that I want to say that installing Java VM runtime we have rich collection of UI components for workstations. No problem to develop and deploy Swing applications only into one place at server and use it with Java Webstart. We can say that our machines are all Java Machines (Java ready) and also they are Swing ready all of the time. Also we have some information for clients, outside from our company, customers etc. We cant control their computers. Yes, for them we have dynamic web pages. But that part is too small comparing tools that we have made for internal usage. If you say that Swing development is to hard and web pages are what we really need... I can't agree with that. I am REAL programmer and I can work with both of them. If you say other way, then it is psychological problem of that programmer. For example if I also can say that our clients are stupid, cant use computers, etc. Who's problem is that? Its my problem and then I'm not REAL programmer!!! I can say that programming with Swing I can be more productive than with web developing. Yes, sometimes to develop simple web forms is simpler. But If you need more dynamic UI components(trees, tables, buttons with pictures, buttons with check-boxes, etc.) work is rowing over the head. I saw that with NetBeans IDE is integrated JSF and visual tools for development... But when you use struts, ore some other technology, can you say, that you have visual tools for that technology for development? Visual development is old thing, more than 10 years, and also we can say that Swing development is stable. Visual tools for web are, at our point of view changing int time and they are more like experimental things. And if you look closer to NetBeans JSF visual development side, you must to see the things that in web world, UI tool developers try to carry over things that are made in desktop UI world. Thing like: Draw the window, drag-and-drop into that window Buttons, entry fields, etc. Then for button click you write only Java code, what button pressing must to do, what fields in UI must change (that you also write in Java). I saw that one person wrote in comments, that Swing components are hard to understand, DHTML is much simpler... Who's psychological problem is that? That person must maybe understand that visual UI development is the key and maybe she/he must see that NetBeans visual JSF tools(also other Visual tools for Ajax) are tried to make work the same way like in Swing – components under other component, signals by parents, layouts etc. Another thing in web development – deploying and debugging webapp. You should always wait when it is, built, deployed to web server. It take time and you must wait. Maybe there is my problem? But what about productivity – waiting is not good thing. And also if you develop your web components for JSP with tag lib and maybe with other tech – you write HTML, JavaScript, CSS, etc but you must test them and see how they are working – you are spending the time. I see every time, how web developers are going crazy and saying nasty words when they must develop, deploy, test, debug different things like Java code and JavaScript code with different tools. Have somebody seen good IDE where you can in one IDE visually draw HTML, write Java code, CSS, JavaScript and debug Java code and JavaScript code and also JSP code? Uh... time of waste. For Swing you have and you can develop in one IDE and in one language. Our strategy in web parts what we have: don't use JSP and tag libs - we have automatic XML server side or client side transformation. All XSLT tags are not under our development – that's good, we have less work. Top on client-side transformation can put application that are written in any language. Like Qt widgets or Swing/SWT application – our network is SwingReady. With single servlet we can handle web app and desktop app. Ony what we need our business data transformation into XML. Thats it. http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html – there ara still place for Desktop Apps! Sorry about my english.