-3

A sensor identified by the serial number “ABC1234” fulfills a measurement function identified by the name “Pressure sensor 7” in a production facility.

Within the production facility, nobody cares what the actual sensor fulfilling the function is. Actual sensors breaks on a regular basis and must be replaced.

When people refer to “Pressure sensor 7”, they mean the function, not the actual sensor device. But it is confusing because the name of the function (“Pressure sensor 7”) contains the word “sensor”. However, it is just so much easier to refer to the word “sensor”: “Register a new sensor” vs “Register a new measurement function”.

How can I make the user interface and the source code of the software controlling the facility unambiguous when it comes to express the concept of a function of a thing and not the actual thing (sensor, equipment, ...)?

I am missing vocabulary to differentiate the 2 concepts in a nice and user friendly way.

  • Finding suitable words is very specific to your particular context, so I don't think you will be able to get good answers here – you likely know far more about that context than us. And DDD primarily suggests using the words that the domain experts already use for that concept rather than inventing your own. Also, your question doesn't quite make it clear what the difference between a sensor and its function is for the purpose of your system. – amon Feb 20 at 13:44
  • 1
    "Pressure sensor 7" is a terrible name in the first place. Couldn't you name this after what it is measuring? Eg, "Inlet pressure", "expansion chamber pressure", "pump #7 outlet pressure", etc. – Useless Feb 20 at 13:45
  • 1
    @amon: sorry if I am not clear. function is to sensor what role would be to person in different context. Ex: A person identified by the name "Alice" fulfills the role identified by the name "Accounting Department Secretary" of a company. Customers don't care who the actual person is, they just want to deal with the "Accounting Department Secretary". – soliz Feb 20 at 13:56
2

How can I make the user interface and the source code of the software controlling the facility unambiguous when it comes to express the concept of a function of a thing and not the actual thing

By aligning the language with the context in which it is used.

It's normal that words like "sensor" mean different things to different people . The key idea is to align the vocabulary in the code with the vocabulary of the people who use it.

That can mean that you have multiple different concepts in your code named "sensor", depending on which people are being served. Namespaces are often used to distinguish between overlapping names from different contexts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.