当前位置:网站首页>UML series articles (28) architecture modeling - collaboration
UML series articles (28) architecture modeling - collaboration
2022-06-11 03:27:00 【CoderIsArt】
- Collaboration 、 Implementation and interaction
- Modeling the implementation of use cases
- Modeling the implementation of operations
- Modeling mechanisms
- The concretization of interaction
In the context of system architecture , Collaboration allows you to name a concept block that includes both static and dynamic aspects . Collaboration is a class 、 Names of groups of interfaces and other elements , They work together , Provides a stronger cooperative behavior than the sum of the various parts .
Collaboration can be used to specify the implementation of usage and operation , And model the important system mechanism of the architecture .
1. introduction
A software intensive system with good quality not only has reasonable functions , It should also reflect the harmony and balance of the design , To make it easy to modify . This harmony and balance often comes from the fact that : All well - structured object - oriented systems are full of patterns . Take a look at good object-oriented systems , You will find that some elements work together in a common way , Provides a stronger cooperative behavior than the sum of all its components . In a well structured system , Many elements will participate in different mechanisms in different combinations .
stay UML in , Modeling mechanisms with collaboration . Collaboration assigns a name to the interactive building blocks in the system , It contains both structural and behavioral elements . for example , There may be a distributed management information system , Its database is distributed on several nodes . From the perspective of users , Updating information looks like an atomic action ; But from the inside of the system , It's not that simple , Because this action needs to access several machines . To give a simple description , Need to design a transaction mechanism , This enables customers to use it for this or even across multiple databases , But it seems simple 、 Atomic transaction naming . Such a mechanism may span multiple classes , They work together , To complete a transaction . Many of these classes can also be included in other mechanisms , For example, mechanisms that make information permanent . A collection of these classes ( The structural part ) The interaction with them ( The behavior part ) Together they form a mechanism , stay UML Collaboration can be used to express .
Collaboration can not only name the mechanism of the system , It can also be used as the implementation of usage and operation .
UML Provides a graphical representation for collaboration , Imaginary frame ellipse . This representation allows you to visualize the structural and behavioral building blocks of the system , Especially when these building blocks cover classes 、 Interfaces and other elements in the system .

2. Terms and concepts
Collaboration (collaboration) It's a set of classes 、 A community of interfaces and other elements , They work together to provide more cooperative behavior than the sum of the components . Collaboration is also about a category like ( Including class 、 Interface 、 artifacts 、 Node or usage ) A specification of how elements such as or operations are implemented by a set of classes and associations that play a particular role in a particular way . Usually , The graphical representation of collaboration is to draw it as a dashed ellipse .
2.1 name
Each collaboration must have a name that is different from other collaborations . name (name) Is a text string . A single name is called a simple name (simple name); Restricted name (qualified name) Is the collaboration name prefixed with the package within which the collaboration exists .
2.2 structure
Collaboration has two aspects : One is the structural part , It details the classes that work together to accomplish collaboration 、 Interfaces and other elements ; The second is the behavior part , It details the dynamics of how these elements interact .
The structural part of the collaboration is an internal ( Reunite with ) structure , It can include pairs of classes 、 Interface 、 Any combination of components and nodes . In collaboration , These categories can be used in a variety of commonly used UML Relationship ( Including connections 、 Generalization and dependencies ) To organize . in fact , The structural aspects of collaboration can use UML All structural modeling mechanisms for .
Unlike structured classes , Collaboration cannot have its own structural elements , Instead, just reference or use classes declared elsewhere 、 Interface 、 artifacts 、 Nodes and other structural elements . This is why collaboration is called a conceptual block in the system architecture rather than a physical block . A collaboration can span multiple levels of the system . Besides , The same element can appear in multiple collaborations .
A collaboration called message communication between nodes can be defined in the retail system , It describes in detail the details of secure message communication between nodes .

2.3 Behavior
The structural part of the collaboration is usually represented by a composite structure diagram , The behavior part is usually represented by an interaction diagram . The interaction diagram details an interaction , This interaction represents a behavior , This includes a set of messages exchanged between a set of objects in a specific context for a specific purpose . An interactive context is provided by the collaboration that includes it , This collaboration identifies the classes whose instances might participate in this interaction 、 Interface 、 artifacts 、 Nodes and other structural elements .
The behavioral parts of collaboration can be described by one or more interaction diagrams . If you want to emphasize the chronological order of messages , Just use the sequence diagram . If you want to emphasize the structural relationship between objects during collaboration , Then the collaboration diagram . Because how often they are semantically equivalent , So both of these graphs can be used .
Expand the messages between collaboration nodes in the above figure to display the interaction diagram shown below .

