Located on beautiful Orcas Island in Washington State's San Juan Islands, Rosario Resort & Spa has long been a favorite destination for travelers seeking relaxation and unparalleled beauty in the Pacific Northwest.
Anyway, lets look at some other kind of "relaxation and unparalleled beauty", create Sequence Diagram from Existing Code.
The scenario this feature supports is the same as the physical class diagram and the Architectural Explorer, help people understand and evaluating a implementation / architecture of existing code by visualizing it.
The dependency matrix visualizes dependencies between artifacts, the physical class diagram visualizes the static relations between objects and a sequence diagram visualizes its dynamic behavior.
How does it work?
The Architecture Explorer has set of commands, with one of it "Insert into Active Diagram". This command creates a sequence diagram from the method you have selected [see image]. Nice thing to know, this set of commands is extensible..! more on that in the future.
After adding an empty sequence diagram and selecting the command, it creates indeed the sequence diagram [image below]. I used the "drag and drop" front-end implementation, the same one I used for the dependency matrix post and the code metrics post.
This diagram doesn't show return types and parameters. For example the Lookup method look like this in code:
employee = employees.Lookup(txtFirstName.Text, txtLastName.Text);
Not that exciting, but it would help in understanding the code. Something like this...
[Always wanted to do this, use my tablet to sketch UML diagrams. Probably the last time... took me half an hour to draw this]
Another process to get there...
The physical class diagram [one to one representation of the code, see image below] has a new menuitem "Add to Logical Class Diagram...".
When putting all the necessary classes on the Logical Class Diagram. You can create a LifeLine for it... see menuitem "Create Lifeline..."
From there we can draw the interaction between those classes... and now we've got access to the operations in the classes [see dialog].
You can see that there are connected to the logical class diagram by the little "shortcut" icon on the classes.
What actually would be an interesting scenario... generate sequence diagram, generate physical class diagram, add these classes to the logical class diagram... and let these two logical diagrams work together.
More to come...
Anyway, this "drag and drop" implementation isn't that suitable to demonstrate the capabilities of the "generate sequence diagram" feature... So, next post the more sophisticated implementations... for now, looks good and time to get prepared for Vicky's birthday and Queensday ...