Is there an inituitive UML approach to depict threads

后端 未结 8 1267
独厮守ぢ
独厮守ぢ 2020-12-23 02:09

I\'m fond of using UML diagrams to describe my software. In the majority of cases the diagrams are for my own use and I use them for more involved pieces of code, interactio

8条回答
  •  礼貌的吻别
    2020-12-23 02:47

    Activity diagrams will model the internal workings of your software with forks and joins to represent threads. To find out exactly how to model this properly, please see Conrad Bock's excellent series of articles. Here is the article that covers forks and joins, but you should follow the links back to the first article in the series to learn how to properly model using "Colored Petri Nets". It's not how you think (and it's pretty easy)!

    There is a new, in-process standard at the OMG for a language called Alf that provides a more convenient surface notation for activity diagrams and is intended for representing code. From the spec:

    A primary goal of an action language is to act as the surface notation for specifying executable behaviors within a wider model that is primarily represented using the usual graphical notations of UML. For example, this might include methods on the operations of classes or transition effect behaviors on state machines.

    For a programmer, you probably can't get more intuitive than Alf. And it will convert perfectly into UML activity diagrams.

提交回复
热议问题