logo       

Re: A "catch-all" component?: msg#00248

web.mason.user

Subject: Re: A "catch-all" component?

> > -----Original Message-----
> > From: Dave Rolsky [mailto:autarch@xxxxxxxx]
> > Sent: Wednesday, August 20, 2003 4:22 PM
> > To: Marc Logghe
> > Cc: Egor Shipovalov; Mason-Users
> > Subject: RE: [Mason] A "catch-all" component?
> >
> >
> > On Wed, 20 Aug 2003, Marc Logghe wrote:
> >
> > > One thing that I was also thinking about (but never dared to post
> > > because of the potential high level of silliness ;-) is extend the
> > > dhandler concept to all components, not only the requested
> > components.
> >
> > That's called a subrequest.
> Well, not exactly.
> What I meant was the following. Suppose a request is made for /index.html
in which a call to the component <& /languages/show_news.nl &> is made. But,
the component /languages/show_news.nl does not exist. Normally Mason will
throw an exception, right ? What I was thinking about, is that instead, it
is handled by a dhandler like component which then can connect to a database
for instance, and fetch news items from a database. Or, e.g. another
scenario, calls the component /languages/show_news and implements the dutch
translation one way or another.
> Of course , this should be configurable, because one might not want this
behaviour site-wide but only in certain folders.
> Am I crazy or am I crazy ?

You are not crazy - it would be nice to do this. The trick is how to
configure it - how to indicate which folders it should happen inside. You
don't want every not-found component call to search for dhandlers.

In general, it would be nice if certain directory hierarchies could be
designated as separate little worlds from the larger component tree. When
you call into that hierarchy, you check for autohandlers and dhandlers as in
a top-level request, and the upwards autohandler/dhandler search is limited
to the little hierarchy.

As Dave points out the current accepted solution to this problem is the
subrequest, but it's not ideal. First, the caller of a shared component
shouldn't have to call that component differently just because it happens to
make use of a dhandler or autohandler. Second, a subrequest is a heavy
concept and entails many things that you might not want when just trying to
use autohandlers/dhandlers in a non-top-level component call.

Jon



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise