Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

272
Visualizações
UML sequence diagram: Is it possible to demonstrate an object being passed as an argument to another object's function?

Accepting that (1) I want to use a sequence diagram and not a class, communication or any other diagram and (2) I am not using official UML specification and am prepared to bend the rules, the question is: Is it possible to demonstrate an object being passed as an argument to a function call on another object? For example, in the snippet below, object1's function "add" takes the argument "object2" (adding their respective properties), but the diagram conceals the fact. Would the aforementioned be acceptable? If so, what is the best way to do it?

Thanks in advance.
enter image description here

var object1 = new O("object1");
var object2 = new O("object2");
object1.add(object2);
alert(object1.name);  // object1 + object2

function O(param) {
    this.name = param;
    this.add = function(param) {
        this.name = this.name + " + " + param.name;
    };
}

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In your example, the only communication between object1 and object2 is that object1 gets the name of object2. You could visualize this by drawing an arrow from object1's lifeline to object2's lifeline, labeled 'get name'.

In practice, the getters are usually not visualized, because too much detail may obfuscate the main flow. The fact that you show that object2 is passed as an argument of a message to object1, already implies that object1 will do something with object2.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda