Software Model Design Foundation - Diagram (Class Diagram)

zhaozj2021-02-16  83

1.5 map

1.5.1 Class Diagram (Class Diagram)

Semantic semantics:

The class diagram is a graphical expression of a static view, indicating a declared (static model element), such as class, type, and other content and interrelationships. The class diagram can represent the view of the package, including symbols of the nest package. The class diagram contains some specific behavioral elements, such as operating their dynamic feature, represented in other figures, such as state diagrams and collaboration diagrams.

Notation:

The class diagram is a static view represented by a graphical way. Typically, in order to represent a complete static view, there are several classes (class diagrams to pay attention to the correlation, such as logic division). Each independent class diagram needs to explain the division in the base model, that is, some logical divisions, such as the package that constitutes the natural boundary of the figure.

The representation of the class diagram is a simple representation:

(We still have to give an example of our original use to explain the following map. When the state is said, we raised a copy of the key to the key. This time, let's change the way, if a manager has off work I got downstairs, I found that the key didn't take it down. At this time, he let the secretary will take it. In the end, the secretary gave the manager after giving the manager, the manager got the key to go home)

1.5.2 object map (Object Diagram)

Semantics of the object map:

Object chart shows the relationship between some timing objects and objects, such as an object being a class entity, then an object is an entity-object that replaces the classes in the class map, then this picture is an object map. The object map and the collaborative diagram are related to the collaboration diagram display the object model in the context (class element role).

Object diagram representation:

There is no need to provide separate forms for the object map. The object contains an object, so only objects without class is a "object map" (consistent with the semantic description). However, the term "object map" is only useful in a particular environment. The object map does not display the evolution of the system, and he is just a static description of the relationship between an object.

1.5.3 Model (User Case Diagram)

Use the example semantic:

Indicates the relationship between the participants and the use cases in the same system.

Use the example to show:

The use case is a diagram of a set of participants, a set of cases, participants and use cases, associated with examples, and generalization of the participant, as well as the association between the participant, the system boundary (a rectangle). Use an example to represent an element from the use case model.

1.5.4 Sequence Diagram (Sequence Diagram)

Sequence chart semantics:

A diagram of the interaction of the object in time order, in fact, it shows the order of participating in the interactive object and the switched message. It is also a collection of communication between objects between the time as the order. Unlike the collaboration map, the sequence diagram is only a time relationship, and the object relationship (accurate should be the time sequential relationship of the object).

Sequence diagram representation:

There are two directions in the order of the sequence. It is the two-dimensional, vertical direction representing the time, the horizontal direction represents the object participating in the exchange (in fact, the order of order), no matter whether the level or vertical direction has not specified, who is the first can. Friends who know that the operating system mechanism has a concept - the message mechanism is driven. Natural other applications is similar, the order-in relationship is the message direction, this direction is also in order to participate in the interaction, each time an object participates in the message mechanism.

Of course, the object is in the process (one process has n objects, which is also a life-repeated period (Object) declaration) (with the delete (object) method is over), then this line can not draw. So, for an external object (not internally generated, it does not disappear at the end of the process), how is it described? same. Each message is displayed as a horizontal arrow from the lifeline of the object from the transmit message to the lifeline of the object of the object received. A label is placed at the arrow to indicate the time or other constraints of the message being sent.

COLLABORATION DIAGRAM

How to talk about collaboration in front, how to solve it? If there is no way to buy it!

Collaborative pattern semantics:

Collaboration diagrams represent a view of the interaction between the characters, ie, the instances of collaboration and their chains. Unlike the sequence diagram, the collaborative map explicitly represents the relationship between the characters. On the other hand, the cooperative map does not represent the time as a separate dimension, so the sequence number must be used to determine the order of the message and the parallel thread. The sequence diagram and collaborative graph expressions are similar information (expressed in different ways).

Collaborative diagram:

Let's clarify the problem that the collaboration does not make a clear question before, and then it will be collaborative.

Collect of collaboration: In a set of given objects (these objects will be described when constructed the component diagram) and a given environment (referred to as a context), in order to complete a target. Thereby a behavior is achieved. To understand design mechanisms, you should focus on objects and messages involved in implementing one or set of targets. They are also used in larger systems to complete other goals. The arrangement of the object and chain work together to achieve some purpose is called collaboration. The message sequence of the behavior implemented in collaboration is called interaction.

Collaboration consists of static parts and dynamic parts. The static section describes the roles that may bear in the collaborative instance; the dynamic portion contains one or more dynamic interactions, indicating that the message flow in cooperation in the calculation process. The message stream flowing in collaboration can be described in the state machine to describe, the state machine will specify the legal behavior order. The event exchange between the events in the state machine represents the message exchange between the characters in the collaboration.

Collaboration consists of roles, and the role is only meaningful in collaboration, meaningless than collaboration.

During the implementation of the program, the problem we often consider is the runtime issue of the object, which is always the object of the object (see role here) in the runtime collaboration (this collaboration is called running binding).

He has already said that the message flow on collaboration is, and the reader will take a lot of events or messages when we have narrate the state machine. Event is also a message, but this message is triggered by a state transition to an application programs or collaboration (this place is the "Event Drive" core description). If you don't understand the example of going to get off work again.

However, there are two other concepts in collaboration: First, constraints, one is resource.

From essentially described, if the message is to be a message, the resource is a class that provides a message, and the constraint is to provide what kind of message.

Collaboration map:

I personally think that there are two categories of collaboration, one is to operate collaboration map, one is entity collaboration map.

