Blog

  • 2024
  • 2023
  • 2022
  • 2021
  • 2020
  • 2019
  • 2018
  • 2017
  • 2016
  • 2015
  • 2014
  • 2013
  • 2012

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In the article On Names we showed that having an accurate name for domain objects is essential to provide scope and control. Now we want to concentrate on how to find names and use them consistently in our projects.

We will have a look at the language we use in our projects and provide rules how to use names in our code while adhering to naming conventions.

...

Quote External
source-page-locationp. 26f - reformatted to a list.
authorEric Evans
sourceDomain Driven Design
  1. Use the model as the backbone of a language.
  2. Commit the team to exercise the language relentlessly in all communication within the team and in the code.
  3. Use the same language in diagrams, writing, and especially speech.
  4. Iron out difficulties by experimenting with alternative expressions, which reflect alternative models
  5. Then refactor the code, renaming classes, methods, and modules to conform to the new model.
  6. Resolve confusion over terms in conversation, in just the way we come to agree on the meaning of ordinary words.
  7. Recognize that change in the UBIQUITOUS LANGUAGE is a change to the model.

 

 

Quote External
source-page-locationp. 27
authorEric Evans
sourceDomain Driven Design

[So it is the work of the domain experts] to object to terms or structures that are awkward or inadequate to convey domain understanding; [and it is the work of developers to] watch for ambiguity or inconsistency that will trip up design.

 

Glossary

One tool I find very useful to create the Ubiquitous Language is a glossary. This should be accessible to everyone in the team and everyone should in the team should be able to easily edit the terms or add additional information to it. So a technical tool like a Wiki, where each term is defined on its own page, is very handy. Tag or categorize each page as a term of the glossary so that the index of terms can be automatically created. Do not be hesitant to add information to the term that you are not quite sure of. Add it and mark it as experimental, describe why you are not sure of the term or its definition. This allows others to contribute.

In larger projects you may want to follow a more formal way. Daryl Kulak and Eamonn Guiney describe a way to create and elaborate on use cases in their book Use Cases - Requirements in Context. The process of specifying use cases has the following phases, which I interpret in the context of defining a term for the glossary:

  1. Facade - you found a term and add it with brief information to the glossary. There is no need to try to be precise or add any information at all beside its name and the context where it has been discovered.
  2. Filled - you add any information to the term you can think of. The goal is to find the whole scope for the term.
  3. Focused - you prune your findings and may add further terms to the glossary that where first thought to be part of the term, but described autonomous aspects. Remove any redundancies that where produced during the Filled Phase.
  4. Finished - polish the term, add references to related terms, contrast the term to other terms it may be confused with. Add alternative terms that are treated as synonyms, etc. The point it to integrate the term in the context of the Ubiquitous Language. Every term is now precise and coherent.

...

A tool to include into your Maven build process to generate a report within your Maven Site is our tagcloud plugin.

 

 

Naming Conventions

Naming conventions are part of the project's coding conventions that make the artifacts of a team resemble the work of a single man. This uniformity is a quality attribute that helps to understand written information more easily and therefore reduces the cost of maintenance of software in particular. Naming conventions are usually influenced by the programming language used. In his book Effective Java, Joshua Bloch provides some information about naming conventions using Java.

...