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.
Of course a lifeline in a sequence diagram can represent an (instance of an) interface. From the perspective of the diagram, it doesn’t matter much—there are no restrictions on where the operations/messages on the events should come from.
If you want to indicate that the operations have to come e.g. from the signature of the target (
IGameRepository), you have to document/encode this separately, e.g. in OCL.