Index: [Article Count Order] [Thread]

Date:  Wed, 20 Mar 2002 20:09:56 +0900 (JST)
From:  GOTOU Yuuzou <gotoyuzo@notwork.org>
Subject:  [webricken:59] Re: request attributes and handler creation
To:  webricken@notwork.org
Message-Id:  <20020320.200956.46637479.gotoyuzo@kotetsu.does.notwork.org>
In-Reply-To:  <3C97D8FB.8090306@imperitek.com>
References:  <3C967342.6040204@imperitek.com>	<20020320.063519.103024541.gotoyuzo@kotetsu.does.notwork.org>	<3C97D8FB.8090306@imperitek.com>
X-Mail-Count: 00059

In message <3C97D8FB.8090306@imperitek.com>,
 `David Corbin <dcorbin@imperitek.com>' wrote:
> GOTOU Yuuzou wrote:
> >HTTPRequest is a representation of the HTTP request
> >messages, and I want the user-defined data to be
> >managed by the user-defined containers.
> 
> The intent behind "attribute" is to be able to set user-data that is 
> automatically get carried along with the rest of the request, and in a 
> very annonymous way.  It's perfectly reasonable to expect several 
> different "handlers" to need to "add or extract" data to the "request 
> chain".  The only other solution I can see is to add a third argument to 
> all the service, do_GET and do_PUT methods, which is nothing more than 
> the Hash that I put inside the request object.

OK, HTTPRequest will have attributes.  But I prefer
the name of "attributes" which returns a Hash rather
than "get_attribute" and "set_attribute".

> You mentioned 'the user-defined containers'.  What user-defined containers?

I wanted to say the containers which is held by application.

> >get_instance() is just a factory method. You can also
> >make it as an instance method which returns itself.
> >Have you seen httpservlet/prochandler.rb?
> >
> Yes, I did see it.  But it fails to address the point about *how* I want 
> to create the handler.  I thought about that, but I didn't want to build 
> a giant "option" hash. 

I cannot understand why a giant "option" hash is built
by get_instance().  Options are passed from mount and
it's not duplicated.

> Futhermore, I'd argue that option my patch 
> offers is more intuitive to new users.

I have to admit that the present handler creation is not
intuitive. But I wouldn't like to add new interface as
soon as possible. Please let me think for a while.

> >Well, "require_path_info?" might not be necessary ;)
> >
> I'm not sure I fully understood that method to begin with.

It is to avoid getting another evaluation of relative URI.
It originates in my having made FileHandler first.
For the present, I think that it is the problem of each
application.

--
gotoyuzo