This is the fifth article in the daily follow-up series of agile development. (Topic directory)
User stories have nothing to do with MVC, because MVC is the implementation method, so when thinking about user stories, don't think about the implementation method, it is easy to write the story badly.
But MVC has a lot to do with user stories. If the user stories are well written, remember to refer to the user stories when doing MVC.
I used MVC in the C ++ era, but MVC was just a programming idea at that time. I can also use it, and I can do it if it is useless. But after C #, something that claimed to be MVC appeared on the card (the latest version is mvc3), and I am also using it. The Java World also has the concept of MVC, but I have never seen it,MVC described below. Unless otherwise stated, it refers to Asp.net MVCBut I believe it is also of reference significance for MVC in Java.
Use MVC to implement user stories
If you have already recognized the method for generating user stories in section 6, you will get such a user story tree, and the Controller-action tailored for it on the right (from the actual project ):
|
============================================== |
The corresponding controller-Actions
Userscontroller
-- Users/Index
---- Nothing
--/Users/details
--/Users/user2authorities
--/Users/users2roles
--/Users/freeze
--/Users/edit
--/Users/delete
--/Users/batchcreate
Rolescontroller
-- Roles/edit
-- Roles/details
-- Roles/delete
-- Roles/Index
Authoritescontroller
-- Authorities/URA
-- Authorities/delete
-- Nothing
-- Authorities/Index
---- Nothing
--/Authorities/authorities2roles
--/Authorities/urga
========================================================== ===== |
Note that each controller implements an epic story (the data to be managed), and each action implements one (by chance multiple) User story (the user's business operations ), there are several notes:
1. A controller can almost implement an epic story
2. Because an action is exactly a verb, it almost corresponds to a user story.
There are two violations, for example, "role homepage (New + view)" and "permission homepage (New + view )", in order to facilitate the creation of a new textbox in the two indexes, it is convenient to directly create the textbox (because the role and permissions have only one name, it is difficult to create an independent page ).
To keep this in mind, we add (xx + XX) to the abbreviated name of the story, In order to automatically count the story in the future.
3. the user does not have a "CREATE" story or users/create, because the user has only two normal creation methods: Register and batchcreate. We chose the latter. Therefore, there is neither the "create user" story nor the "/users/create" action.
4. Several green arrows are "enhanced" stories (see section 5), and they do not match the action either.
What we mentioned above is a practical usage, which is not necessarily universal.,But it is very suitable for our project, or even "extremely comfortable ".
This occasional coincidence between the epic-story and the Controller-action actually has its inevitability.
Use MVC to implement user stories
The focus of MVC research in the past is what is m, what is V, what is C, and the relationship between the three.
After a while, we found that each of them has a deeper idea. Here we talk about controller and its actions.
When the MVC three stay together, ask: What is controller? It is quite easy to answer.
If you do not mention music videos, you can directly ask: What is a controller? What is an action? But it is very difficult to answer.
If you go to a non-MVC website or software, the most annoying thing is that each page of the website may not have its own link. For example, after a long stroll, the top link is always http: // xxx... /login = XXXX. You cannot add a favorites folder to a page. MVC solves this problem to a large extent:The data to be operated is the controller, the action to be performed, and the parameter is the specific operation, Such as/users/details? User = cheny or common on csdn blogs: http://blog.csdn.net/cheny_com/article/details/6616794 styles.
Therefore, if the epic-story structure is organized according to the data-operation method mentioned in section 6 and MVC is used, it is highly recommended to map it to controller-action during programming..
Readers may have noticed that some of the stories in this article have a link symbol, which is exactly behind the golden story we have already implemented, added its hyperlink (all are/controller/action, one-to-one correspondence, very comfortable ).This is equivalent to a well-written action, and a story (by chance multiple) will be finished. The tester can click the link to go to the action test. After testing the action, he can say that the story has been tested (not just the action has been tested ).
In this way, product managers and developers can easily communicate with each other to correspond to user stories and development content.Therefore, it is highly recommended.
User stories vs. FPA Function Points Analysis vs. MVC
Function Points Analysis (FPA), agile development user stories, and Asp.net MVC share the same purpose to some extent: as a bridge between user needs and developers' work, the focus is different. Therefore, if they can be applied together, it is possible to use an organizational approach to consistently manage estimation, demand management, and architecture design.
The relationship between the three is described as follows:
| |
User stories |
FPA |
MVC |
| Data |
Epic stories |
Ilf internal logic File
EIF external interface file |
Controller |
| Operation |
Normal story (function) |
EI external input
EO external output
EQ external Query |
Action |
Click to download the free agile development textbook: Martian agile development manual