Hi keke! This is excellent and will remind to some long Restlet users an experience that was made on "fluent builders" early in API design. Lars are you around? :)
It seems to me that Groovy DSL are much more capable of supporting this style of programming (DSL) than what we initially achieved with a pure Java fluent API. I have added Guillaume Laforge (Groovy manager) in copy. I remember a presentation on DSL that he made recently to me and a group of open source fellows. He might be interested in hosting your project as a Groovy module... :-) I've had a look at your converted tutorial examples and they look pretty nice and compact: http://code.google.com/p/groovy-restlet/wiki/RestletTutorialExample Great work! Best regards, Jerome > -----Message d'origine----- > De : keke [mailto:[EMAIL PROTECTED] > Envoyé : mardi 26 février 2008 09:56 > À : [email protected] > Objet : GroovyRestlet, a simple DSL for constructing Restlet > application easily > > Hi All, > > I am working a simple Groovy Builder > <http://groovy.codehaus.org/GroovyMarkup> for Restlet, which > intends to create a complex Restlet application using a > simple shortcutting syntax. Also this builder is trying to > support smooth Spring integration. > > Here is a short example > > > builder.component{ > > current.servers.add(protocol.HTTP, 8182) > > > application(uri:""){ > router{ > > def guard = guard(uri:"/docs", > scheme:challengeScheme.HTTP_BASIC, > > > realm:"Restlet Tutorials") > guard.secrets.put("scott", "tiger".toCharArray()) > > > guard.next = directory(root:"", autoAttach:false) > > > > restlet(uri:"/users/{user}", handle:{req,resp-> > > > resp.setEntity("Account of user > \"${req.attributes.get('user')}\"", > > mediaType.TEXT_PLAIN) > }) > > > restlet(uri:"/users/{user}/orders", > handle:{req, resp-> > > > resp.setEntity("Orders or user > \"${req.attributes.get('user')}\"", > > mediaType.TEXT_PLAIN) > }) > > > restlet(uri:"/users/{user}/orders/{order}", > handle:{req, resp-> > > > def attrs = req.attributes > def message = "Order > \"${attrs.get('order')}\" for User \"${attrs.get('user')}\"" > > > resp.setEntity(message, mediaType.TEXT_PLAIN) > > }) > } > } > }.start() > > For more detail, please visit project site > http://code.google.com/p/groovy-restlet/. More examples are provided. > > I am not sure whether this would be a nice idea, any comments > and suggestions are highly appreciated. > > -- > We paranoid love life >

