Creating your own DSL / DSL template

We've had the following question posted to the newsgroup on the DSL Tools site:

"Can I create a template of my own... right now? Two templates are available but my model doesn't fit into any. Can I use the 'Blank Template' and delete the existing model and create my own model. Is this possible right now? If I do this what all will I need to change wrt to the .dd file and resource files."

The basic model here is to design your DSL, or, more specifically the tools to support that DSL, based on an existing template. In the December CTP we aonly provide two templates: a blank one, with virtually nothing in it; and a template which started life as a simple architecture chart language and has evolved to include one of everything that is currently supported in the DD file. Over time we'll be updating and expanding this set.

Using these templates you can build your own language. As the questioner suggests, you do this by choosing one or other of the templates in the wizard, and then updating the domain model (deleting stuff, renaming stuff, adding stuff), and then updating the dd file and the resources files to match. The end to end walkthrough takes you through this process for the construction of a UIP Chart language. So, in short, you can go create a designer now for whatever language you like, with the big proviso that it fits within the realms of what the dd file currently supports.

And there's the rub. Updating the .dd file is not as easy as it should be, and what is currently supported is rather limiting (e.g. see the known issues list). We will shortly be releasing (within the next couple of weeks) another preview which will fix some key bugs and provide a dd file validator which should make it easier to work with dd files. Our plan after that is to release a preview that will work atop the Beta2 release of Visual Studio 2005, which will be more robust, and will relax some of the limitations imposed by the dd file. At that time, we should also be in a position to be more precise about our plans until the end of the year.

Now back to the first question: "Can I create a template of my own... right now?". The short answer is no. Well, at least we've provided no documentation and to do it manually can be a painstaking job. We have an internal tool that automates the process of creating the wizard templates from samples, but that would take some work to make available to customers. We are also not fixed on the current format for templates. I'd be very interested to hear of scenarios where customers would find the ability to create their own templates useful or essential. Who would the templates be for - yourself? Someone else? What kinds of language, or aspects of a language, would you want to bake into a template?

Comments (3)

  1. Hi Stuart!

    My name is Angel J Lopez, an MVP for J#, from Argentina, South America.

    I’m developing an open source project AjGenesis, that is a code generator, based on a template language. Now, with people at Southworks, I’m learning the DSL tools.

    I need to create:

    – Code for data mappers

    – Code for declarative actions in EDRA, or in MBI 3.0

    – Code for SQL Stored procedures

    – etc…

    Do I need to create my own template for all this?

    Angel "Java" Lopez

  2. Stuart Kent says:

    I’m assuming that you’ll create your own DSL from which you’ll be generating the code. In which case, you’ll need to write your own templates (like the html report template mentioned in the walkthroughs) to generate the code. If I’ve got this wrong then please comment again.

Skip to main content