Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

259
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!