The Ubiquitous Language

Motivating Example

User

— I want to disable checklists

Example by Nic Wortel

jira ticket
Developer
  • Ok, I will open an improvement ticket

class ChecklistDefinitionStatusService
{
    public function setVisible($checklistDefinitionId, $visible)
    {
        $this->visible = $visible;
    }
}

$checklistDefinitionStatusService->setVisible(false);
what are they talking about

Why is this a problem?

  • Constant need to translate from the problem (domain) language to the technical language

  • people use the same term differently without realizing

  • information is lost in translation, misaligned concepts are used

  • developed software misses the point

  • users will have to compensate

Ubiquitous

u·biq·ui·tous

Adjective: present, appearing, or found everywhere. Synonyms: omnipresent

ubiquitous language

A shared language developed by the team - a team composed of both domain experts and software developers.

Characteristics

  • used everywhere:

    • in user stories (post-its, Jira)

    • during discussions, backlog refinements, etc.

    • in documentation

    • in automated tests

  • used by everyone on the team: developers and domain experts

  • evolves over time as new concepts are discovered

The Ubiquitous Language

ubiquitous language
  • When discussing the domain, and a developer uses a term, and the domain expert uses exactly the same term, they mean precisely the same thing.

Confluence of Terminologies

ubiquitous language intersection

Everybody uses it

all actors

It is used Everywhere

used everywhere

How to develop a ubiquitous language?

  • discuss and agree on terminology as a team

  • use one word for a specific concept, and only one concept per word

  • point out imprecision and contradictions

  • update the code as the language evolves

  • avoid the use of acronyms and abbreviations

Antipatterns

antipatterns to avoid

Pattern

pattern to embrace

Create a glossary

glossary

a list of terms in a particular domain of knowledge with the definitions for those terms

Use Feature descriptions

Feature: Disabling a checklist
  In order to quickly find the right checklist
  As an inspector
  I want to disable checklists that are no longer used

  Scenario: Disabling an active checklist
    Given an active checklist
    When I disable the checklist
    Then the checklist should no longer be visible

  Scenario: Disabling a checklist that is already disabled
    Given a disabled checklist
    When I disable the checklist
    Then I should get an error

Use Feature descriptions

  • Behat, an open source Behavior Driven Development framework

behat
Figure 1. Behat Output

Use Feature descriptions

behat fail
Figure 2. Behat Failure

Improved Process

jira ticket improved
Figure 3. New Jira Ticket
class Checklist
{
    public function disable()
    {
        $this->enabled = false;
    }
}

$checklist->disable();

Bounded Contexts

three bounded contexts

Bounded Contexts: Linguistic Boundary

bounded context
  • Give meaning to your software model

  • Put your all relational models in same linguistic boundary

  • Define a ubiquitous language