Using UML for project development

zhaozj2021-02-17  163

Using UML for project development

I. Overview

The content mainly discussed in this paper is how to use UML to guide (auxiliary) project design. In this article, assume that the reader has a conceptual understanding of the UML, which can be well understood by the nouns appearing in the UML.

The goal of UML is to describe any type of system in a way of object-oriented diagrams, which can model any system with static structures and dynamic behavior.

In a complete software project development process, we generally divide it into four stages:

l First is the analysis phase, mainly concerned about the main concepts in the problem (such as abstraction, classes, and objects, etc.) and mechanisms.

l Two is the design phase, mainly considering the classes defining technical details in the software system (such as classes that process user interfaces, databases, communications, and parallelism).

l The third is a configuration (implementation) phase, which is a relatively independent phase, its task is to convert classes from the design phase into actual code with object-oriented programming languages.

l4 is the test and maintenance phase. In this most important acceptance test, it will be performed by the user to verify whether the system test is determined in the analysis phase.

This article will also make recommendations on how UML is applied in these four phases.

Second, the application

2.1, analysis stage

In the analysis phase of UML, the main task is to draw the use case (User Case Diagram) because: 1. It describes the functional requirements of the system to be developed; two, it will see the system as a black box, from the user (final customer The angle is to understand the system function; third, it is a tool for system developers and user exchanges, and it is also a baseline for the entire project process after the use of User Driven.

The use case describes the functions of the implementation of the entire system, and does not care about the specific implementation of the system, so that the system designer is prematurely fall into technology to achieve detail, which is conducive to rapidly establishing the correct and simple system model; Using examples, a technician and non-technical communication pathway are mapped, so that the maximum extent avoids mistakes (errors), which reduces the risks of the entire project.

At the same time as the example is drawn, the corresponding use case document is also required. The use case can be divided into different levels such as business level, system level, and functional level, and use case documentation is concerned about system-level use cases. In a good use case document, not only the participants, steps, results, etc., not only the information referred to in the use case, but also to avoid the specific implementation of the use case premature consideration. That is to say, to make the modeling process

And specific programming languages, the details are completely separated.

In the process of system use case analysis, it is necessary to note the particle size (size) problem of the use case. Developing designers a common problem is that the system has a small type of granulation, making it a functional decomposition of the system. In this way, in the use example description, it will be separated from business terms, resulting in a technical language. The particle size is usually:

l Take system activity as a system use case

l Take the interaction step as system use case

In fact, we can see from the above description. It is a way to determine whether a particle size is a technical language in the judgment example description. If any, it is very likely that it has made a small error in the use of an exemplary.

In the process of system analysis using UML, we generally take the following steps (the purpose of this step in parentheses):

1. Identify the system boundaries and actors (one of the effects of the Actor is to determine the system boundary)

2. Identify use case (departure from the perspective of end customers)

3, write user documentation (clear use case, in order to design phase identification classes and classes) 4, identify relationship between use cases (in order to interact between design phase identification class)

In the analysis phase, how to identify the use case and how to identify the relationship between the use case is a very complex, there is a skillful thing, and the knowledge and experience of a certain system design can be done. For details, please refer to the references 1, 2 of the article.

The relevant output product of the analysis phase UML is the system example and system use case document.

2.2, design phase

In the design phase, the main task is to draw a class diagram and a sequence diagram. This stage works mainly on the output product in the analysis phase, which is the use of the example and use case document.

We have found that there is a lot of nouns in the use case document generated during the analysis phase. After further analysis, we have found that the properties of class and classes can be summarized from these nouns that appear in an example document. Take the usage document as an example, we found that "flight" can be used as a class, while the flight number, start, destination, date, etc. can be present as the "flight" attribute. Of course, not all nouns can summarize the properties of classes or classes. Through this continuous analysis and identification, we have established a class diagram. However, in this class diagram, we only have class names and class properties, one of the most important: the way the class does not appear in this type.

The next step we have to do is analyzing the verbs that appear in an example document. In the grammar, the verbs describe the relationship between the various terms; Similarly, the verbs in the use case describe the (collaboration) relationship between the class we summarized. One of the functions of the plotting sequence diagram is to describe these relationships. In the same way as an example, we can get one of the following sequence diagrams:

We found that "Flights for Query Specified Flight" can be defined as the "Flight Management System" class:

Similarly, other collaborative relationships and messages between classes, we can easily draw other public (public) methods that should have. In this way, very quickly, while the sequence diagram is drawn, we have completed the supplement to class diagrams.

As in the identification case, there are many precautions, skills, and paying attention to the relationship between the identification class, the attributes and classes. It also needs a certain theoretical skill and design experience to complete this. the work. For details on how to identify the relationship between classes, class properties, and classes, please refer to References 1, 2.

In the design phase, the associated output product of UML is a class diagram and sequence diagram.

2.3, construction (implementation) stage

In fact, after the design phase is over, in general, we will not update the documents and pictures in the UML. So starting from this stage, what we need to know how to use the UML documents and maps that have been formed to do our work.

The construction phase is a relatively independent process. In this stage, the code of the codent's task is to convert the relationship between the relationship between the needs, class properties, and classes formed by the design phase. In the previous phase, the class method is a public (external) method, that is, the interface or API, we have to add certain private methods and properties to the features required to complete these APIs. As for how to convert into program code from class diagrams, it is not discussed in this article, please consult your own information.

In a relatively complete system, developers need to complete the code, but also need to complete mapping by code (class) to the database. At this time, you need to complete the modeling of the database and database, the intermediate layer of business logic - Database Access Layer Coding and Design. For database modeling, please refer to the reference 1 or other database related books, this article is not described later. 2.4, test stage

When testing, the UML model can also be used as a basis for the test phase. The system typically requires unit testing, integration testing, system testing and acceptance testing. Different Test Teams use different UML maps as test basis, test phases and UML documents, see the table below:

Test phase

UML related documentation

unit test

Class diagram and class specification

Integration Testing

Partial diagram and collaboration map, sequence diagram

System test

Use case

Acceptance Test

Case map (in practice, this stage is performed by the user,

Under normal circumstances, it will not be used to develop documents of the developer.

Explanation: Unless a very large project, it will not be used in the general UML modeling process, so this article does not mention the drawing and use of the component map; collaboration Diagram and The sequence diagram is actually assigned, and it functions in UML. As for why only the above UML elements are mentioned, this is as mentioned in the "UML User Guide": "20% of UML can be 80% of the problem modeling", UML is too large, how to use it is good, but I firmly believe that we are going to do is what we need.

to sum up

Through the analysis and explanation above this paper, I believe that you have a preliminary impression on how to use UML in a specific project, and we also found that in a complete project process, the UML documentation is mainly analyzed, design phase ( In fact, modeling tools, methods are only in the analysis, and the design work is enough). In the previous article, the generation of the UML document is to talk together with the project process, now we listen out to the UML document, see the generation of the UML document.

1. Generate an example of example, use an example document;

l According to the user's demand generation example, use an example document. This is a stage of interacting with the user, and whether the work is correct or not, whether there is a very large relationship with the user with the user. This stage mainly generates the use case and the use case document for system-level use cases, preparing for future design work.

2, generate class diagrams;

l Generate a class diagram according to the example drawing and use case document. In this class, only the relationships, class names, and class properties between classes.

3, generate a sequence diagram.

l According to the document generated in the first two phases, the sequence diagram is generated, and according to the relationship between the classes in the sequence diagram, the message delivery and other information continue to complete the previous stage unfinished class; while continuing to enrich the functional level Class with example diagram and use case document

I believe that everyone has seen that although the specific process is divided into three phases, there is no clear boundary between the three stages. Three stages have intermittent intersections and gradually improve. The final purpose is to form a complete class, which is fully, adequate and adequate preparation for future implementation stages.

postscript

When writing this article, the author does not actually use the experience of project development in UML, so this article is only a learning summary for the author's reading. The development process introduced in the article is a kind of good one after a few different processes, because this process is simple, clear, all UML documents are established, and enter from a stage At a stage, all the necessary information in the next stage has no information; but also in the next phase of work, it provides more, clear information for the work that has completed the stage of the previous phase. For the completed phase, it has played a perfect role in the work. The author believes that it is a good learning method with a written content. Because this will force yourself to make a clear concept in the past, and play the purpose of review and consolidation. Of course, such an article must have a mistake or mistake, talk about this, you have to ask the readers to enlighten me, discuss together! ^ _ ^

Please let me know: kinyondgenius@msn.com, warmly look forward to your information.

references

1, UML Training Document, Umlchina, 2002

2, "UML and Mode Application - Object-Oriented Analysis and Design", Craig Larman, 2002

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

New Post(0)