On Aug 24, 2011, at 11:48 AM, Mike Orr wrote:

> There are two things you lose with @view_config. One, routing details
> are pushed into the view modules, while Handlers and Pylons try to
> make a complete separation between the functionality of the actions
> and which URL they're called by. Although in this new format, the
> commonality is the route name rather than the URL pattern, so that
> maintains some independence from the URL.
> 
> If you use 'match_param='action=logout'', that puts more routing
> detail into the view method than I'm comfortable with at first glance,
> but I guess it's essentially the same as having multiple @action's on
> the same view method, with the advantage that the match variable is
> called by its own proper name ('action') rather than 'name'.
> 
> The other disadvantage of @view_config is you have to use
> Config.scan(), which, while it has been working fine in Pyramid 1,
> still seems a bit magical to me.
> 
> I don't think I'll change Akhet since its purpose remains to be
> Pylons-like, but I'll add "something" to the manual that suggests this
> new structure should also be considered.
> 
> The debug toolbar sounds interesting; I'll have to check it out.

I should note this is the exact reasoning for having pyramid_handlers in the 
first place. Part of it was conveinence and avoiding boiler-plate, but the more 
major reason was an architecture decision about *where* the information about 
URL's and the code they dispatch to actually belongs.

Using @view_config inherently pushes the code hookup throughout the app, while 
add_handler is specifically arranged so that you can tell from a single 
location both the URL's *and* the handler that will be handling them (without 
having to grep your entire project, or use paster pview to see what is going 
where).

I'm looking forward to Michael's route groups feature, which will make things 
much easier for URL generation. :)

Cheers,
Ben

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to