The Dorm class returns the dorm name and room number. This message would include dorm selection information, such as a health dorm or other student requirements. The next activity is to send a selectDorm message to the Dorm class. To simplify the diagram, the parameters that are sent to the Student class have been omitted, but would include the student name, address, and so on. The initialize() message is sent to the Student class, which creates a new student record and returns the student number. On the left is the newStudentUserInterface class that is used to obtain student information. This may be the actor that initiates the activity or it may be a class representing the user interface.įigure illustration below is a simplified example of a sequence diagram for a use case that admits a student to a university. The starting actor, class, or object is shown on the left. The interaction arrows begin at the bar of the actor or object that initiates the interaction, and they end pointing at the bar of the actor or object that receives the interaction request. Timing in the sequence diagram is displayed from top to bottom the first interaction is drawn at the top of the diagram, and the interaction that occurs last is drawn at the bottom of the diagram. The message may be a stereotype, such as «Create», indicating that a new object is created as a result of the message.Parameter types indicate the type of data, such as string, number, or date. MessageName(parameterType:parameterName(defaultValue). The message name followed by the parameter type, parameter name, and any default value for the parameter in parentheses:.The name of the message followed by parameters in parentheses:.The name of the message followed by empty parentheses: messageName().Messages are labeled using one of the following formats: A return is shown as an arrow, sometimes with a dashed line. An example would be using a menu to run a program. Half (or open) arrowheads represent asynchronous calls, or those that are sent without an expectation of returning to the sending class. These are used when the sending class waits for a response from the receiving class, and control is returned to the sending class when the class receiving the message finishes executing. Solid arrowheads represent synchronous calls, which are the most common. There are some variations in the message arrows. Horizontal arrows show messages or signals that are sent between the classes. A lateral bar or vertical rectangle on the lifeline shows the focus of control when the object is busy doing things. An X on the bottom of the lifeline represents when the object is destroyed. Specialized symbols used to draw a sequence diagram.Ī vertical line represents the lifeline for the class or object, which corresponds to the time from when it is created through when it is destroyed. objectName:Ī name with a colon after it represents an object.Ī colon with a name after it represents a class.Ī name, followed by a colon and another name, represents an object in a class. The top rectangles use indicators in the name to indicate whether the rectangle represents an object, a class, or a class and object. Some of the interactions are physical only, such as signing a contract. The leftmost object is the starting object and may be a person (for which a use case actor symbol is used), window, dialog box, or other user interface. Actors and classes or object instances are shown in boxes along the top of the diagram. The symbols used in sequence diagrams are shown in the figure below. Each use case scenario may create one sequence diagram, although sequence diagrams are not always created for minor scenarios. Sequence diagrams are used to show the overall pattern of the activities or interactions in a use case. In practice, sequence diagrams are derived from use case analysis and are used in systems design to derive the interactions, relationships, and methods of the objects in the system. Sequence diagrams are often used to illustrate the processing described in use case scenarios. Sequence diagrams can illustrate a succession of interactions between classes or object instances over time. These diagrams, along with class diagrams, are used in a use case realization, which is a way to achieve or accomplish a use case. An interaction diagram is either a sequence diagram or a communication diagram, both of which show essentially the same information.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |