Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your code is represented in the following class diagram:</p> <p><img src="https://i.stack.imgur.com/32Lxl.png" alt="enter image description here"></p> <p>It represents the relationships between the classes:</p> <ul> <li><code>Implementation</code> implements <code>ICallback</code></li> <li><code>Implementation</code> depends on <code>AnotherImplementation</code> (it creates one in its constructor)</li> <li><code>AnotherImplementation</code> has a <code>ICallback</code> (named mCallback)</li> </ul> <p>A class diagram does not represent method functionality. Method functionality is visualized with a sequence or a Collaboration diagram.</p> <p>In your example, the sequence diagram for <code>testFucntion()</code> is very simple:</p> <p><img src="https://i.stack.imgur.com/ljvgw.png" alt="sequence diagram"></p> <p>Note that the <code>Implementation</code> class does not show in the sequence diagram. This happens because the <code>mCallback</code> member is declared as <code>ICallback</code>. It could be anything that implements the <code>ICallback</code> interface.</p> <p>I think that the more interesting question is how to visualize the method that triggers the callback. You don't mention which method of <code>Implementation</code> calls the <code>testFunction()</code> of <code>AnotherImplementation</code>, so I guess that this happens inside the constructor of <code>Implementation</code>. I created the following sequence diagram for this constructor:</p> <p><img src="https://i.stack.imgur.com/VcQUk.png" alt="callback sequence"></p> <p>Here you can see:</p> <ol> <li><code>Implementation</code> creates the <code>AnotherImplementation</code></li> <li><code>Implementation</code> invokes <code>testFunction</code> on <code>AnotherImplementation</code></li> <li><code>AnotherImplementation</code> invokes <code>informFunction</code> on <code>Implementation</code></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload