Search code examples
interfaceumlcommunicationdiagram

Represent/illustrate communication between two separate programs in UML?


Let's say I have an Android app that communicates with a desktop program via Bluetooth sockets.

Pseudo code on Android:

class sendToDesktop{
    sendMsg(String msg){
        socket.send(uuid, msg)
    }
}

On desktop:

class Read{
    getMsg(){
        return socket.read(uuid, msg)
    }
}

So how do I represent the relationship between these separate programs in UML? Can I use Component diagrams, or are they only meant to illustrate separate components of a single program?


Solution

  • As @Gangnus points out there are quite many options and none is the one and only.

    For example this websequencediagrams.com script depicts your scenario:

    enter image description here

    The required level of detail (intermediate classes, method names, argument lists...) depends on who will read it and why.

    For example this websequencediagrams.com script shows also additional internal worker classes:

    enter image description here

    See also: