System Architect-Basic to Enterprise Application architecture-System modeling [medium] (top)

Source: Internet
Author: User
Tags dashed line

First, Oberzhang review

In the previous article, we briefly introduced the relevant content of UML of standard modeling language used in modeling, including the usage of use case diagram and class diagram and how to model it. I believe that we have a preliminary understanding of the UML modeling language

And to remember the usefulness of UML's different modeling graphs. For example, use case diagrams are primarily used to describe the functional requirements of a system. Class diagrams are primarily used to describe relationships between entities. Keep in mind that this will help us in the system architecture

In-depth analysis of the process.

First of all to apologize, the last part of the section described the wrong place, may cause a certain error guidance to everyone.

This is the diagram given in the previous article, which I describe as a combinatorial relationship.

Special corrections are:

That's the right result. The arrows point to the aggregation class. The information described does not have any errors. I hope I can correct you.

Ii. Summary

This article mainly from the system architecture modeling began to explain, the content of this article is mainly my work and learning process in the summary and experience, the shortcomings are also please many criticized that there are better suggestions can also leave a message

Description The main intention is to not be familiar with the system architecture modeling process and do not know how to use modeling tools, or unfamiliar with how to build a model based on the needs of the point of view, simply elaborated in the system architecture process we should

What is the point of view to analyze requirements and create abstract models. This should be said to be an architect's requisite skills.

This article will briefly describe how to use each structure diagram and behavior diagram in UML modeling to complete the establishment of abstract model.

This article mainly explains the following several modeling graphs: Sequence diagram, Component diagram, state diagram, activity diagram, deployment diagram. Of course, this article is only about the introduction of basic theory and how to design and use, System Architect-based to the enterprise should

The architecture-system modeling [next] will explain in detail how to use the abstract model drawings that have been introduced to describe them through specific examples.

Iii. contents of this chapter

1, Oberzhang review.

2, summary.

3. Contents of this chapter.

4, modeling the abstract model diagram.

5. Summary of this chapter.

6, Series progress.

7. Reference documents.

8, the next preview.

Iv. abstract model Diagram in modeling. 1, Sequence diagram. Introduced

A sequence diagram is also called a sequence diagram, which is used primarily for detailed steps of a process in a system. A sequence diagram can give a sequence of interactions between a series of objects in a process. The sequence diagram allows us to better understand how to implement a use case

The method. We know that use case diagrams are used to describe the functional requirements of a system. The sequence diagram clearly describes the implementation of a use case, which is the function of the system.


Elements contained in a sequence diagram:

Object: The object used to identify the detailed steps in the process.

Activity bar: Used to identify the current object is active, if you want to indicate that an object is active, you must use a dashed + activity diagram form to build.

For example, we are now going to mark a simple process of making a bus swipe:

IC card swipe operation.

Related explanations:

Bus card, first put on the card terminal, the terminal read the balance information in the cards, and then swipe the terminal with the end of the debit program object interaction, the debit program according to read the balance information, with the card terminal fixed card

The amount is compared if the current IC card balance heavy rain swipe the fixed amount of the terminal, the deduction amount, and returns a message that prompts the swipe to successfully operate.

A solid line on the way represents the method that invokes the called object, and a dashed line indicates that when the invoked object executes successfully, the returned dashed line represents the logical name of the return value, which can improve readability.

There should be a dashed link between the bus card and the activity bar.

In the We used the activity bar, the activity bar as part of the lifeline. We do not define object creation and destruction, so we look at the creation and destruction of the description object provided by the UML modeling language.

The icon in the X symbol represents the time the object is destroyed. Create object by new to create, in the Chinese description "create object" to complete the creation of objects, then under the lifeline of the X symbol generation

The table destroys the object and removes the object from memory. Of course, the destruction of this object has different processing methods for different development languages. Destroy objects in C + +, you must call the destructor to destroy the object. In C # and the Java language

It simply means that the object that is currently being destroyed is not referenced by other objects, so the language compiler provides the garbage collector to complete the collection.

Note: When an object references another object that is responsible for destroying the referenced object and must show the object being destroyed, then the notification message must be displayed for the sending of the referenced object to be destroyed. White

In other words, the method of destroying the referenced object is displayed.

Synchronous and asynchronous in a sequential way.

Synchronization and Asynchrony in sequence diagrams are similar to the interpretation of synchronous and asynchronous in our usual writing code. Not too much explanation here, illustrated by the legend:

Customers go to the restaurant to eat, the first order of food, must wait for a meal before serving. That means it can be described in such a nutshell. A simple call to Party B

