System Architect-Basic to enterprise application architecture-system modeling [Part I] (part I)

Source: Internet
Author: User
ArticleDirectory
    • I. Review in the previous chapter
    • Ii. Summary
    • Iii. Contents of this Chapter
    • 4. abstract model diagram in modeling.
    • 5. Summary in this chapter.
    • 6. Series progress.
    • VII. References.
    • 8. next announcement.
I. Review in the previous chapter

The previous article briefly introduced the related content of the standard modeling language UML used in modeling, including how to use the use case diagram and class diagram and how to model. I believe that you have initially recognized the UML modeling language.

Understanding, please remember the use of different UML modeling graphics. For example, the use case diagram is mainly used to describe the functional requirements of the system. Class diagrams are mainly used to describe the relationship between entities. Remember this to help us in the system architecture

In-depth analysis in the process.

First of all, I apologize to you for some incorrect descriptions in the previous article, which may cause some false guidance to you.

This is the figure shown in the previous article. I describe the composite relationship.

Special correction:

This is the correct result. The arrow points to the aggregation class. The description is correct. I hope you can correct it.

Ii. Summary

This article mainly explains the modeling in the system architecture. The content of this article is mainly my summary and experience in the process of work and study. If you have any shortcomings, please criticize and point out more, you can leave a message if you have better suggestions.

Description. The purpose is to start from the perspective of not familiar with the system architecture modeling process, not knowing how to use modeling tools, or not familiar with how to build models as needed, this article briefly describes how to implement the system architecture.

From what perspective should we analyze the requirements and establish an abstract model. This should be said to be an essential skill for architects.

This article introduces how to use the structure charts and behavior diagrams in UML modeling to create an abstract model.

This article mainly describes the following modeling graphs: sequence diagram, component diagram, state diagram, activity diagram, and deployment diagram. Of course, this article only describes the basic theory introduction and how to design and use it.

Using architecture-system modeling [next] will explain in detail how to use these abstract model images to describe.

Iii. Contents of this Chapter

1. Review in the previous chapter.

2. Summary.

3. Content in this chapter.

4. abstract model diagram in modeling.

5. Summary in this chapter.

6. Series progress.

7. References.

8. next announcement.

4. abstract model diagram in modeling. 1. Sequence diagram. Introduction

A sequence chart is also called a sequence chart. It is mainly used for detailed steps of a process in the system. A Sequence Chart can show the interaction sequence of a series of objects in a process. The sequence diagram helps us better understand how to implement a specific use case.

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

Details

Elements contained in the sequence diagram:

Object: used to identify the objects in the detailed steps in the process.

Activity bar: used to identify that the current object is active. to indicate that an object is active, you must use a dotted line + activity diagram to build it.

For example, we need to mark a simple process of card swiping for a bus:

Swipe the card with an IC card.

Explanations:

The bus card is first placed on the card swiping terminal. The terminal reads the balance information in the card and deducts money from the card swiping terminal and terminal.ProgramObject interaction. Based on the read balance information, the fee deduction program is consistent with the fixed Card swipe In the card swipe terminal.

Compare the amount. If the balance of the current IC card is heavy rain, the fixed amount of the Card swipe terminal is deducted, and a message is returned, prompting you to successfully swipe the card.

The solid line on the way indicates the method for calling the called object. The dotted line indicates that when the called object is successfully executed, the return dotted line indicates the logical name of the returned value, which improves readability.

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

In, we used activity bars as part of the lifeline. We have not defined the creation and destruction of objects. Therefore, let's look at the creation and destruction instances of the descriptive objects provided by the UML modeling language.

The icon of the X symbol in represents the destruction of the object. Create an object through new. In, I use Chinese to describe "create object" to create an object. Then, the X-symbol generation under the lifeline

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

This only indicates that the objects to be destroyed are not referenced by other objects. Therefore, this type of language compiler provides a garbage collector to recycle objects.

Note: When an object references another object, the object has the responsibility to destroy the referenced object and must be displayed and destroyed, A notification message must be displayed to send the destruction of the referenced object. White

In this example, the destroy method of the referenced object is called.

Synchronous and asynchronous in sequence.

The synchronization and Asynchronization in the sequence diagram are similar to those we usually write.CodeSynchronization in is similar to asynchronous interpretation. Here, I will not explain it more:

When a customer goes to a restaurant for dinner, the customer must first order the food before serving it. This is a simple description. A simple call to Party B

