I have a system where there are many components that talk to one another (think mediator pattern) via shared data buffers. Basically, one component writes to a data store (like a simple uint8 value) and any component interested in the value will read it. The mediator is the one that stores all these values, and there are hundreds of such data stores. Now according to the metamodel I am working with, AUTOSAR, the model should show two components linked by their ports typed with their interfaces. The shared data is represented as an attribute in an interface classifier on that port (the mediator is not even shown).
My question is how do you model such a system in a sequence diagram? Do you show the mediator as a lifeline with incoming messages like Read and Write? Where do the ports come into play? It seems that one shows ports only as action pins in activity diagrams or in composite structure diagrams, but in sequence diagrams, most literature is silent on the topic of ports. To add more confusion, in AUTOSAR, they have a naming convention where eventually the reads/writes get translated like this:
Rte_Read_<port name>_<interface attribute name>(Type data)
Rte_Write_<port name>_<interface attribute name>(Type * data)
Both operations are implemented by the Mediator. It's as if the concept of a port disappears in implmentation, so why bother even modeling it? I end up with extremely long message names in the end and a diagram that is not that interesting since mediator is the center of attention.
Yes, the Mediator should be a llifeline. You don't show ports on the sequence diagram, and they are connection points and not the elements providing or requesting services. Showing the connections and ports is best done on an IBD.