Index: [Article Count Order] [Thread]

Date:  Wed, 20 Mar 2002 15:34:25 -0500
From:  David Corbin <dcorbin@imperitek.com>
Subject:  [webricken:63] Re: request attributes and handler creation
To:  webricken@notwork.org
Message-Id:  <3C98F251.80904@imperitek.com>
References:  <3C97D8FB.8090306@imperitek.com>	<20020320.200956.46637479.gotoyuzo@kotetsu.does.notwork.org>	<3C9871D3.9060405@imperitek.com> <20020321.052508.50050138.gotoyuzo@kotetsu.does.notwork.org>
X-Mail-Count: 00063

GOTOU Yuuzou wrote:

>In message <3C9871D3.9060405@imperitek.com>,
> `David Corbin <dcorbin@imperitek.com>' wrote:
>
>>To be useful, my handler needs a bunch of options.  I would rather do 
>>like this
>>    h = MyHandler.new(coreStuff")
>>    h.addFunnyOption ("foo","bar")
>>    h.addFunnyOption ("alpha","gamma")
>>    h.setZoption("gamma")
>>    mount ("/z",h)
>>than do this
>>    mount("/z",MyHandler {"CoreStuff"=> "coreStuff", 
>>"FunnyOptions"=>[["alpha","gamma"],["foo","bar"]],"Zoption"=>"gamma"})
>>
>
>How about this way?
>
>    app = YourApp.new("coreStuff")
>    app.addFunnyOption("foo","bar")
>    app.addFunnyOption("alpha","gamma")
>    app.setZoption("gamma")
>    mount("/z", YourHandler, app)
>
It just seems like a smell to me.  Those characteristics are part of the 
handler object.  Having to creat another object just to hold them seems 
inappropriate to me.  (Though yes, technically, it would work, and 
probably be better than the my second solution, it's not as good as my 
first solution).

>
>--
>gotoyuzo
>
>