wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Project type selection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Project type selection" Watch "Project type selection" New topic
Author

Project type selection

Castor Tack
Ranch Hand

Joined: Dec 06, 2010
Posts: 31
Hi All:

Here's my problem:

I'm learning to build an GUI application embedded into a web page. When a user interacts with the GUI application, the application sends the inputs of the user into a database and gets the data requested by user.

I think the GUI application should be applet. But I've done some reading and see people claiming that applet cannot successfully manipulate databases due to security issues. Some say that I need to use servlet to access database.

I'm a bit confused. Should it be:
user ---> applet ---> servlet ---> database file ?


Please give me some ideas of yours as to what the flow diagram should look like.


Also, if you could share with me a similar raw project that has a framework ready, I'll appreciate it. I just need some starting point.

Thanks in advance.


The BEST user interface design I've ever seen? --- A flush toilet.
Wim Vanni
Ranch Hand

Joined: Apr 06, 2011
Posts: 96

It's not uncommon to work with the MVC design pattern: Model-View-Controller. Several available frameworks include this pattern in one way or another: Spring, Vaadin, ...
It seems appropriate to me to get your head around this (and other) design pattern(s) and see how they help you keep your (web) application tidy and organized. In case you lack the time, maybe do some tutorial exercises from Spring or another framework to learn-by-example.

Good luck with your project!
Wim
Castor Tack
Ranch Hand

Joined: Dec 06, 2010
Posts: 31
Wim Vanni wrote:It's not uncommon to work with the MVC design pattern: Model-View-Controller. Several available frameworks include this pattern in one way or another: Spring, Vaadin, ...
It seems appropriate to me to get your head around this (and other) design pattern(s) and see how they help you keep your (web) application tidy and organized. In case you lack the time, maybe do some tutorial exercises from Spring or another framework to learn-by-example.

Good luck with your project!
Wim


Thanks Wim. I've done some reading and am clear (I think) about the high level structure of the app.
I will still use applet. Once the user inputs data into the applet, it will communicate with the server using sockets. I guess the server side program is servlet?
Then the servlet should be responsible for updating or fetching the data in the database.
Wim Vanni
Ranch Hand

Joined: Apr 06, 2011
Posts: 96

I don't quite understand how you focus on an applet if you want to create a web application. Web means html (well, more than that but still ..). Spice up your html with some scripting (javascript, jsp, asp, php, ..) and the sky is the limit
Or maybe the use of an applet is a requirement in this case. But then I'm afraid the ceiling is the limit ;)

For interaction with the database there are quite a lot of possibilities too. DAO - Data Access Objects - is often used and can be sufficient. If your app is big, there's usually an extra framework like Hibernate or Java Persistence API to help you with all the reading, writing etc of data.

Wim
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Project type selection
 
Similar Threads
Servlet and Applet communication
Servlet and Applet communication
Calling a GUI application from Servlet
applet servlet communication
Servlet-Application communication