Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are interfaces allowed in UML sequence diagrams

Tags:

uml

Is it valid to have an Interface as part of a sequence diagram. For instance, is the following UML valid? The purpose of the interfaces is to show extensibility and testability points in the design. You could extend by providing a different implementation for each interface and better test by replacing the interfaces with mocks. However, I don't know if this violates the rules of UML. Thanks in advance.

GameService:IGameService     GameRepository:IGameRepository
           |                            |
           |                            | 
           |--------------------------->|
           |                            |
           |                            |
           |                            |

P.S.: Sorry for the poor's man diagram.

like image 808
dalcantara Avatar asked Nov 23 '25 12:11

dalcantara


1 Answers

Yes, this is possible. Both classes and interfaces are subclasses of Classifier in the UML metamodel. Classifiers are the ones linked to the elements in the sequence diagram

like image 161
Jordi Cabot Avatar answered Nov 26 '25 05:11

Jordi Cabot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!