I have action ,helper and business logic classes in my project . Now I m in the phase of integrating the unit functionalities , my concern is which file to choose to write the code for maintaing the session of the user .
where can i get roles and responsibilites of action , helper and business logic files are they part of design patterns or something else.
what do i read for such issues.
jaiser roney wrote:is there any reason why should i write the code in Action class ?
Every Java web application framework built on top Servlet, the framework provides a Front Controller Servlet which intercepts all incoming requests and delegates to Page Controllers/Actions, and then the Controller/Action forward to View. It's just natural to write HttpSession related code in Action classes.
You should try to write some code to get better understanding.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Every Java web application framework built on top Servlet, the framework provides a Front Controller Servlet which intercepts all incoming requests and delegates to Page Controllers/Actions, and then the Controller/Action forward to View.
This is where the biggest misunderstandings and mistakes typically occur. None of the popular MVC-based web frameworks address a Model or provide a container for writing Model business logic. Action objects or Page Controller objects are still part of the Controller. They are the extensible elements of the Controller that are customized and developed for a specific application. They work with a "servlet" object that usually comes with the framework. In a Struts-based component, all of the objects that are created from the struts-config.xml file are Controller objects, for example.
The correct execution path is View -- Controller -- Model -- Controller -- View. How does the Controller know how to communicate with the Model? You write custom Controller Action classes.
In terms of "session" related information, if it is HttpSession related data, then it could fit in well in a Http-based Controller, e.g Action classes/objects. However, if it is another type of "business-oriented" session data, then it would be coded in Model (or Business tier).
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop