UML Semantics

Grady has blogged about Microsoft’s position on UML. His article is a masterpiece of technopolitical spin. He says Microsoft “rejects UML”, and of course we don’t; as my colleague Alan Cameron Wills says, “we don’t want to limit ourselves to UML as a basis for our users’ domain specific languages”. We support UML in our Visio product, and we use it extensively for documentation.

Grady also attributes several mistakes to Alan, who actually got his facts right. But getting facts right is never the important issue in technopolitics; and UML is primarily a political artifact, not a technical one. In this vein, I’m going to write about UML semantics.

What is “semantics”? Grady talks about it a lot. For example: “In many cases, the semantics of the UML are pretty close to what you need, although they are deeper than necessary; in such cases, a suitable UML profile is sufficient to focus the language, which allows you to leverage standard UML tools and training and yet eliminate the bloat.” There are some interesting words in there: “close”, “deep”, “focus”.

George Lakoff’s interesting book “Woman, Fire and Dangerous Things” distinguishes between “objectivist” semantics and “cognitive” semantics. Objectivist semantics involves defining precise mappings from symbols to abstract entities and sets, and thus giving meanings to symbols by virtue of the logical properties of the corresponding abstract entities and sets. Lakoff goes to some lengths to dismiss objectivist semantics as an appropriate theory about the mind and language. To give semantics to real experiences in real languages, he says, requires a different kind of cognitive semantics based ultimately in categories of bodily experience.

Providing semantics for computer programming languages has historically been a completely objectivist matter. Programming languages can be given semantics in various ways, operational, axiomatic and denotational methods being customary. What these methods have in common is that they ascribe exactly the same meaning to a particular set of symbols under all possible circumstances; where exactly the same can be objectively assessed according to basic laws of equality in set theory. Users of such languages really do expect different implementations of them to behave the same.

Now UML is different. Its semantics is given by prose headed Semantics, containing sentences such as “The representing collaboration may be used to provide a description of the behavior of the classifier at a different level of abstraction than is offered by the internal structure of the classifier.”   It’s immediately obvious that an objectivist method is not being applied here, and that we have to appeal to a more cognitive understanding of the language used. The problem, of course, is that we can no longer make any objective assessment of what symbols mean. Users may not expect different implementations to behave the same; it simply is not set up like that. The best we can expect is for implementations to be similar.

The bottom line is that discussions of UML semantics become political, rather than objective. In consequence, discussions of UML compliance become political, rather than objective. Tool interoperability becomes a political, rather than an objective matter: two UML tools will interoperate if their vendors decide to make this work, rather than by virtue of any objective tests.

None of this would be a problem if UML were widely recognized for what it really is: an informally defined, popular set of conventions, which can be put to use in whatever ways are appropriate. The problem is that many of its proponents insist on pretending that it is in some way objectively defined; for example the OMG describes it as normative. Now interestingly, Grady does not seem to go this way – for example he says:  “... there really is no "illegal" UML graphical syntax.” I was surprised to read that – but it’s good. I hope it stays that way.