.PS/.PE
and
copy "sequence.pic";
elements.)
.PS copy "sequence.pic"; # Object definition object(S,"s:Switch"); object(P,"p:Pump"); # Message exchange message(S,P,"run()"); message(S,P,"stop()"); # Object lifeline completion complete(S); complete(P); .PEThe above code, defines two objects, S and P, labeled as "s:Switch" and "p:Pump". Objects are placed in the diagram from left to right, in the order they are defined. All defined objects are initially inactive. The code then sends a messages from S to P labeled "run()", and another one labeled "stop()". Each message automatically advances the sequence diagram timeline by a single step. Finally, the code completes the lifelines of the two objects. The resultant diagram is
Contents | « Previous Next (An Improved Sequence Diagram) » |