Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB in struts...

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where does EJB feets into struts (MVC architecture)...

Model - bean classes
View - JSPs
Controller - Servlet that handles request and responds with the help of Action and other classes...

Thanks a lot.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where does EJB feets into struts (MVC architecture)...

Model - bean classes
View - JSPs
Controller - Servlet that handles request and responds with the help of Action and other classes...

If you make use of EJB, Struts can be totally regarded as a Web component.

Model is a bean class, but it could be a simple JavaBean (not EJB) as Entity bean is seldom (or should not be) disclose to the client side.

View is JSP

Controller is the ActionServlet. However, the servlet is mainly used for "controlling" the Web tier flow. When it receives requests, it checks for the types of requests, and then forward the request to the corresponding session bean. After the finished the processes, the servlet obtained the data and then determine the corresponding view for display.

Since EJB holds the business logic, thus, Strut will then become purely Web component and it seldom provides business logic except very special needs.

Nick
 
Rudy Harianto
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in short, Struts and EJB live in a different tier of enterprise system.
Struts = web tier
EJB = business tier

the most common connection between the 2 is that EJB provide heavy business logic and the model (regular java bean) as the result for web tier.
 
Siripa Siangklom
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Session Facade Pattern in your Action classes to control your model.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic