This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Best way to update collection, who has responsibility, in DAO + one-to-many situation  RSS feed

 
Bert Bertens
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was wondering what's the best way to do the following.

client logs in on website,
client selects a "Project"
client uploads an "Image" for the selected "Project".

I have a Project-class which contains a Set of Image-instances.

this is the code when the user presses the upload-button, from the ImageBean-class:


Is this a good way to do it? Or should the create-method of the imageService-class do the p.addImage and projectService.update stuff?
Or should there be a projectService.addImageForProject(Image image) method?

Kind regards
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!