

- #Sequence diagram in enterprise architect software#
- #Sequence diagram in enterprise architect series#

With most modeling tools you can optionally display the type of the arguments (e.g., boolean, currency, string). In addition, the ValidateUser() method accepts two arguments: ID and password. This indicates that the User object has a method named ValidateUser. For example, in Figure 1, the ValidateUser() message is sent to the User object. When a message is sent to an object, the text associated with the message specifies the name of the method that is being called on the receiving object. Messages are shown on UML diagrams as labeled arrows, with the arrowhead indicating the direction of the call. Message flow begins at the top left object (which is usually an actor) and flows down the vertical axis from one object to another. They are also used to indicate return values. They indicate when one object calls an operation on another object (or itself). Messages are the most important elements of a sequence diagram. The lifeline indicates the life span of an object over a period of time. The lifeline is the dotted line that extends down the vertical axis from the base of each object. It's best to place objects on the diagram in a way that minimizes lines that cross. You should place the most important objects to the left and subordinate objects to the right.

Next, you can place objects on the diagram that are instantiated by the UI or by other objects. This is an excellent tool for providing context for a use case. You can also place a “UI” (user interface) placeholder class on the diagram with which the actor interacts. As shown in Figure 1, it's a good idea to place the actor that initiates a particular sequence at the upper left side of the diagram. Objects that are involved in the sequence of events you are documenting should be placed at the top of the sequence diagram across its horizontal axis.
#Sequence diagram in enterprise architect software#
Objectsįigure 1: A sequence diagram can be created for each use case in a software system There are four primary elements of a sequence diagram:įigure 1 demonstrates the use of each of these elements in a simple sequence diagram.

In this article, we'll go step-by-step through the process of building a sequence diagram for a particular use case, but first, you need to learn about the different elements of sequence diagrams. So, what kinds of things should you document in a sequence diagram? Usually, a sequence diagram is used to document the logic of a use case (for a discussion of use cases, see Component Developer Magazine, Issue 2 - 2001). You may also discover that objects you originally thought should be involved in a particular process shouldn't be involved at all! Modeling Use Cases In addition, sequence diagrams help you easily identify unnecessary messages between objects and factor them out. At a higher level, it also helps you comprehend the overall flow of a particular process. In contrast, when you document your thought process in a sequence diagram, suddenly the answers to these questions become crystal clear. These questions are very difficult to answer correctly when you simply try to envision object messaging in your head. However, once you decide to elevate your programming by using business objects in your applications, sequence diagrams help you answer two very important questions: This is because if you're not using business objects, most of your application logic resides inside methods of user interface objects or in functions and procedures?and there really isn't much messaging that occurs between objects. Why use Sequence Diagrams?Īs mentioned in the previous article on class diagrams, unless you are using business objects in your applications, you won't have much need for sequence diagrams. While the collaboration diagram's main focus is to show how objects are associated with each other, sequence diagrams show the time ordering of messages between objects. Sequence diagrams are closely related to collaboration diagrams (discussed in the next article in this series). They are most often used in the construction phase of software projects and are especially useful when analyzing the process-intensive portions of your application.
#Sequence diagram in enterprise architect series#
This third article in the series covers one of the most interesting diagrams in the UML - the sequence diagram. You often create a sequence diagram to model the logic of a use case. Sequence diagrams can help you comprehend and solve difficult issues in the process-intensive portions of your applications. It helps you document and understand the dynamic aspects of your software system - specifically the sequence of messages that are sent and received between objects. The Sequence Diagram is one of the most interesting and useful diagrams in the Unified Modeling Language (UML).
