From: Brian Candler Date: 2009-08-29T00:43:04+09:00 Subject: Re: Rack must not dictate how to create a middleware Sys Ppp wrote: > Brian Candler wrote: >> Sys Ppp wrote: >>> But Builder must not make any limitations for using singletons or any "classless" objects there they are needed. >> >> Why "must" it not? > > Why must objects be created by Builder and not be created outside? I never said objects must be created by Builder and not be created outside, because it's not true. If you think that, then you have missed the point. If you use rackup, which in turn reads config.ru and wraps it in a Builder class, then you are using Builder. But in the first case, you don't need to use rackup at all to start your application; and in the second case, even using Builder, you can write x = any_combination_of_rack_modules_you_like run x (where 'x' is any object which responds to #call) That is, you are not required to use the 'use X' syntax at all. I think the advice given here is sound: write a patch, submit it to the rack-devel mailing list, showing how it would change Builder usage and what new things you would be able to do with it. If they don't like it, nothing stops you maintaining your own derived Builder class for your own use, and/or publishing it for others to use. *That* is the main benefit of Open Source. -- Posted via http://www.ruby-forum.com/.