Hi Chris

I think this is a good direction to go in.  I am already starting to
do something similair  this with repoze (I am still on 1.0.1) but plan
to upgrade in the next few weeks,.

The advantage of this style of configuration really comes into its own
when you are running on appengine.
With appengine you really can't rely on long running apps, so being
able to defer some of the declerations/registrations until you
actually need them
(for instance only bother registering stuff for an admin user if an
admin user is logged in) is really important because its startup time
of a cold instance
that will kill you at times.

Using ZCML means is difficult to choose when to register things
(without jumping through hoops) and view decorators are just as bad.

Thanks for the great work.

T

On Sat, Nov 28, 2009 at 1:57 PM, Chris McDonough <chr...@plope.com> wrote:
> Hi folks,
>
> I've been working on the next minor revision to repoze.bfg, which will be 1.2.
>
> 1.2 will be a slightly more important release than the previous 1.1 release,
> because it involves exposing an "imperative" API for configuration (adding
> routes/views, etc).
>
> In particular, it means that the simplest repoze.bfg application can be
> represented as a single file:
>
>    from webob import Response
>    from wsgiref import simple_server
>    from repoze.bfg.configuration import Configurator
>
>    def hello_world(request):
>        return Response('Hello world!')
>
>    if __name__ == '__main__':
>        config = Configurator()
>        config.add_view(hello_world)
>        app = config.make_wsgi_app()
>        simple_server.make_server('', 8080, app).serve_forever()
>
> As far as I can tell, aside from package dependencies, such a configuration
> mode puts repoze.bfg in the same category as "microframeworks" (such as Bottle
> and Tornado), because applications can start as a single file, then evolve 
> into
> a package, then maybe "grow" declarative configuration in the form of ZCML, 
> and
> so on.  repoze.bfg, on the other hand, has a good deal of functionality that
> microframeworks lack, so I like to think of this functionality as sort of the
> "best of both worlds" feature.

>
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to