Welcome to MSDN Blogs Sign in | Join | Help

Costs of designing a DSL - UML the answer?

RobR > Tools built on the type of meta-technology you talk about are not new.

Agreed!  Of course, I'm working at Microsoft rather than at a university, so utter novelty is not a claim. In fact, we hope to use the best ideas and experience that have been developed over the years, combining them with some ingenuity of our own.  In particular, we want to aim for industrial-scale application of these ideas.

RobR> textual languages, like programming languages and expressions languages are so essential. I simply don't believe that you can generate real systems from visual representations without the visual representation becoming hugely complicated.

Absolutely agreed! 

RobR> This is again where standard expression languages like OCL and ASL can fit in

An excellent general purpose constraint language, and an excellent general purpose imperative language (with interesting mechanisms for 'bridging' between levels of abstraction). But again, they're general-purpose, and so it's inevitable that they will be too heavyweight for many of the domain-specific purposes we might want to put them to.

RobR> When using a textual DSL, you then have to consider the needs of end users: will they be able to learn it?

Yes, the initial costs, learning included, are among the drawbacks of real DSLs, whether textual or graphical.  It's only worth inventing a new DSL if we think we've got a big enough application domain that it will be worth the cost of our users learning it; and, of course, worth the cost of developing and maintaining it.

To mitigate the costs of learning, here's a bright idea: when we invent a DSL, let's try and stick to a small set of grammatical styles, merely varying the parameters of those styles from one language to another. Our language-designing users would start by selecting from a bag of templates. We could have one style with boxes and lines, say, and another with vertical bars and arrows between them, and another with nested boxes and arrows; and some textual basics. Hey, wait a minute -- doesn't that all sound familiar -- hey, that's just like UML! Well, whaddya know -- maybe we should be using UML as the basis for all our DSLs?

Well, unfortunately, I don't believe so. UML and its tools weren't designed with that approach in mind -- that its role should be to provide a set of templates for a wide range of DSLs. Its envisaged roles are for specifying and designing software, and so it has all sorts of constraints that make perfect sense for that domain; and it has no features for cutting the language down. If I do want to invent a totally new style of syntax -- like math formulae, or block diagrams -- there are no facilities. Only by going into MOF can I get near doing that kind of stuff: and MOF is not for beginners, and not well-supported by tools.

 

Published Monday, November 15, 2004 2:32 PM by Alan Cameron Wills

Comments

# re: Costs of designing a DSL - UML the answer?

Many of the comments coming out of Microsoft about 'why not UML' with regards to DSL sound more like excuses for a decision that was already made instead of an explanation for a decision that was made weighing UML as an option.

MOF is complicated? Abstracting model domains using the same base modelling language as the one being targeted is complicated. Does that mean you shouldn't try?

So if not MOF, or metamodels (UML profiles, etc), what then? What is Microsoft's answer? Start from scratch for each DSL without anything universal tying them together other than boxes and lines? I hope not, and I would like to doubt it, but the responses I've read don't really clear up that issue.

XSD schemas can be complicated, in part because they rely on the same underlying language that they are targeting. But the value seems to outweigh the cost of using domain-specific languages for defining schemas. Should modelling be that much different?

"Its envisaged roles are for specifying and designing software, and so it has all sorts of constraints that make perfect sense for that domain; and it has no features for cutting the language down. If I do want to invent a totally new style of syntax -- like math formulae, or block diagrams -- there are no facilities." Have you seen SPEM? It's an interesting metamodel, represented in UML for representing software development processes in UML. Rational built the RUP process definition on it and it seemed to work really well. If they could do that for something that is even farther away in terms of domain than DSL's are (modelling software systems), why can't Microsoft? Or is the real question 'won't' as opposed to 'can't'?
Monday, November 15, 2004 5:10 PM by DJ

# re: Costs of designing a DSL - UML the answer?

DJ> So if not MOF, or metamodels (UML profiles, etc), what then? What is Microsoft's answer? Start from scratch for each DSL without anything universal tying them together other than boxes and lines? I hope not, <DJ

Yeah, I hope not too. That would be dreadful.

But then you have the same problem even if you build them atop UML. UML gives you a somewhat higher platform to start from, but only if you happen to want to write a language that's got everything in UML. In some cases that will be true, and UML will be a great start for that. In other cases it won't.

DSLs need to be built on top of each other, just like anything else: you build one by importing pieces already defined. That's true of anything we build in software development -- look at the import/using/include statements at the top of any chunk of software: each chunk forms part of a huge directed graph. Language definitions can form the same kind of graph.

Seen in that light, UML is one of the languages that appear somewhere up that graph. For some purposes, it is the ideal piece to import and build upon; for others, it ain't. We'd like to make it easier for all cases.



Tuesday, November 16, 2004 10:34 AM by Alan Cameron Wills

# re: Costs of designing a DSL - UML the answer?

See url.
Wednesday, November 17, 2004 10:21 AM by Anders Ivner

# re: Costs of designing a DSL - UML the answer?

Learning UML by Sinan Si Alhir
Book: 9"x7"x304 pages = 19,152 sq. in.

Jon's diagram of the day
Key at bottom of page: 2"x3" = 6 sq. in.

Short Answer Questions:
Which notation is faster to learn?
Which notation can be chnaged easier?
Which notation is appropriate for busy non-techs?

Essay Question:
How would you apply UML to describe the route your local trolly or subway runs? Keep in mind that children and non-english speakers need to understand it.
Tuesday, December 14, 2004 8:16 PM by Jonathan Allen
New Comments to this post are disabled
 
Page view tracker