only in this topic
Open this post in threaded view
I'm really interested using Groovy for DSLs. I've read some articles and books (DSLs by Martin Fowler, Groovy for DSLs by Fergal Dearle, Design Guidelines for DSLs and some others).
Currently, I am trying to create a DSL and just want to generate code. Here's an example of a model written in the DSL:
I'd like to make it more convenient and omit the
Using BuilderSupport in groovy it was an easy task, just checking if the parent is an
and interpret every unknown child as an
A quick look at FactoryBuilderSupport I've found only examples using keywords, e.g. SwingBuilder.
Is there a way to register factories for children of a specific keyword or do you know a better approach?
For further workings on my DSL, I've got some other questions:
- is there an easy way to make libraries extending the DSL?
- How can I make use of the grouping feature in FactoryBuilderSupport? What is it for exactly for? -> public void registerFactory(String name, String
, Factory factory)
- Do you know guides which can help me get a deeper understanding of the FactoryBuilderSupport class, since it may have more useful features I could make use of?
- By using Groovy for DSLs, you write
To reach the syntax you'd like to, sometimes you've got to use groovy in a tricky way. Do you know collections of some tricks?
For all those, who never heard about (Factory)BuilderSupport, here are some examples how to use BuilderSupport and FactoryBuilderSupport:
Thanks in advance
Return to Groovy Users
1 view|%1 views
Free forum by Nabble
Edit this page