Sunday, September 22, 2013

... about what ubiquitous language we should speak

DDD talks about the use of a ubiquitous language; a common language spoken by the domain experts, functional analysts and developers. As a consequence, the code that is developed should also be written in the same language, using the nouns and verbs existing in the ubiquitous language.

The code is the language. The language is the code. Hallelujah!


I live in Belgium.


Belgium is small. When you choose the right time of the day, you can drive all the way through Belgium in 2 or 3 hours, even without breaking any speed limits. 

The upper part speaks Dutch, the lower French. My native tongue is Dutch. My English skills are OK, but could be better. In France, I could order a meal and buy a croissant, but I wouldn't say my French is good.

The domain experts we work with speak Dutch, French or English. The clients we work for, are local companies or international ones.

All our code is written in English. It's the universal (!= ubiquitous) language. However when talking to our domain experts we speak the language they speak. That is Dutch, French or English. So every time we talk to the business, we take the verbs and nouns that is used in our code and translate it into the language they speak. 

That's not very ubiquitous, is it?

So, lets start an evolution. When we're dealing with a local company that uses Dutch as the language, we use dutch verbs and nouns and they end up in our code. 

We would have an entity like Vliegmachien that is persisted in a VliegmachienRepository.

The Vliegmachien entity would contain method names like stijgOp or maakNoodlanding and all would be fine.

Note that there's no reason to use Dutch terms for technical stuff like Service or Repository . That wouldn't serve any purpose. They can remain in English

When we're dealing with an international company, we would use English as the ubiquitous language and we would create an entity called Airplane containing methods like liftOff or makeEmergencyLanding.

Case closed! Everybody happy.

OK, here comes the trouble: 

Sometimes we have a Dutch speaking domain expert that leaves the company and is replaced by a French speaking domain expert.

Or this one:
the project is now in maintenance mode and it's not handled by the original Dutch speaking team anymore. Maintenance is now done by someone living in Ukraine.

For these reasons I see no other possibility than to use English as the ubiquitous language. Unless you can foresee that your customer and your team will always be speaking the same language.

Talking to domain experts in a language that is not yours and is not theirs is not that hard, but you tend to miss a lot of the small details and subtleties hidden in the language. You could"google-translate" to-from Dutch-English, but most of the time you end up with verbs like "assignSomthing", "updateSomething" or the dreaded "setSomething". It's poor, plain English, spoken by all those foreigners that aren't living in the US or aren't part of the British Commonwealth. However, most of the time it's the best we can do.

To make a short story long: English speaking developers have a head start on others when capturing the ubiquitous language.

Greetings...
Jan