Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts DAO layer and DTO objects

 
manoj samarasinghe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
For my STRUTS PROJECT....I have to connect to a database using DAOs.
I used two layerse called DAO (data access objects) and "service" layer where business logic is reside.i used DTO (datatarnsfer objects) for transfer data from frountend to backend.

later i add another layer between frount and service layer called delegate layer to redue coupling.

Actions-->delegate--> service-->DAO

my problom is what kind of methods i have to use in these layerse.
do i have to use more specific methods at delegate layer, and fewer and 'more general' ones at the DAO or othr way round?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the ORM forum.
 
john guthrie
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my rule of thumb is that it gets more specific the further you get from the persistence layer. so the DAO layer might have a getAllWidgets() method, and the service layer have getAllGreenWidgets() and getAllRedWidgets(). the delegate layer shouldn't have any finer granularity than the service layer,it's job is to just, er, delegate, yes?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic