UML
基
础
:
序
列
图
iteye_34
172
收
藏
分
类
专
栏
:
UML
⽂
章
标
签
:
测
试
java c/c++
2013-12-23 15:32:40
版
权
It's February, and by now you've probably read about, or heard people talk about, making the change to
UML 2.0--the new specification for UML that contains a number of improvements. Given the importance
of the new spec, we are changing the basis of this article series, too, shifting our attention from OMG's
UML 1.4 Specification to OMG's Adopted 2.0 Draft Specification of UML (a.k.a. UML 2). I hate to change
emphasis from 1.4 to 2.0 in the middle of a series of articles, but the UML 2.0 Draft Specification is an
important step forward, and I feel the need to spread the word.
There were a couple of reasons that the OMG improved UML. The main reason was that they wanted
UML models to be capable of delivering Model Driven Architecture (MDA), which meant that the UML
had to function as a more model driven notation. Also, the UML 1.x notation set was at times difficult to
apply to larger applications. Furthermore, the notation elements needed to be improved in order to make
diagrams more readable. (For example, modeling logical flow in UML 1.x was complicated and at times
impossible. Changes to the sequence diagram's notation set in UML 2 have made vast improvements in
modeling logic in sequences.)
Notice the wording in my statement above: "Adopted 2.0 Draft Specification of UML." It is true that the
specification is still in draft status, but the key is that the Draft Specification has been adopted by OMG, a
consortium that does not adopt new standards until they become pretty solid. There will be some
changes to the specification before UML 2 is completely adopted, but these changes should be minimal.
The main changes will be in the internals of UML--involving features typically used by software
companies who implement UML tools.
The main purpose of this article is to continue our focus on the essential UML diagrams; this month, we
take a close look at the sequence diagram. Please note, again, that the examples provided below are
based on the new UML 2 specification.
The diagram's purpose
The sequence diagram is used primarily to show the interactions between objects in the sequential order
that those interactions occur. Much like the class diagram, developers typically think sequence diagrams
were meant exclusively for them. However, an organization's business staff can find sequence diagrams
useful to communicate how the business currently works by showing how various business objects
interact. Besides documenting an organization's current affairs, a business-level sequence diagram can
be used as a requirements document to communicate requirements for a future system implementation.
During the requirements phase of a project, analysts can take use cases to the next level by providing a
more formal level of refinement. When that occurs, use cases are often refined into one or more
sequence diagrams.
An organization's technical staff can find sequence diagrams useful in documenting how a future system
should behave. During the design phase, architects and developers can use the diagram to force out the