Hi to all, probably this question can sound a little bit stupid, but i have the next doubt: I'm doing a webapp using Struts 2, and if you know, in struts 2 you create actions, interceptors, jsp (or some other view technology) and so on. This applies the MVC where View is the view technology like JSP or velocity, Controller is the internal Struts servlets that handle all the requests and the Model are the action classes where you define the application logic when somebody makes a request to Struts Action.
For example if i have a simple CRUD application in my action i can have the methods for update, delete, insert and select. The problem here is that i have to put (consider that i'm not using anything like hibernate or some orm, just JDBC ) all the code with the sql query, statements, resultset and so on inside each action's method. My question is, that to separate that from my actions i want to create classes used by my actions, for example if i have a employees mantainment i have my action EmployeesAction and inside it's methods of insert, delete select and so on i only call the insert method from other class. That "other class" is something like a DAO but i prefeer don't call in that way because i'm not applying the DAO concept at all, so MY QUESTION IS: How can i name those classes? for example if i apply DAO my class could be named like EmployeeDAO, but in my case how can i call it?
Thanks in advance.
Wanna grow? Learn, live, love people and enjoy life
Mazer Lao Tzu
Joined: Jan 20, 2010
I have seen these classes called Managers, such as EmployeeManager.
Oscar Calderon wrote:Controller is the internal Struts servlets that handle all the requests and the Model are the action classes where you define the application logic when somebody makes a request to Struts Action.
Just for completeness, S2 uses a filter, not a servlet.
in my case how can i call it?
I'm not entirely sure what you're asking, but they might also be called services.
Joined: Nov 27, 2009
Well, about the filter, i didn't know that. Thanks for the acclaration.
About "in my case how can i call it?" i mean about how to name my classes, as DAO are named EmployeeDAO, SomethingDAO and so on.