David Bogus on 6 Mar 2008 20:50:15 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Mixin's vs inheritance (was Re: [PhillyOnRails] refactoring controllers)

  • From: "David Bogus" <davidbogus@gmail.com>
  • To: talk@phillyonrails.org
  • Subject: Re: Mixin's vs inheritance (was Re: [PhillyOnRails] refactoring controllers)
  • Date: Thu, 6 Mar 2008 23:49:34 -0500
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=0Jqj5oold1NTuM5f8v2kQb/h03rI6sBXaj6cLDwqVJ4=; b=Po12nyVetrorIiMysom05DVT2IDM59mM6Krm1pqeff6W58E2UsJP2vxaLcGel8d96UXWXm05NP5iYycg1TQBaZOrTUH+Cgx7niPFpBhqE6NrghToxvyV1a1VBxTdQr1OQL8h/z6rWQGxKGMt5Zj22te+r/4Wem+QoxNCKi+VcR4=
  • List-archive: <http://lists.phillyonrails.org/pipermail/talk>
  • Reply-to: talk@phillyonrails.org
  • Sender: talk-bounces@phillyonrails.org

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.

To unsubscribe or change your settings, visit: