• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about class naming

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen these classes called Managers, such as EmployeeManager.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Oscar Calderon
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've already been given two options, "manager" and "service".
 
Oscar Calderon
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, thanks to both for your answers
 
reply
    Bookmark Topic Watch Topic
  • New Topic