Right now I have a simple poll applet that consists of check boxes, and a submit button. Users select one of the boxes and then submit it. From there it goes to a servlet and then the servlet updates a database, and then the servlet returns the updated results of the database. So it's an applet on front end, servlet in middle and database on backend. I could probably eliminate the servlet and just have the applet connect to the database(they're on the same machine). Should I get rid of the servlet since it isn't really necessary? What are the pros and cons of using the three-tier while I could use the frontend and backend? If anyone has any suggestions, I'd welcome them. Thanks. - Sean
My own thoughts are to get rid of the applet part. Make it a very simple form, and your servlet serves as the 'backend processing'.
Joined: Dec 16, 2000
That's what I started out with originally. I've kept the servlet in the middle, but right now I have the applet opening a new frame to post the results. I'm still playing around with it though. I wanted to stay in the realm of the applet because I planned on having numerous polls and thought it would look better with a frame. Furthermore, I was trying to learn how to create a quiz applet. I'm still working on that though. Thanks. Sean
While I would never dare to write applets for the forms you describe, you probably know better. You want an applet, you have it. Now you want to get rid of the servlet. You can do it, and do away with it for a while. But if you are going to support and evelop the application, it will soon become a nightmare. You will actually have (or be tempted) to develop your own protocol to communicate between your applet and whatever is on the server side. Then some day someone comes and asks you to add security. Are you going to start using SSL instead of practically transparent HTTPS? On the other hand, this might be exactly what you want to do to this project, who knows...
Joined: Dec 16, 2000
It's just something for my own website. Security isn't a concern. I already finished this though. Although it could use a few touch ups here and there. I used an applet on the frontend, servlet in the middle, and a database on the backend. The applet sends the post data to the servlet, and the servlet then updates the database. The database then sends the updated results to the servlet and the servlet passes them on to the applet. The applet then has a small frame popup and display the results. I may do some touch ups graphically(bar charts to display the results), but it's working quite nicely.
Since you have the Applet and the Database on the same machine, y not get rid of the applet and develope Java Application, that talks to the database directly, that way you will get all the features of jdk1.2 whcih you wont get if u use applets since jdk 1.1 is only supported my most of the well known borwsers. On the other hand if u intend to make this program avaliable on the network then you should probally get rid of the Applet and write a simple form that interacts with the servlet. Do not add database access code into u'r applet becasue of the security problem.
Thanks for the reply, but in terms of implementation, I think I'm all set. I went with the applet up front, servlet in the middle, and database in back. The reason I want the applet is because this is displayed on my webpage.