method, you must wait until the B method executes, and then continue execution.

function A calls function B, and if B takes a very long time, then a can go on to do other things like do and write

Number c interaction, and so on the B function is finished, only need callback notification, A, B function is done. The term in a function call is a callback.

The identity format for synchronous and asynchronous messages in UML modeling languages:

UML provides advanced features of sequence diagrams: For example, Process control can be achieved through sequence diagrams. The concrete Realization tool realizes the process condition control through the interactive frame proposed by UML.

The interaction box defines the control logic in the Process Control diagram and defines the conditions for the process execution based on the interaction box. If this condition is met, then the sequential steps defined in the interaction box are executed. Otherwise do not do any

Operation. In addition to defining conditions for process control, the interaction box has its own special operators, specific operators and their functions, such as the following tables:

Each keyword represents a corresponding description of the meaning. Everyone should be able to understand that all of the above meanings are for the interactive box.


If there is a special requirement in the system function, then the interactive boxes in the sequence diagram can support nesting. Nested interactive boxes will increase the complexity of the sequence diagram and reduce readability. As a result, our design-time principles

The miscellaneous process is split into a few simple, separately plotted sequence diagrams to complete the corresponding steps.

2, Component diagram. Brief introduction

As we all know, component diagrams are used to describe the relationships between components in a system. First we have to know what the definition of the component is, and then what is the relationship between the components. We will be able to do this in future designs.

Comes in handy. The definition of a component in the UML language has changed dramatically. In the previous version, UML defines the components as follows:

Description of the component in the UML1.1 language: a file or a program that can be run is called a component. But we know that before the UML component diagram, the components are generally used to describe COM components or other components, resulting in conflicts, so with the subsequent release of the UML language, the original meaning has been modified.

Description of the component in the uml2.x language: The component is independent and is a package unit running in a system that provides a range of services.

Through the transformation of the above UML language, the current understanding is: A system, you can arbitrarily change a system in a build. Without affecting the operation of the system. This can be understood as similar, and everyone familiar with the IOC container should

Know that an object running in an IOC container can be seen as a component, then replace one of the components that provide a service, as long as the relevant contract that satisfies the component's service can be automatically replaced. Without affecting the operation of the system.

Each component encapsulates some special behavior and implements a specific service.

What are the relationships between components? Let's take a look at the relationships that the components directly may exist:

The direct relationship between components is basically about these 2 kinds. The following example distinguishes between the 2 relations.

Component diagrams provide the services: component diagrams provide a natural form of solution for system architects. Component diagrams allow the architect to verify that the required functionality of the system is done by the component. Components can be reused.


Elements contained in a component diagram:

Below we explain separately:

(1), components: We know that components are the most basic components of component diagrams, and the components above have been described in the component definition. Here is no more introduction, component diagram consists of the basic unit is the component.

(2), container: a management container that can serve multiple components, and the components in the container interact with each other.

(3), package: can be regarded as a subsystem, in fact, can also be regarded as a special component.

(4), constraints: Used to define interface specifications.

(5), add the appropriate annotation information to the corresponding element in the component diagram.

You can define your own interfaces on a component. For example, a person this component provides 2 interfaces. Thinking and sleep interface.

Modeling of component relationships:

Let's look at the representation of the relationship between components, depending on the relationship of the components explained above, and the dependency and generalization in the reference class diagram.

Dependency, which identifies a component that relies on another component that cannot be run if the dependent component does not function properly.

Generalization relationships. Identifies a component's relationship to multiple other components as an inheritance relationship.


Through the above study we know: The component diagram is mainly for the system architect of the whole system of the natural formation of the solution, can be in the form of component diagram to distinguish and design the general function of the system. Through the component diagram

System functions are abstracted and detached. The function flow is then subdivided into multiple steps through a sequence diagram, and then a class diagram is used to build the method that each class in each process step should have. Finally, a complete design text is formed


3, the state diagram. Brief introduction

A state diagram is actually for an object (entities, other elements of a component, and so on). The main description is how the behavior of the object changes the state of the reflection. The purpose of our study of UML State diagrams is to understand

The relationship between changes in the state of the elephant and behavior. The real-time behavior of modeling objects. Conditions for creating a state diagram: A state diagram is created when the behavior of the object changes in relation to the state. The state diagram reflects how the object changes the state of the corresponding behavior

The whole process of the creation and deletion of the life cycle of the display object.


An object that a state diagram can model:

Use case: You can describe a change in a use case state in a use case diagram.

Class: A change in the state of a class can be described.