Operation collaborative diagram relationship, and physical collaborative chart of the entity. The essence of the figure is consistent with interactions between roles.

1.5.6 status map (Stat Chart Diagram)

Status chart semantics:

A diagram showing a state machine (including simple status, conversion, nested constituting state). This view includes a state machine. About the state machine I suggest you look back at the instructions for the state machine.

Status diagram representation:

When we explain the statement of the state machine, it is a state diagram.

See the state shown in the state of the state shown in Figure 1.5. 7 activity map (Activity Diagram)

Activity pattern semantics:

The activity map is a special case of the state machine, and all or most of the states in the state machine are in active or action status, all or most of the conversion is triggered by the active completion in the source state.

The active diagram represents a program or workflow. Workflow is an example of a process modeling modeling. The activity map usually appears in the previous stage, that is, before all implementation decisions, especially before the object is specified, its status represents the execution of the activity, is like a computer or real world uninterrupted operation, and conversion The completion of activities in the state is triggered (if there is constrained condition, there may be several possible outlets).

The activity map is an state machine that emphasizes the order and concurrent steps during the calculation process.

Several concepts:

Dynamic concurrency: Active status with dynamic concurrency indicates that multiple independent calculations are executed. The activity is called at the same time as a parameter table set. Nothing in the collection is a parameter table for the active parallel call. Call is independent of each other, when all call is completed, the activity ends and triggered its completion conversion.

Object flow: Sometimes, check the relationship between the operation and the object of its parameter or the result of the result. An input and output of an operation can represent a state of flow. It is a structure of a state in which a given class of a given class is represented in the calculation process. It is a structure of a state, indicating that the object exists in a specific point during the calculation process.

Objects input or output can be represented as a target symbol. The symbol represents an object in a calculated point in the calculation, which is suitable as an input or output at that object. The dotted arrow indicates the output conversion from the actual state to one of the active outputs. The dashed arrow can also represent input conversion from the object to the active state of the input to use this object, usually, the same object can be used as an active output and a plurality of successive inputs.

Status Class: The same object is controlled by some of the subsequent activities that change its state. For more accurate, the object can appear multiple times in the figure. Each appearance indicates different states in its life. In order to distinguish a multiple appearance of the same object, the state of each point can be placed next to the category of the square. Swimming: The activities in the event map can be divided into several groups in different criteria. Each group represents some meaningful parts of the active responsibility, for example, the business organization is responsible for a given work. According to their graphical representation, the French is called a lane according to each group. In order to illustrate this concept, take a lane to express it. I generally see the lane: take the business process to explain the problem, such as the filling order is a step (may also be a few steps, not necessarily continuous), financial review It is a step (it may also be a few steps, nor will it be continuous), the warehouse is also a step, the intermediate process may also turn to turn; well, we divide business, finance, warehouse into three parts, This portion can be referred to as a lane.

There are several steps in each lane, we can see related to objects, inter-object logic, interaction, etc., we can represent in the sequence diagram. The specific implementation of the relationship will explain the following chapters.

Delayed event: When other activities are performed, there is an event to be delayed for later use (no immediately used events). The delay event is placed in the internal queue until it is used or abandoned. If a delay event occurs in a status or activity, the state or activity will be described, and other events must be immediately excited. If several conversion is implied, which one of them will be excited and unclear, and a rule is performed to select a conversion of exciting is a semantic change point.

Activity diagram representation:

The activity map is a state machine, but several simple representations (also considered to be a few branches) are also applicable to active diagrams such as active status, branch, merge, lane, subject flow status, state, delay events, etc. .

1.5. 8 component map (Component Diagram) component map semantic:

The component chart indicates the dependence between the software, including the source code component, binary code component, and executable code components. Software modules can be represented by a component. Some components are present when they are compiled, and some exist in the link, some exist in multiple occasions. A compilation component is only meaningful when compiling.

The component diagram only in the form of a descriptor, no example. To represent component instances, deploy diagrams should be used.

Component diagram showing:

The component diagram represents a component element, and a class (or other class) and component relationship therein. Component types can also be nested in other component types, thereby representation of the definition relationship.

The classes defined in the component are represented in the component (the "belly" drawing class of the component).

Compilation dependencies can be represented by a graph containing component types and node class categories. This relationship is represented by a broken line with an arrow, and the arrow points from the user member to its dependent service component.

If the interface from one component points to the other component can be represented by a dashed line.

Specific examples of the legend see the next chapter.

1.5. 9 implementation map (Deployment Diagram)

The method is to deploy the diagram, which means that the component is used, which is already mentioned in the component diagram.

Semantics of the image:

The figure shows a view showing the configuration of the runtime process node, component instance, and its object. The component represents the performance of the code unit at runtime. The components that do not exist at runtime do not appear in the embodiment, but is represented in the component.

Embodiment An example of a node connected to a communication chain. Node instances include instances of runtime, such as component instances and object components instances and objects, can also include objects. The model can represent the dependencies between examples and their interfaces, and can also express entities between nodes or other containers.

Implementation diagram representation:

The figure is a mesh map composed of a node symbol and a path indicating communication associated, and the node symbol may include a component instance. The means exists or operates on the node. The component symbol can contain an object, indicating that the object is part of the component. The components are connected in a dashed arrow, indicating that a component uses the service of another component. Describe the dependencies with a constructor if necessary.

The implementation diagram is similar to the object map, typically used to represent an example of each node in the system. Few embodiments have to define the relationship between nodes and nodes.

转载请注明原文地址:https://www.9cbs.com/read-11971.html

New Post(0)