David Bogus on 6 Mar 2008 20:50:15 -0800 |
On Thu, Mar 6, 2008 at 11:15 PM, Mat Schaffer <schapht@gmail.com> wrote: > On Mar 6, 2008, at 9:03 PM, Colin A. Bartlett wrote: > > On Mar 6, 2008, at 7:46 PM, Aaron Blohowiak wrote: > >> put the common code in a module that you then include in both > >> controllers. this lets your controllers share code without having > >> to do any redirects or what have you from the client perspective. > > > > Or make a class that your controllers can inherit from. > > Sounds like East coast vs West Coast to me. :) So maybe that makes my argument for composition, come from flyover country. I don't know how it fits in the with Rails mindset, but I've generally found composition to be more reusable in unintended ways then mixins or inheritance. I have a tenancy to see a need for a new object when I have the same needs in multiple places in my code base. I also don't like having domain capabilities tied to the web. What happens when I want to do foo once a day to generate a report? Do I then have the server create a request to itself? That being said i think I'd put up with some code, that was pretty ugly to my eyes code, if it allowed me to avoid the chatty redirects. Dave _______________________________________________ To unsubscribe or change your settings, visit: http://lists.phillyonrails.org/mailman/listinfo/talk
|
|