4. Organization and cooperation
The core of the system architecture is found in its collaboration , Because the mechanisms that form the system represent important design decisions . All well structured object-oriented systems are composed of a group of appropriately sized and standardized collaborations , So it is very important to organize the cooperation . There are two relationships related to collaboration that are worth considering
1) There is a relationship between collaboration and what it does . Collaboration can implement both a category and an operation , This means that the collaboration represents in detail the structural and behavioral implementation of the class or operation .
2) There are also relationships between collaborations . Some collaborations can refine others , This relationship can be modeled as a refined relationship .

3. Common modeling techniques
1) Modeling characters
The following figure shows an incomplete scenario for the initial call in the switch context .

2) Modeling the implementation of use cases
The following figure shows a set of usage extracted from the credit card verification system

3) Modeling the implementation of operations

4) Modeling mechanisms
For all well structured object-oriented systems , Will find a series of patterns . One side , You can find some idioms , They represent the usage patterns of the implementation language . On the other hand , You will find some architectural patterns and frameworks that depict the entire system and form a specific style . In between , You will find mechanisms that represent common design patterns in the system , Through these mechanisms , Things in the system interact with each other in a common way . It can be used UML Model these mechanisms as collaboration .
4. Tips and techniques
When used UML When modeling collaboration , Remember that each collaboration can represent an implementation of a use case or operation , It can also exist alone as a mechanism of the system . A well structured collaboration , The following requirements shall be met :
- Including structure and behavior .
- Provide an explicit abstraction of the recognizable interactions in the system .
- Rarely are they completely independent , It's about crossing over with other collaborative structural elements .
- Is understandable , And it's simple .
When used UML When drawing a collaboration , Follow the following strategy :
- Only if you understand this collaboration and other collaborations 、 category 、 The relationship between the operation or the whole system is necessary , This collaboration is shown in the figure , Otherwise, only save it in the base frame of the model .
- Organize collaboration according to the categories or operations represented by collaboration , Or organize the collaboration in the package related to the whole system .
边栏推荐
- 音乐正版率关键数据缺失,网易云音乐IPO胜算几何?
- Promise使用
- js点击太阳月亮切换白天黑夜js特效
- postgresql copy语句
- Using minted to insert highlighted code in texstudio in latex environment
- Why is vfly, a high-end brand of Yadi that does not live up to its name, not high-end?
- Mazhiqiang: research progress and application of speech recognition technology -- RTC dev Meetup
- PostgreSQL source code learning (22) - fault recovery ③ - transaction log registration
- ArTalk | 如何用最小投入,构建国产超融合进化底座?
- C language array and pointer exercises
猜你喜欢

B_ QuRT_ User_ Guide(18)

js顶部图标菜单点击切换背景色js特效

PostgreSQL source code learning (XX) -- fault recovery ① - transaction log format

618 coming! Can oppo reno6, which is sold through all channels with high price and low configuration, win?

计算机视觉(AI)面试大全

canvas交互式星星动画背景js特效
![[safety science popularization] mining technology starts from the love story of a man of science and Engineering](/img/01/73376c133c33527e479685f8680238.jpg)
[safety science popularization] mining technology starts from the love story of a man of science and Engineering

If not, use the code generator to generate a set of addition, deletion, modification and query (2)

If no separation ----- > > login module nanny level source code analysis (0)

SQL查询连续三天登录的用户
随机推荐
Solution to the problem of gd32f4 serial port DMA reception
正则表达式
词汇表的构建——代码补全快餐教程(3)-分词
Pyqt5: button control
HikariPool-1 - Shutdown initiated... HikariPool-1 - Shutdown completed.
TweenMax五彩小球弹跳动画
net::ERR_ FILE_ NOT_ Found error
音乐正版率关键数据缺失,网易云音乐IPO胜算几何?
JSCPCP L. Collecting Diamonds(思维)
canvas交互式星星动画背景js特效
618 coming! Can oppo reno6, which is sold through all channels with high price and low configuration, win?
Integrated MP code generator
has been blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header is present on the requested
WinDbg virtual machine dual machine debugging driver file debugging
Log4j use
RequestContextHolder
023 MySQL index optimization tips - common cases of index failure
Mavros控制无人机在gazebo环境下进行双目SLAM
【ELT.ZIP】OpenHarmony啃论文俱乐部——快速随机访问字符串压缩
Instructor add function_ Enable auto fill_ Instructor modification function