I see where you're going... and yeah, I do agree that the controller  
should tell the file service to upload the file as part of the request  
processing cycle. If you have an event like product.add which includes  
adding an image for that product, I think the event should tell the  
file service to manipulate the uploaded file and make the path to the  
file in its permanent location available for the product service to  
store. The product service shouldn't concern itself with files... it  
should concern itself with product related behavior and the data  
required for that behavior to be enacted.

So yeah, I guess we're in less disagreement than I thought. :)

J


On Oct 16, 2009, at 11:05 AM 10/16/09, Bob Silverberg wrote:

> I was a bit vague when I used the term Service earlier.  I meant a  
> domain-specific service, like a UserService or a ProductService.   
> Imagine that we have a ProductService with an update() method that  
> is responsible for accepting input from a controller and then it  
> does everything that needs to be done with that info (e.g.,  
> validation, persistence, etc.).  The question was, should that  
> ProductService also be responsible for asking the FileService to do  
> the uploads, or should that have already been done by the controller  
> prior to calling the ProductService.
>
> So, where do you stand on that question?  It sounds to me like you  
> feel that the controller should tell the FileService to upload the  
> files, rather than having the ProductService tell the FileService to  
> upload the files.  Is that accurate?

--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to