In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the UML interaction diagram drawing and application example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Interaction and UML interaction diagram
The concept of interaction
An interaction is the behavior represented by a set of messages exchanged between a group of objects in a particular context in order to achieve a goal.
Message
Four kinds of UML interaction diagrams in UML
Sequence diagram: a sequence diagram is an interaction diagram that emphasizes the time sequence of messages, providing the reader with a clear visual track of the control flow over time.
Communication graph: the communication diagram in UML2.0 is actually the collaboration diagram in UML1. It emphasizes the organization of interactive objects and provides readers with a clear visual track to observe the control flow in the context of collaborative object structure organization.
Timing diagram: a timeline with digital scale is used to accurately describe the order of messages.
Interaction overview diagram: a mixture of interaction diagram and activity diagram
How to draw UML interaction Diagram
Preparatory work
First of all, choose the sequence diagram or communication diagram according to your preferences and actual performance needs. However, because they are semantically equivalent, one can be drawn and then automatically converted into another graph by modeling tools.
The interaction diagram in the analysis model focuses on the responsibility distribution and interaction flow of the analysis class, while the interaction diagram in the design model focuses on the introduction of the design class and the invocation and flow control of the actual method.
First determine the objects involved in the interaction, the relationship between the objects (communication diagram), and then determine the message interaction flow between the objects (represented by synchronous invocation, asynchronous message, return message). And use interaction fragments (sequence diagrams) or iterative markers and monitoring conditions to represent loop and branch structures
Robust analysis
Robust graph can solve the difference between requirement analysis and architecture design. For a more detailed explanation, see the explanation of *.
Robustness analysis is not part of the UML model, it is a powerful sketching tool and an effective tool between analysis and design.
In Robustness analysis, boundary classes, control classes and entity classes will be applied, corresponding to the three layers of the MVC architecture.
The method of extracting three types of objects from a use case:
Robust analysis-finding boundary objects
The librarian issued a request for "new book information" to the system-- the main window and the "new book information" button.
The system requires librarians to choose whether the books to be added are computer or non-computer-book category list boxes.
After the librarian makes the choice, the corresponding interface is displayed, the librarian is asked to enter the information, and the book number is automatically generated according to the book number rules-the "new book information input" window and the auxiliary "submit" button.
Application description of UML interaction Diagram
Interaction model in the analysis phase
Working method: for each use case in the use case diagram, combined with the classes in the domain model, find the analysis class, and sort out the business logic process through Robustness analysis, and then use the interaction model to determine it.
Note: the main focus is to distinguish between boundary objects, entity objects and control objects, without considering their specific implementation classes for the time being.
Description: for more complex use cases, we can gradually analyze, design and implement them according to the above process, but for relatively simple use cases, the design phase interaction model can also be derived directly from the use case description.
After the interaction model in the analysis phase
Introduce basic classes: including basic framework, library, etc.
Quality Review:
Low coupling: coupling refers to the strength of the connection between two classes
-- High cohesion: cohesion means that the properties and methods of a class are highly integrated
Efficiency: whether the execution efficiency of the solution meets the requirements of the system
Integrity: it means that it can be reused in any environment
Simplicity: the simpler the class, the less likely it is to make mistakes, and the better the flexibility and maintainability of the system.
Interaction Model in Design stage & key points of interaction Modeling
After introducing the basic class and optimizing the class design on the basis of the analysis model, it is inevitable to obtain a new class model (class diagram) (design model), so it may be necessary to update the interaction model based on the newly introduced "design class". To get a model that matches the actual code
Give a name that can express its purpose; by modifying the layout of elements, the existence of cross lines can be avoided as far as possible; annotations and colors can be used as visual hints to highlight important features in the graph; branches are used as few as possible. For scenes with many branches, you can consider using activity diagrams to supplement them.
Thank you for reading this article carefully. I hope the article "UML interaction Diagram drawing and sample Analysis of its Application" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.