From: Sys Ppp Date: 2009-08-29T02:10:22+09:00 Subject: Re: Rack must not dictate how to create a middleware Brian Candler wrote: > 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. But on my opinion that "Builder must not make any limitations", you have asked by yourself - word for word - Why "must" it not? And you have added after it. - "It makes the 99% usage case simple". My point of view was very clear. Builder must not create objects by itself in its :use method. Only don't say, that I try to dictate anything. I am not the Builder. ;) I just show the choice. > 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. "Syntax" is that commands follow one by one and an operand follows an operation. But semantics is that 'use X' means just use X, where X must be some precreated object, not its class. And semantics of Rack::Builder in particular is that in 'use x' x is a middleware, not an app in an endpoint. And if semantics is to create something, it must be just 'create something'. use a use b create C create D run x > 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. Also it is the main benefit of Open Source that if somebody will like my point of view, one can by himself "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". The Builder is not very complex for it. But I do not dictate it to anybody. Im not the Builder of anybody's mind. ;) -- Posted via http://www.ruby-forum.com/.