UML

Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.
Highlighted

UML diagram for procedural code inside a method?

What is the right UML diagram for an alogorithm that lives inside a method? The algorithm is basically procedural. In "UML Demystified", an Activity diagram is presented as a tool for fleshing out the behavior use-cases, not really for representing procedural code within an object-oriented application. Since it's very flowchart-like it seems that it would work fine for representing an algorithm, but I'm wondering if there is a "best-practices" diagram for this.

0 Kudos
Message 1 of 4
(4,613 Views)
3 REPLIES

Re: UML diagram for procedural code inside a method?

0 Kudos
Message 2 of 4
(1,666 Views)

Re: UML diagram for procedural code inside a method?

charlie_k wrote:

What is the right UML diagram for an alogorithm that lives inside a method?

The "right" diagram is the one that most clearly communicates the points you think are important for other developers to know. I use sequence diagrams a lot for figuring out or documenting complex messaging sequences between objects. In your case, the algorithm is procedural and (if I'm understanding correctly) completely contained on the method's block diagram. Personally I wouldn't bother with a uml diagram in that situation--I'd just make notes explaining it on the block diagram itself.

It's easy to get caught up in all the technicalities of uml, but ultimately uml diagrams aren't the goal. They're just a tool to help you achieve your real goal--working software. My philosophy is to use uml when I need it... and even then I call my diagrams "uml-ish" because I'm sure they aren't strictly correct. But they're good enough to help me work through the problem.

0 Kudos
Message 3 of 4
(1,666 Views)

Re: UML diagram for procedural code inside a method?

I often use the State Diagram when describing induvidual VIs since all my larger VIs are state machines.

//Mike

0 Kudos
Message 4 of 4
(1,666 Views)
Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.