Question

I am following the textbook Object oriented software specification using UML, patterns and Java (3rd edition) and I am defining interfaces between system components (subsystems). But I encountered a practical problem in the notation.

Imagine for example a component Transaction Management component that deals with transactions and consumes an interface exported by a Database Storage component.

How should I name that interface ? Should I use a generic name like Storage and Database Service, or prefer a more specific to the consuming component like Transaction storage Management Service ?

Was it helpful?

Solution

In an UML component diagram, the interface represented by a connector should have a name that describes the service (behaviour) that the consumer needs, independently of the specific component that will provide it.

It is however not straightforward to answer your question, without knowing more about your intentions:

  1. If the providing components will all be database components (e.g. a MongoDB provider, an Oracle provider, a DB2 provider, etc..), the interface could very well be database storage interface.

  2. If the providing components could be something more general and be fulfilled by a database component, or a file storage component, or even a distributed network cache storage, then your interface name should be more genetric (eg. Storage interface)

  3. It is not forbidden to use a more specific name. In fact it is a common practice to draw a generic component in a diagramme and name the interface according to that providing/implementing component. This kind of convention is often used when the providing component in the diagram is supposed to be a placeholder and there is no intention to nale the different concrete variations of that component. But keep in mind that if the interface name is so specific that the providing components are no longer interchangeable, there would be something wrong.

But whatever the name you chose, it should be related to what is provided; not to what is consumed.

Licensed under: CC-BY-SA with attribution
scroll top