Monday, May 4, 2015

Dangerous Domain Vocabularies

A very smart young colleague at work has been introducing us to concepts of CQRS, Event Sourcing, and Domain Driven Design (DDD). One of the more prominent values held by DDD is the pervasive vocabulary used by Domain Experts - ubiquitous language is considered to trump any other technical constructions.

As well it should, at least in established disciplines and where the business actually has resident expertise available. Even where inexperience is greater than the expertise, one still wants the professionals who are tasked with the responsibilities for the business outcomes to have a sense of ownership of the language.

But there are fallacies of belief that can be assumed as well:

  • Belief that a comprehensive domain language exists when it is not even a well formed vocabulary.
  • Belief that the semantics behind nascent language idioms are grounded, when they are cliches or abstractions derived from historical accidents (that is, legacy systems and environmental conditions that no longer exist). 
  • Belief that concepts of a domain model are part of some sort of mathematical reality that objectively exists above our own, unchanging and merely in need of discovery.
  • Belief that the ephemeral quality of language is not a significant factor when individuals move in and out of the domain.
  • Belief that the terrain of the problem space is substantially stable over the expected useful lifetime of the model.
  • Belief that domain experts' language never involves idiosyncratic forms that are self-inconsistent within a single bounded context.
It is the last bullet item that got me to thinking on this topic. A laboratory technician was describing to me a small dispute over a protocol in her lab one day. Two technicians were following two different procedures for diluting liquid samples. The terminology they had adopted was, for instance, to say that they were preparing a "one to three dilution".

It is more commonly expressed as a "dilution ratio of 1:3", and therein lies the problem. One tech said that means mixing one part of a solute to three parts of a solvent, and the other claimed (apparently consistent with the procedures used in the profession) that it means mixing one part solute to two parts solving and giving three parts of an admixture. The vocabulary, having been neglected and forgotten by many of the practitioners, is no longer clear.

Mathematically, the ratio "1:3" is like a fraction 1/3 and most people would think of "one part of something to three parts of something else" at the same moment in time. The lab professionals, meanwhile, have adopted an idiosyncratic interpretation, assigning "1" to the "something" and "3" to "one something plus two something elses" - that is, they compare a variable in a one step to a dependant value resulting from a subsequent step. 

Consider this:
Step 1: take 1 part salt
Step 2: take 2 parts pepper
Step 3: mix salt and pepper

The result of Step 3 is a salt-pepper admixture of roughly three volumes, or a 1:3 dilution of salt in pepper. But mathematically the 1 and the 3 are different units, 1 being a unit of salt and 3 being a unit of (1 salt + 3 pepper). The reality of the process is, further, that the entity described by the 3 doesn't exist until the entity described by the 1 and a derived value for an entity which is not made explicit are combined. That's like telling a cook how to bake a pie with an ingredients list that omits the filling and includes the whole finished pie itself. 

And don't think this is a trivial thing. People have no doubt died over the misunderstanding and confusion brought on by this one shitty little idiosyncrasy. 

Post a Comment