SUBSYSTEM: Can describe the change of state in a subsystem.

The entire system: a process in a similar (WF) workflow, where each node is actually a state.

The above simple to draw a go to the restaurant to eat the state changes, each state change behavior has a description, of course, I here is simply an example of the changes in the state diagram, and no detailed analysis of all possible states are drawn out.

The specific state also invites you to practice to draw out, here is simply the example explanation.

Elements in a state diagram:

Status Tags:

A state diagram can identify one or more initial states, or it can contain one or more end states.

Relationships between different states in a state diagram:

A transfer relationship that describes the flow of the object's state from one state to another, and the arrows point to the state after the transition.

The state diagram provides a functional element similar to the decision in the flowchart: the point of the decisions.

Through the element decision point to complete:

Decision points, which are used to make decisions to jump to different states.

The specific use cases are as follows:

is to play a role in decision-making. This is not a retelling.

Synchronization in a state diagram:

The synchronization in the state diagram is primarily to illustrate the bifurcation and union of concurrent workflows. Describes the synchronization bars in a state diagram:

The initial state enters into the synchronization bar to perform operations A and B, respectively, into a state, B state, and then perform A1,B1 union into the end state respectively.

An object can have multiple states through a synchronous operation of a colleague. Sometimes an object can have multiple states at different levels. Hierarchical junctions can be used in a state diagram when a single state has independent additional child states

The state of the structure.

Combined state is such a complex state structure diagram, sometimes we need to refine a complex state into multiple sub-states of the composition, then this complex state can be called the combination state.

The following examples illustrate:

Combining State B, also compound State B, may have a more complex state (c-d state) inside. This is only the case where a single state change process exists in the combination State B, and it is possible to combine State B with more state flows.

Then we will use the following state diagram to complete:

1 represents the process of the order, and 2 represents the payment process.


Through the above study I think you have a certain understanding of the state diagram, then we will summarize, how to model the state diagram.

The first step: we know the modeling state diagram, the first need to abstract out the object to be modeled.

The second step: based on this object, we analyze all the state of the object and the behavior of the state change.

Step three: Identify the starting and ending states of each object's state.

Fourth step: Start creating a state diagram of the object to analyze whether it is necessary to create complex combined states.

In the process of system architecture design, we must first analyze which objects need to be described using a state diagram. If an object has complex behavior, it is more appropriate to use an activity diagram to model than to use a state diagram. Each

A state diagram must have at least one starting and ending state. and detailed analysis of the behavior of the object that has changed state. What is the behavior of moving from one state to another. In some cases, if an object's

When a state cannot be expressed clearly, the State can be further refined by creating a combined state so that the state of the object can be expressed more clearly.

Summary of this chapter.

In this chapter, we mainly describe the sequence diagram, state diagram and component diagram in UML modeling graphics. and analyze the circumstances under which the various UML modeling diagrams are used for modeling. And it shows how to use it through a simple example. All of the UML

After the introduction of the modeling graphics, I will explain how I am currently encountering some problems, how to meet the functional requirements of functional separation and modeling. I hope you will make a lot of valuable comments.

Vi. series of progress.

1. System Architect-Basic to Enterprise Application Architecture series--Benefits

2. System Architect-Basic to Enterprise Application architecture-System modeling [prev]

3. System Architect-Basic to Enterprise Application architecture-System modeling [medium] (top)

4. System Architect-Basic to Enterprise Application architecture-System modeling [medium] (bottom)

5. System Architect-Basic to Enterprise Application architecture-System modeling [next]

Keep up to date (please keep your eye on ...)

Vii. reference documents.
    • UML Web site.
    • a variety of different versions of specific UML specifications.
    • about IBM Rational rose, the Business UML modeling tool.
    • about IBM Rational XDE, a business UML modeling tool that is tightly integrated with IBM's Eclipse development platform.
    • about Argo UML, an open source UML modeling tool built with Java.
    • about Umbrello UML modeller, the Open source UML modeling tool for KDE.
Eight, the next announcement.

The next article will explain the activity diagram and deployment diagram that are not covered in this chapter, and the other less commonly used modeling graphics may be simply explained, and will not be explained in the same way as these articles. Because this talent is sparse

Learn shallow, perhaps the understanding of UML modeling is not deep enough, also ask you to spend a lot of valuable advice, I will continue to improve and learn in the following articles, the content of their own to write, on the one hand is to help unfamiliar with the UML

Friends as soon as possible to get started, but also can let themselves deepen the impression.

System Architect-Basic to Enterprise Application architecture-System modeling [medium] (top)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.