Wait until Method B is executed.

Function a calls function B. If it takes a long time for function B, function a can continue to execute other tasks, such

When the execution of function B is complete, you only need to notify function a of callback, and function B is finished. The term in function call is callback.

The identification format of synchronous and asynchronous messages in UML modeling language:

UML provides some advanced functions of Sequence Diagrams: for example, you can use sequence diagrams to control the process. The specific implementation tool is to control the process conditions through the interaction box proposed by UML.

The interaction box defines the control logic in the process control diagram and the process execution conditions based on the interaction box. If this condition is met, the sequence step defined in the interaction box is executed. Otherwise, no

Operation. In addition to defining the process control conditions, the interaction box also has some special operators, specific operators and their functions, as shown in the following list:

The meaning of each keyword is described accordingly. You can see that all the above meanings are for the interactive box.

Summary

If you have special requirements for system functions, the interactive boxes in the sequence chart can support nesting. Nested interactive boxes increase the complexity of the sequence chart and reduce readability. Therefore, we try our best to repeat the design principles

The complex process is divided into several simple steps, and the sequence diagram is drawn separately to complete the corresponding steps.

2. Component diagram. Introduction

As we all know, component diagrams are used to describe the relationship between components in the system. First, we must know what the definition of the component is and what is the relationship between the components. We can understand this in future design.

In handy. The definition of Components in UML has undergone great changes. In earlier versions, UML defines components as follows:

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

Description of the component in uml2.x: The component is an independent encapsulation unit running in a system and provides a series of services.

Through the changes in the above UML language, the current understanding is: a system can replace a component of the system at will. The operation of the system is not affected. This can be understood as a similar solution. Everyone familiar with IOC containers should

As you know, objects running in the IOC container can be considered components. To replace the components that provide a certain service, the replacement can be automatically completed as long as the related contract of the component service is satisfied. The operation of the system is not affected.

Each component encapsulates some special behaviors to implement specific services.

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

The direct relationship between components is basically the two types. The following is an example of the difference between 2 and 2.

Service provided by the component diagram: The component diagram provides a natural solution for the System Architect. The component diagram allows the architect to verify that the required functions of the system are completed by the component. Components can be reused.

Details

Elements contained in the component diagram:

Next we will explain it separately:

(1) component: we know that a component is the most basic component in a component diagram. The definition of a component is described above. Here we will not describe more. The basic unit of a component diagram is a component.

(2) Containers: Management containers that provide services for multiple components. The components in the containers interact with each other.

(3) package: it can be regarded as a sub-system or a special component.

(4) Constraint: used to define interface specifications.

(5) add comments to the corresponding elements in the component diagram.

You can define your own interfaces on components. For example, the person component provides two interfaces. Thinking and sleep interfaces.

Modeling of component relationships:

Let's take a look at the representation of the relationship between components. According to the relationship between components described above, there is dependency and generalization. Refer to the dependency and generalization in the class diagram.

Dependency: identifies a component that depends on another component. If the dependent component cannot run normally, the component cannot run.

Generalized relationship. Identifies the relationship between a component and multiple other components as an inheritance relationship.

Summary:

Through the above learning, we know that the component diagram mainly refers to the natural formation of the System Architect's solution to the entire system. The general functions of the system can be distinguished and designed through the component diagram. Click

Abstract and separate system functions. Then, the functional process is subdivided into multiple steps through the sequence diagram, and then the class diagram is used to construct the methods that each class should have in each process step. Finally, a complete design document is formed.

File.

3. status chart. Introduction

