Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Advise needed

 
Jamal Hasanov
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm designing forum. Client side is applet. Storage of forum info is in Oracle DB.
What can you advise for server-side?
-EJB
-Servlets
-or smth. different
I want to use EJB(Entity BMP). What can you advise me?
Thanx,
Jamal.
 
Shubhrajit Chatterjee
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that using applets and EJBs will be a overkill for designing a forum application. I would rather suggest use JSP and Servlets in a MVC architecture.
 
Jamal Hasanov
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You think that Servlets must perform all Oracle connection/select/update/delete operations? Isn't too hard for servlet?
BTW, what is MVC?
Thanx,
Jamal
 
Maggy Zhang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should use java bean to connect to DB. Servlet is just for controll and used to invoke corresonding java bean .
 
Jamal Hasanov
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i think that, there'll be
Applet <-> Servlet <-> EJB <-> OracleDB
But, what type of EJB can you suggest? Entity or Session?
Thanx,
Jamal
 
Shubhrajit Chatterjee
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MVC Stands for Model View Controller
Use JSP for your front end. This is your view layer. You want to use applets... But I have not seen any forum which is designed with applets ... IMHO applets will be an overkill.
Use a Servlet as your application controller. All forms in JSPs are posted to this servlet, which then delegates it's job to different java beans ( not EJBs) to carry out your business logic.
The java beans will wrap your business logic, make database calls, etc... This is your model
After doing processing the controller will forward its response to another JSP.

Using EJBs for such a simple application will definitely be an overkill. Still, if you insist to use EJB...
1. Session beans can be used to do anything ... however people use entity beans as they offer a good logical design... they can model a database entity.
2. If you use entity beans, be careful when you design your finder methods. If any finder method uses a query like 'select * from java_ranch_users' huge amount of entity beans will be instantiated(No of rows of the table), which will deteriorate performance (If it does not crash the server)

Originally posted by Jamal Hasanov:
Yes, i think that, there'll be
Applet <-> Servlet <-> EJB <-> OracleDB
But, what type of EJB can you suggest? Entity or Session?
Thanx,
Jamal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic