File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Design Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Design Question" Watch "Design Question" New topic
Author

Design Question

Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
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
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

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'.
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
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
Vlad Patryshev
Ranch Hand

Joined: Jun 30, 2001
Posts: 61
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...

Thanks,<br />Vlad
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
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.
Vivek Viswanathan
Ranch Hand

Joined: Mar 03, 2001
Posts: 350
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.

Vivek


Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design Question