Jared, You make some great points about what a service is and should be able to do. I think I was a bit vague in my explanation of a service in this context, because it sounds like what you are suggesting is actually similar to what we are talking about:
On Fri, Oct 16, 2009 at 11:46 AM, Jared Rypka-Hauer <[email protected] > wrote: > > Then again, you don't really need an actionpack to make that work, and > you could, if you wanted, stuff all that crap in the controller. Or > you could build a nice, abstracted FileService that any OO app could > use and have the controller lean on that to do the heavy lifting > (which is the relationship that controllers and services are supposed > to have in the first place). Either way, it would work. > > When I talked about a Filesystem Object (FSO) I'm really talking about a FileService like what you are describing (I'm just not using the term Service), so we _are_ talking about using a service to actually do the uploads, and the only question was: who should be calling that service. >From your examples it looks like you agree that it should be the controller, either explicitly or via an action pack. 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? -- Bob Silverberg www.silverwareconsulting.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