A status chart is actually for an object (entity, component, and other elements. It mainly describes how the behavior of an object changes the state. The purpose of studying the UML state diagram is to clarify

The relationship between status changes and behaviors. Real-time behavior of modeling objects. Condition for creating a state chart: A state chart is created only when the object's behavior changes are related to the State. The status chart shows how the object changes its status.

The entire process of object lifecycle creation and deletion.

Details

Objects that can be modeled in a state chart:

Use Case: describes the changes in the status of a specific use case in the use case diagram.

Class: describes the changes in the status of a class.

Subsystem: describes the state changes in a subsystem.

The entire system: similar to the process in a (WF) workflow, each node is actually equivalent to a State.

The preceding figure shows a brief description of the status change when I go to a restaurant. The behavior of each status change is described. Of course, here is a simple example to illustrate the change in the status chart, all possible states not analyzed in detail are shown.

The specific status can also be illustrated by yourself. Here is a simple example.

Elements in the status chart:

Status mark:

A status chart can identify one or more initial states or contain one or more end states.

Relationship between different States in the status chart:

A transfer relationship is used to describe the processing flow of an object's status from one State to another. The arrow points to the status after the transfer.

The status chart provides a function element similar to the decision point in the flowchart.

Complete with element decision points:

Decision Point, used to determine the jump to different States.

Use Cases:

It plays a role in decision-making. We will not repeat it here.

Synchronization in the status chart:

The synchronization in the state chart mainly aims to illustrate the division and Union of concurrent workflows. Describes the synchronization entries in the status chart:

The initial State enters the synchronization entry. The split state synchronizes the operations A and B, respectively, and enters the and B statuses. Then, A1 and B1 are executed separately and the Union enters the end state.

An object can have multiple States through synchronization operations. Sometimes an object can have multiple States at different levels. When a single State has an independent append sub-state, you can use the hierarchical knot in the status chart.

Configuration status.

The combination state is such a complex state structure diagram. Sometimes we need to refine a complex state into merging multiple sub-states, so this complex state can be called the combination state.

The following is an example:

Composite State B, that is, composite State B, may have a more complex state inside (C-D State ). This is only the case where a single state change flow exists in composite State B, and more State flows may exist in composite State B.

We need to use the following status chart to complete the process:

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

Summary

Through the above learning, I want you to have a certain understanding of the status chart, so let's summarize how to model the status chart.

Step 1: We know the modeling status chart. First, we need to abstract the object to be modeled.

Step 2: Based on this object, we can analyze all the statuses of the object and the behavior of status changes.

Step 3: Identify the start and end statuses of each object.

Step 4: start to create the status chart of the object and analyze whether it is necessary to create a complex combination status.

During the system architecture design process, we need to first analyze which objects need to be described using the status chart. If an object has complex behaviors, you can use an activity diagram for modeling, which is more suitable than using a state diagram. Each

The status chart must have at least one starting and ending state. In addition, the detailed analysis object behavior changes. What is the behavior of transferring from one status to another. In some cases

When the States cannot be clearly expressed, you can create a combination of States to further refine the state, so that you can more clearly express the state changes of the object.

5. Summary in this chapter.

This chapter describes the sequence diagram, state diagram, and component diagram in UML modeling graphs. It also analyzes the situations in which various UML modeling diagrams are used for modeling. It also describes how to use it through simple examples. All

After the introduction of modeling graphics, I will analyze and explain how I have encountered some problems and how to separate and model functions in case of functional requirements. I hope you will give more valuable comments.

6. Series progress.

1. System Architect-from basic to enterprise application architecture series-useful for volume opening

2. System Architect-Basic to enterprise application architecture-system modeling [Part 1]

3. System Architect-Basic to enterprise application architecture-system modeling [Part 1] (Part 1)

4. System Architect-Basic to enterprise application architecture-system modeling [Part 1] (Part 2)

5. System Architect-Basic to enterprise application architecture-system modeling [Part II]

Updating continuously (Please stay tuned ...)

VII. References.
    • Http://www.uml.org-the official UML web site.
    • Http://www.rational.com/uml/resources/documentation/index.jsp--different types of entity uml.pdf.
    • Http://www.rational.com/rose--about IBM Rational Rose? Information about this commercial UML modeling tool.
    • Http://www.rational.com/xde--about IBM Rational xde? Information about this commercial UML modeling tool, which is closely integrated with the IBM eclipse development platform.
    • Http://argouml.tigris.org -- about the Open Architecture of argo uml built in JavaSource codeInformation about the UML modeling tool.
    • Http://uml.sourceforge.net/index.php--information about umbrello UML modeller, an open-source UML modeling tool for KDE.
8. next announcement.

In the next article, we will explain the activity diagram and deployment diagram that have not been completed in this chapter. Other less commonly used modeling images may be just a simple explanation, it will not be explained as illustrated in these articles. Due to the lack of talent

I am not very familiar with UML modeling. I would like to invite you to spend more valuable comments. I will continue to improve and learn in subsequent articles, write the content you have mastered. On the one hand, it helps you not be familiar with UML.

Friends can get started as soon as possible, and they can also get a better impression.

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: info-contact@alibabacloud.com 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.