UML and DSLs

So is UML really contradictory to DSLs?  Do they really represent different philosophies? I don’t think so.  After all, UML is just a set of domain specific languages.  If you want to model use cases, or state transition diagrams, what other DSLs would you use?

Software architecture is all about tradeoffs, and there’s obviously one here. On the one hand UML is relatively standard, so that costs of implementation, documentation, training, deployment etc can be amortized across multiple installations.  On the other hand, it may not match your target problem very well.  There are plenty of domains that UML does not encompass.  That is why the OMG has branched out into business modelling.  Database design is another; user interface a third; and we could list many more, including vertical domains – the design of software radio, mobile phone, or insurance systems – and very platform-oriented domains, such as the direct visual depiction of code.

The UML-oriented approach to DSLs is “profiles” – adding extra data to UML models so that they appear to target more specialized domains than the original UML definitions do.  A frequent question about the DSL approach is the danger of proliferation of different approaches to the same problem, and I think that’s a valid concern.  On the other hand, the UML+profile approach can end up with cumbersome solutions to essentially simple problems, and can lead to ghastly chimeras, like class diagrams with classes labelled “Web page” or “marketing department”.

To resolve these issues long-term I think we need a new architecture for modelling languages in which the false distinction between UML and DSLs would evaporate.  Widely used languages would be standardized; new languages could emerge and evolve; different languages could be loosely-coupled yet interoperate. To achieve such architecture we first need to understand some basics about language anatomy, such as making an accurate distinction between syntax and semantics.  I’ll talk more about this in future postings.

Comments (10)

  1. Kenn Hussey says:

    Indeed. As Andrew Watson wrote back in 2007 (see, choosing between UML and DSLs predicates a false dichotomy…

  2. Rick says:

    Steve, in addition to syntax and semantics, a good starting point for defining this architecture includes the following four concepts: languages, logics, models and theories. Note the multiplicity for each concept. This multiplicity provides the appropriate level of paramaterization which is essential to the goal you have defined. These key concepts properly set the stage for later refining your proposed architecture. In terms of semantics, unfortunately, the current state of formal semantics is underspecified to achieve your goal. A colleague of mine calls this goal, "living, liasing languages." In order to achieve this goal, two new elements would have to be introduced: semiotics and pragmatics.

    Is there a collaborative approach that Microsoft would consider in stewarding this type of architecture ? Today, with the wide variety of social media capabilities available, standards bodies as only one way of achieving consensus.    

  3. Unit testing Udi Dahan wrote a post about unit testing – Unit Testing for Developers and Managers Architecture

  4. Scott Finnie says:

    Steve, it’s interesting you mention philosophy – because I think that’s the one place UML and DSLs /are/ different, at least historically.  As you know, UML originally was conceived for sketching before the ‘real’ work was done (afaik, Grady still maintains this viewpoint).  There was a body that viewed it differently (e.g. Steve Mellor/Sally Shlaer and I think you too): that it should be a precise language amenable to execution and translation.  But the ‘executioners’ were in the minority, and – despite the formalisation efforts – UML is still inextricably hamstrung by its informal ancestry.

    DSLs, on the other hand, have always been seen as something formal, something directly machine interpretable.  So philosophically they are different.

    That’s not to say of course the situation can’t be remedied.  FWIW I agree with your view that a new architecture is needed.  Something that allows for the informal use cases – which still have tremendous value – but doesn’t limit or encumber the creation and use of machine interpretable languages.  It also needs to allow for separation of concept, meaning and representation – again something UML doesn’t cover today.

    Quite how that will come about I’m not sure – unfortunately however I don’t see it coming from the OMG.  UML2 is testament to the ills of design by committee, and I don’t see any signs of the OMG changing those particular spots.  Of course, I’d be happy to be proved wrong…

  5. Jim Steel says:

    I couldn’t agree more about the dangers of trying to squeeze a square-block language into round-hole UML modelling languages using profiles. Do you think that profiles are a useful mechanism, and what would you say are the circumstances when profiling is a better option than metamodelling?

  6. Jim – profiles are ok, I think, when you want to constrain/extend a retargetable syntax to map onto another language, so we can have UML diagrams that directly represent Java, C#, VB or Smalltalk programs.  Just like we do on whiteboards.

  7. Rick says:

    Steve, retargetable syntax implies a best case scenario of structure preserving transformations between languages. More formally, an isomorphism that preserves structure in the target meta language and object language has been part of Query View Transform (QVT) for a while. However, structure preserving transformations across languages can result in unfavorbale outcomes. Example, the structure class, association, class in UML transforms to an identical class, property, class structure in OWL with the unfavorable side effect that the structure would be classified as undecideable. This implies the underlying requirement for this new architecture is semantic preserving transformations also known as semiotic morphisms. As I mentioned in a previous comment, today’s current semantics which are based on Alfred Tarski’s Semantic Conception of Truth, underspecify the model theory required to support semiotic morphisms. Although I endorse the whiteboard analogy, I see one of Microsoft’s most valuable contributions to the OMG process as bringing a more formal level of specification early in the debate. For example, specifying a requirement to validate a proposed language against a standard set of reasoning services such as classification, realization, consistency and satisfiablility as is the case with description logic, would begin to elevate the level of debate in within the OMG.    

  8. Yes, I can remember reading Burstall and Goguen and learning about abstract algebra. But actually I think we can solve some important UML problems without everybody having to understand category theory.  "Keep it simple" and "the devil is in the detail" are my mottos for this.

  9. Doug has published a response to an Open Letter addressed to him from Lars Corneliussen . I think Doug