« Day 9: Running CGI scripts on Plack | Main | Day 11: Using Plack::Builder »

12/10/2009

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Uwe

The onion shows a "Session Middleware". Will there be a session handling for Plack?

miyagawa

Uwe: the picture is taken from Pylons (http://pylonshq.com/). We're currently working on Plack session middleware and about to ship the first version pretty soon. It's rather really simple port of HTTP::Session module from CPAN.

john

I guess for me the thing that is most confusing is the overlap in functionality between some of the larger web application frameworks, such as Catalyst, that has relatively mature versions of some of the things going into middleware, such as sessioning, or the stacktrace you pointed out, or the http basic authentication.

I can definitely see the advantage of moving all those bits 'up the stack' a bit, since plack middleware is going to be more broadly useful than say stuff that's specific to a particular framework. I just wonder what will be the effort involved in making sure all the bits work down to the application level.

For example, in Catalyst using the Catalyst session plugin, I configure the plugin via the standard Catalyst configuration method (typically using ConfigLoader Plugin to hold session configuration stuff, like expiration time, what the session storage type will be, etc.) Then I can just do "$c->session..." in my controllers. I imagine plack session middleware will be configured via the .psgi file? I'd worry a bit about possible fragmentation of configuration. Or maybe we will have some sort of lazy way to activate middleware layers so that configuration info can be supplied from deeper in the stack. Then, from say something like Catalyst, I image we'd need some sort of wrapper to expose that session object to the app framework. I wonder if you have any thoughts on the matter.

Maybe over time we will see a migration of efforts from Application specific to middleware and then some of these issue will be solved.

Thank you for putting so much time into helping eveyone understand how psgi is going to rock the Perl Web development world!

miyagawa

john: your concern is valid. Things like StackTrace is no brainer but Authentication or Session is something developers need to configure so it will play nicely with the configuration of framework, say Catalyst.

But hey, this is a solved problem in Ruby/Rack world, precisely the way you proposed. Rails originally started as using cgi.rb and mod_ruby etc. and its own plugin system and has moved to Rack, allowing developers to use Rack middleware components in config/initializers/stack.rb.

http://guides.rubyonrails.org/rails_on_rack.html

I guess this could be added to Catalyst as a Catalyst::Config* plugin (or something equivalent), so the end users can configure Catalyst core and PSGI middleware using the same semantics or syntax.

jjnapiorkowski.vox.com

Thanks for the insight. I will look at that link. I'm also playing with Bread::Board, but that's probably too heavyweight a solution for deferred or service oriented configuration.

Julián Esteves

Just to say that the onion image can be found at https://pylons-webframework.readthedocs.org/en/latest/_images/pylons_as_onion.png

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name is required. Email address will not be displayed with the comment.)

June 2013

Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
Blog powered by Typepad