• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlets or EJB?

 
Padma Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are developing a portal. The design specified is JSP-EJB's-DAO's-DB.
We are using struts framework n JSP for the view. EJB's for processing, DAO's for frequent data access and oracle as a DB. We are a company with moderate number of employees. around 2000. The portal is for providing access to people in all the departments about their own specific stuff. and managing data at a single space.

What I dont understand is do we need to use struts for the view and again EJB's for processing? Do we need to go for EJB's for this kind of a desining? isnt servlet a better option?

Thanks,
Padma.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're comparing apples and oranges. Struts is for view and controller, not model processing. Especially when combined with Tiles, Struts will give you most of the portal-like functionality (rectangular placement of items with individual controllers behind them) out of the box.

However, that still doesn't address your model logic. That can be done with either EJB's or straight Java beans (plain old java classes) or a combination of the two. Servlet's aren't appropriate here -- Servlets are also meant for controller logic, not model logic.

This is just standard MVC layering -- I'd strongly suggest you read a book that covers both Struts and Servlets so that you can better understand the differences between the two and the advantages/disadvantages of both.

Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!