In the case of the method in the C# code below, I would like to know how to return the value with return and return it from the method.
In this case, is it okay to write a sequence diagram like an image?
public class Sample
{
public bool IsZeroSecond()
{
if (DateTime.Now.Second==0)
{
return true;
}
return false;
}
}
In the sequence diagram, I think it is normal to write the object of the caller as well.
Return returns a value to the caller, so you don't need a black circle with a left-facing dotted line.
You may want to express the opt part, but with this sample, I don't feel uncomfortable without it.If you omit it, you can use the expression "return:bool" by subtracting only one return arrow between true and false.
© 2024 OneMinuteCode. All rights reserved.