Search code examples
umlmodelingsequence-diagram

Representing the lifeline objects in the UML Sequence Diagram


I am building a system with no classes and objects, only a database. And I was wondering if it is correct to implement the sequence diagram with System and Database as the only objects in the diagram as shown in the picture.

Extract of My Sequence Diagram enter image description here


Solution

  • You can use a sequence diagram to model exchanges not only between instances of classes, but also between instances of components or subsystems. This can be extended to systems if you’re modelling a system of systems. So your approach is perfectly acceptable (and it can really help).

    By the way, the fact that a DBMS is not an object in the sense of OOP, does not prevent you from modeling it as an object, since it is encapsulated, has an internal state, and offers behavior via a well-defined interface.

    The only ambiguous thing in your diagram is the actor, since lifelines should be internal to the system whereas actors are external. But it’s a common practice, even if messages exchanged are not as formally defined as one would expect in a traditional sequence diagram.