Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

258
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda