Welcome to MSDN Blogs Sign in | Join | Help

UML and DSLs Again

I’m often asked by audiences, visitors to Microsoft and journalists to explain our position with respect to UML (e.g. VSLive! Interview). Many people who read our views on model driven development, as described in these postings and other places, assume that our emphasis on domain specific (modeling) languages, or DSLs, somehow has put us into an anti-UML position.  We want to make it clear that this is not true. While I laughed out loud at some points in Alex Bell’s excellent article in March 2004 ACM Queue called Death By UML Fever, we still agree with many of the points made by Grady Booch in his response. Before UML, there was an unproductive diversity of modeling approaches, and their convergence into UML 1.0 was a significant step forward in using models in software development.

 

But for whatever reasons, the existence of UML and UML-based tools, has not significantly changed the way developers build applications. Nor has it significantly contributed to developer productivity. Since Microsoft ships one of the most-used UML tools – those based on Visio in Visual Studio Enterprise Architect - we anonymously survey developers (not just our customers) on tool usage. We have discovered that it’s a very small population who claim to use UML tools in support of their tasks, and most usage clusters around class diagrams and use case diagrams. When we drill into those who claim to use class diagrams, it’s a tiny fraction that actually uses them to generate code.

 

This was one of the driving forces behind Whitehorse. We really wanted to take tasks that developers and architects find difficult, and figure out ways that modeling tools could add value and help them. We are enthusiastic supporters of UML notation and diagrams. A walk around the developers’ offices just in my corridor reveals whiteboards covered with UML class diagrams and sequence diagrams. Just the other day, my colleagues and I were in the cafeteria sketching out an architecture on a napkin using UML diagram fragments. We use UML notation in specification documents, and I have a data model of large chunk of our Business Solution division’s applications data model as a poster hanging in my office – yes, drawn with UML notation! To support the need for our customers to produce documentation and conceptual sketches we’ll continue to ship the UML toolset with Visual Studio 2005. In fact, at Microsoft generally, we use UML for many purposes – mostly documentation or sharing of conceptual ideas – but almost never for any purpose where those documents relate to actual software development artifacts.

 

Those same whiteboards in offices in my corridor are also covered with scrawled code. But again – these are sketches – they are rarely point-perfect compilable program source. That’s a key difference for developers. Any artifact that contributes to actual software development must be capable of manipulation digitally. Source code has a well-defined syntax, a comprehensible semantics - often defined behaviorally by the compiler’s transformation of it to lower level code or IL - and can be manipulated consistently by compilers, debuggers and re-factoring programs, to name but a few. To be useful to developers, a model must have the same status as source code. It too must have a precise syntax, a comprehensible semantics, and well-defined mappings to source code or other well-defined models. And it must be more than just documentation.

 

Take the Whitehorse Service Designer, for example. It’s not just documentation, although it can serve that purpose. Rather it allows a developer (or architect) to focus on one aspect of her system – the connectivity between services in a service-based architecture. She can design this aspect of the system before building projects, WSDL files, code and schemas, or ask the tool to document connectivity between services if those artifacts already exist. Since connectivity information is scattered throughout many development artifacts, the holistic view such a diagram gives is fundamentally useful even though all the information it conveys could be deduced by careful scrutiny of the implementation artifacts. The Service Designer has a well-defined syntax (its DSL metamodel), and predictable, always-synchronized mappings to the various implementation artifacts. The underlying designer framework plays the role of a compiler for Service Designer diagrams, much like the role played by a traditional compiler with respect to source code files.

 

But, you say, why couldn’t the Whitehorse team have just built this new “language” of service connectivity as an extension to UML – especially with the improvements made to UML 2.0?

 

Well, when we looked at the direction the UML 2.0 specification had taken, we realized that there were several reasons this could still not be the basis for development artifacts that were anything more than documentation of a system. Since no natural sub-language of UML fits the requirements for service connectivity, we would have had to resort describing our Service Connectivity DSL using stereotypes and tags on an existing UML sub-language. This would have led to an overly complicated model within what has been described by many in the industry as an already bloated and complex specification. Using standard UML notation, in which an existing shape corresponding to whatever sub-language we’d extended is reused, would have compromised the readability and clarity of the diagrams. Lastly, we’d have been dogged by the lack of precision in the specification in key areas, and the mismatch of type-systems inherent in UML compared to the .Net and XML languages.

 

For these reasons, we elected to define the Service Connectivity DSL using a purpose-built metamodel, itself defined as a member of a family of related metamodels. This gives us a natural and precise foundation for service connectivity, and gives us a high-fidelity mapping to the underlying implementation artifacts which includes, of course, some amount of code. This is the same conclusion we have reached on other focused development tasks, and led to similar DSLs for the Class Designer and the Logical Data Center Designer described in other postings. Support for extensible DSLs, built as a family, with well-defined mappings between them and other development artifacts has thus become the basis of Microsoft’s model driven development strategy.

 

To summarize, we’d recommend using UML and UML-based tools for

  • Sketching,
  • White boarding,
  • Napkins,
  • Documentation,
  • Conceptual drawings that do not directly relate to code.

We’d recommend precisely defined DSLs and DSL-based tools for

  • Precise abstractions from which code is generated
  • Precise abstractions that map to variabilities in frameworks and components
  • Precise mappings between DSLs
  • Conceptual drawings that have precisely specifiable mappings to other DSLs or to code artifacts.

We’d recommend neither of the above for visual programming of detailed program logic (or at least for many years yet), despite Grady Booch’s optimism about executable UML expressed in an interview for the British Computer Society Bulletin that can be found here.

 

Published Friday, April 16, 2004 3:44 PM by Keith Short

Comments

# Why Whitehorse doesn't use UML

Saturday, April 17, 2004 5:32 PM by Christian Nagel's OneNotes

# Why Whitehorse designers are not using UML

Saturday, April 17, 2004 11:22 PM by Paul Andrew

# Finally we got a clue...

Sunday, April 18, 2004 5:23 PM by .Sibman

# re: UML and DSLs Again

Service Designer looks very interesting. How will it relate to business processes? Will service invocations be referencable from business process models? How will this relate to the BPEL stuff in Biztalk?
Monday, April 19, 2004 3:28 AM by Richard Gilyead

# re: UML and DSLs Again / COBOL

I like many of the ideas present by David Gelperin at LiveSpecs Software
http://www.livespecs.com/modules.php?op=modload&name=News&file=index&catid=14&topic=&allstories=1
in his article "Precise Use Cases", but the one that stuck out for me was that he was greatly influenced by Demarco's "Structured English". I am thinking that pseudo-COBOL code would make great annotations to Use Cases.

Monday, April 19, 2004 6:38 AM by Greg Collver

# re: UML and DSLs Again

To Greg: I loved the "Precise Use Cases" paper. To my mind this is a good example of a precise DSL.
Monday, April 19, 2004 10:44 AM by Keith Short

# re: UML and DSLs Again

To Richard: Our plan right now is to host a service (i.e. a special box on the Service Designer) that represents a BizTalk 2004 orchestration. This will allow you to design a collaboration of services as an implementation of a business process, some of which orchestrate others, as defined by underlying schedules.
Monday, April 19, 2004 10:46 AM by Keith Short

# re: UML and DSLs Again

That sounds good as a way to invoke an orchestration (a "process in a box") but what I really meant was how do we specifiy the dependencies and business rules which control the sequence and execution of a series of services which contribute to the completion of a business process i.e the service consumer view rather than the service provider view? Is this a feature of the Service Designer itself?
Tuesday, April 20, 2004 2:47 AM by Richard Gilyead

# re: UML and DSLs Again

Keith, I'm very interested in these ideas but have yet to see what an actual DSL "looks like". Can you point me somewhere to see how what the artifacts you described in earlier post on the class designer actually look like? Thanks
Thursday, April 22, 2004 6:14 AM by Dan Fox

# re: UML and DSLs Again

To Dan: We are stil working on the tool-building tools. I hope to show a screen shot in the coming weeks of the tool we use here to build the metamodel of a DSL and generate extension classes for our underlying framework.
Tuesday, April 27, 2004 2:32 PM by Keith Short

# re: UML and DSLs Again

To Richard: If I understand your question well enough, the answer is "no". The tool used to actually create the BPEL schedule is the BizTalk orchestration tool that shipped with BizTalk 2004. What appears on the Service Designer is the Web service facade to the schedule. BTW, that tool was alos built as a DSL using the WHitehorse designer framework.
Tuesday, April 27, 2004 2:36 PM by Keith Short

# re: UML and DSLs Again

Interesting perspective. I've also read Alex Bell's article a while back and found his taxonomies hilarious and can appreciate where Keith is coming from when he's noting that UML 2.0 is bloated and still imprecise in various places. His example of the Service Connectivity DSL is quite credible, and I appreciate its intent. However, the case for a custom Class Designer DSL seems much less clear cut to me. Sounds a bit like throwing the baby out with the bath water. It almost looks like

Design is messy (very much like Buddha noted that "Life is difficult" when he "awoke"). It's clear that neither top-down nor bottom-up approaches make best sense in all cases. In truth, design ends up being a meandering, some form of journey between abstraction and implementation.

Design models seek to capture and highlight the significant choices while hiding away the rest of the complexity - that's where UML may still play a good role. Implementation models seek to capture sufficiently precise details and semantics to allow for code generation - that's where DSL's operate.

Many (most) developers are 'implementationists', and are naturally drawn to implementation designs (read code). Some developers are 'abstractionists' (not quite an extinct species yet), and are naturally attracted by design models, focusing on wider patterns, in a somewhat top-down perspective.

The big question to be answered is how relevant UML is going to continue to be and how much the DSL's are going to overlap with the various UML digram types. As always, time will tell...

Not all is lost I suppose since the DSL's and their meta-models have precise semantics, making them amenable to precise future digital manipulation if value will be found in that. I'm thinking of potential DSL<>UML 2.x/3.x transformations, and I'm guessing they should be feasible.
Monday, May 03, 2004 12:27 AM by Horia

# re: UML and DSLs Again

Steve Cook (Software Architect Enterprise Frameworks & Tools Group Microsoft Corporation) on DSL and MDA.
Monday, May 10, 2004 2:02 AM by Martin Rosén-Lidholm

# re: UML and DSLs Again

http://www.bptrends.com/publicationfiles/01%2D04%20COL%20Dom%20Spec%20Modeling%20Frankel%2DCook%2Epdf

Steve Cook (Software Architect Enterprise Frameworks & Tools Group Microsoft Corporation) on DSL and MDA.
Monday, May 10, 2004 2:02 AM by Martin Rosén-Lidholm

# Links about Domain Specific Languages

Tuesday, May 25, 2004 6:02 AM by Alan Cameron Wills' WebLog

# Links about Domain Specific Languages

Thursday, May 27, 2004 7:37 AM by Alan Cameron Wills' WebLog

# re: UML and DSLs Again

Maybe the surveys show little use of UML by Microsoft Visio UML users because Visio UML is one of the least capable UML tools available. We tried using it for a while, but the fact that, unlike every other Microsoft tool available, you can't programmatically access the UML data, you can't do much with it.
Thursday, June 10, 2004 9:56 AM by DJ

# Read More

Thursday, June 17, 2004 9:20 AM by Ian Mariano

# re: On code generation from models

Friday, June 18, 2004 7:52 AM by Stuart Kent's WebLog

# re: UML and DSLs Again

Having read this thread through Grady, Simon Johnston, and the various Microsoft blogs, I'm surprised that the strongest reason for DSL's vs UML has not been mentioned in a comment.

The use of DSL's is a good way to increase the customer tie-in to the Microsoft tools and platform. (Not that there is anything wrong with that. :^))
Tuesday, June 22, 2004 4:01 PM by James

# Read More

Friday, July 09, 2004 11:23 AM by Ian Mariano

# re: UML and DSLs Again

[href=http://www.dmoz.net.cn/ wangzhidaquang]
[href=http://www.86dmoz.com/ jingpingwangzhi]
[href=http://movie.kamun.com/ mianfeidianying]
[href=http://www.kamun.com/ dianyingxiazai]
[href=http://music.kamun.com/ MP3 free download]
[href=http://www.pc530.net/ diannaoaihaozhe]
[href=http://www.5icc.com/ duangxingcaixingxiazha]
[href=http://www.dianyingxiazai.com/ dianyingxiazai]
[href=http://www.yinyuexiazai.com/ yinyuexiazai]
Sunday, August 01, 2004 11:54 PM by dianying xia zai

# Grady Booch on verticalized tools and Domain Specific Languages

Monday, August 02, 2004 8:37 PM by Vertigo

# global::

Thursday, October 21, 2004 4:22 PM by Objects, Systems and Everywhere In-Between
Anonymous comments are disabled
 
Page view tracker