In the previous article "UML System Analysis and Design 02-use case diagram and activity diagram (I)", we mainly explained the use case analysis and drawing methods and techniques in requirement analysis, however, the use case diagram only tells us what the system wants to do. As for how to do it, there is no intuitive description. To better illustrate how our system meets user needs one by one, and provide users with detailed descriptions of "how to do, we will use the "activity diagram" to add a supplementary description of the use case.
[Note: In UML, the "activity diagram" is used to add instructions to the "use case diagram", but I personally prefer to define it like this, and applied in practice.]
[Tips: UML diagrams are generally divided into static and dynamic diagrams. The use case diagram belongs to a static graph, and the "activity diagram" described later belongs to a dynamic graph. When we analyze and design a problem, we generally use a combination of static and dynamic graphs to describe and describe it.]
IV,Activity digoal
(Vs2010 tool example)
V,Activity diagram
1,Three axes in the activity diagram
We will find that there are still many elements in activity dianyi. In fact, in our work, you will find that in most cases, we do not need to be proficient in this "18-year-old martial arts, in fact, it only takes three axes!
First board: Start-end
Board 2: branch-Merge
Vertex: forking-join
Of course, to make these three axes coherent, we have to have the node "action" and line "connector ".
(The above name is my personal habit, which may be incorrect)
2,Reference
①: "Create a record" example:
②: "Order Management" Example:
③: Of course, there are many other elements that are not mentioned here. We will explain them one after another in the subsequent instructions. I personally think that the current analysis order is broken, and we will focus on solving the problem with the "three axes. We also use other elements in Architecture Design and outline design.
3,No "swimming track"
"Swimming track" UML is a very intuitive and useful tool for "activity diagram", but it is not provided in vs2010, unfortunately, the latest vs11bate version does not provide support for "swimming channels", and interested friends can only use alternative solutions. The method is as follows:
Drag a "rectangle" from "Sinple shapes" and set its "line thickness" to "0.01" and "color" to "= darkgray ".
Add an "Object node" from "UML Activity digoal" and set its attribute "color" to "gainsboro ".
Taking "create a record" as an example, the effect is as follows:
(This case was provided by netizens in the csdn Forum. Although not orthodox, it is also good)
4,No activityFigure
The standard "activity" Diagram in UML is not provided directly in vs2010.
①: According to the description of activity on msdn:
The flow of work that is depicted by an activity digoal. To see the properties of an activity, You must select it inUML Model Explorer.
- Is read only-If true, the activity shocould not change the state of any object.
- Is single execution-If true, there is at most one execution of this divisor at a time.
②: This is the case in the view.
5,Confused "Activity parameter Node"
In the previous section, we mentioned that there is no formal activity diagram in the vs2010 element, so the "Activity parameter node" will appear "when there is no seams" or "No question. Is it more appropriate to call "Action parameter node" in practical applications? What is the essential difference between this and "Input Pin" and "output pin" (the practical application of input pin and output pin will be explained later )?
I personally think that the definition of "Activity parameter node" is not consistent with the standard UML definition. (Microsoft has always had little respect for standards, so it can be practical !)
The following is a description of Activity parameter nodes from OMG uml2.0 superstructure specification:
①: Activity parameter nodes are displayed on the border.
②: An activity parameter node is an object node for inputs and outputs to activities.
③: Example Diagram
④: The following figure shows an example of vs2010:
6,"Artifact"".
"Artifact" is not an element defined in UML, but it is a very good extension in the use case diagram. Its existence makes the "case-driven" design scheme very convenient.
① How to create "artifact" in vs2010"
First, we will create a use case diagram and an activity diagram for different use cases. For example, "Create a recording data use case map" and "Create a recording data Activity Map", open the use case map in the current work zone.
Then, select the corresponding activity chart in the solution, click the left button, and drag it to the workspace of the use case chart. Then, an artifact is automatically created ".
Finally, the "dependency" relationship is used to associate a specific use case with its corresponding activity diagram, and the class diagram can also be associated in the same way.
② Comments
I have to name vs2010. With this function, all complicated designs can be associated with use cases. Just like the activity diagram just now, it can also be a later class diagram, time Sequence diagram. This is even if there is a genuine vs2008 does not need to change to vs2010, because it can make the analysis and design so convenient and flexible. The analysis and design can be improved through continuous iteration.
(Is it true that the dream of "getting rid of documents" can be realized ?)
7,Attribute
In fact, all elements may also have some special attributes to express a clearer intent, such as: Action has body, language, localconditions, call behavior action has issynchronous, behavior, etc, you can set it when using it to express more precise meanings.
VI,Demand Analysis Drill
1,Background
DataCcavReport: this year's CD/DVD production was high, but music farmers were not happy. Due to poor sales, the excellent CD/DVC products were on the ground. In order to help music farmers solve sales problems, local Z & F actively organized research and finally decided to cooperate with "musicstore" to provide a platform for music farmers and buyers to establish information interaction, in this way, music farmers can increase product sales and increase revenue .....
(This requirement is adapted from "fruit harvest, unsalable, Z & F help ")
2,Requirement collection
After Collection, we decided to add the following requirements to the "musicstore" to support the personal transaction feature of the recording.
①: Purchasers can publish purchase information.
②: Purchasers can query the sales information.
③: The seller can query the purchase information.
④: The seller can apply for a store and publish the sales information in the store. (We only charge a little service fee, you know)
3,Requirement Analysis
①: Reference cases
②: Where is truth?
In the previous article, we talked about finding use cases through the "somebody do something" method, that is, discovering the essence of a transaction through the way of the subject and the object, in order to prevent the interference of "fixed, state, complement" and other information on our understanding of the nature of the transaction, so as to clarify the true intention of the system!
However, the story of "face-to-face porridge" tells us that "listening is false, and seeing is not necessarily true !", Even facts can withstand scrutiny!
The "scrutiny" in the demand analysis is the in-depth analysis of the demand. Next, let's look at the impact of the Demand Analysis on the "Actor.
In "①: reference cases", we thought it could reflect user needs. However, after investigation, we found that some music farmers are very interested in some Blu-ray films in the island countries (normal channels cannot be purchased, often in the form of second-hand "Music") and at this time, "Music farmer" is no longer a seller and turned to become a buyer. That is, a person may be the buyer or the seller. If this is the case, it will be difficult for us to process "User Login.
After analysis, we may think that we do not actually need to subscribe to "buyers" or "sellers", but adopt a similar "permission" to control. The use case diagram is similar to the following:
Of course, some people have proposed a person-derived method for implementation, similar:
This is also a common method, but I personally do not recommend this method in this demand. It may be useful in the early stages of analysis, but with the in-depth analysis, we will find that "purchasers" and "sellers" will gradually fade out in the system, and they may not appear in the final program implementation. We also mentioned the alternative scheme of "permission control" just now. The most important thing is that "derivation and inheritance" implies "polymorphism ", however, there are some difficulties in implementing such "polymorphism" in this demand. We will continue to follow up here.
(This article is only for guidance, not necessarily the final correct answer .)
③: Be A Good discoverer
As a saying goes, what kind of requirements do I need. The quality of requirement analysis is directly related to the final fate of products. As a responsible demand analyst, we must think twice and break down. We are good at looking at and thinking the same requirements from different perspectives. Gain insight into your real intentions and discover the stories behind your needs!
For example, if there is a "small store" in demand, why "? Will there be "market" and "mall "?
④: There is no foresight, and there must be close worries!
Whether it is a project or a product, it is bound to face the problem of "no vision must have a close worry". This is also the importance of many companies to have certain industry knowledge requirements for demand analysts, I agree with this.
When you create a project, you may be reminded of some features that require your implementation at any time. Some strong project managers may reject them because they are not defined in the requirement specification, but in reality, it is often not so easy.
It is even worse when we make products. If we do not consider or design the products well, the future development of the products will be buried.
(Deep Mining of requirements/Digging out conceptsIn DDD, it is called metaphor/Making implicit concepts explicitI personally think it is necessary. Although "gold plating" is not recommended in the project management theory, in the early stages of development, "Multi-planning and good thinking" must be more advantageous than disadvantages. However, in the final decision-making process, we may have to make a balance and trade-offs based on the different objectives of the project and the factors of all parties, I am afraid that there is no strong requirement in the demand, but there is still room for design. This may be criticized as "over-design", but everything is a matter of degree. It also tests the capabilities of analysis and design personnel, because some things are predictable, this is also the vision of the integrated products .)
4,Output
After all these measures are done properly, another important milestone will be completed soon. That is, the software system requirement analysis specification is output. In the next lecture, we will provide a typical format of the Specification.