Contents

1.1 描述用户需求

软件设计首先要了解用户的需求,比如用户需要支持支付宝支付、需要制作微信小程序端等。但是客户不是专家,不会讲出所有需求,不会告知所有细节。比如在微信小程序上无法使用支付宝支付,可能需要通过生成支付宝二维码的方式让用户完成支付。

Conceptual Design And Technical Design

先完成概念设计,再进行技术设计。

Conceptual Design. We try to recognize appropriate components, connections and responsibilities.

Technical Design. We move to making a technical design, we try to add a detail how those components, connections and responsibilities can be implemented.

Requirement

As a learner, I want to search for relevant courses through a search page.

User Story的格式

User Story, a technique of expressing a requirement. User Stories 通常 是站在用户的角度表述的。格式通常为

As a ____, I want to ____ so that ____.

作为xxx, 我想要xxx以便xxxx。

第一部分要写用户的身份,不同的身份代表了不同的立场,也代表了看待问题不同的视角。第二部分描写用户想要实现的需求,想要达到的目标。第三部分描述这个需求的原因。

在敏捷开发Scrum中,良好的User Stories是项目成功的关键。

Example

Imagine that you introduce the user story technique to your customer, and they give you the following sentence:

As an online shopper, I want to add an item to my shopping cart, so that I can purchase it.

Usually, the nouns correspond to objects in your software. So in this example, you have identified three objects: first, the user role is associated with an object in the software (the online shopper). An item could be any product at the store, while a shopping cart is an object for tracking items for purchase.

Let’s have another look at the sentence:

As an online shopper, I want to add an item to my shopping cart, so that I can purchase it.

Verbs can help you identify the requirements that your objects might have. In this example, add and purchase might be responsibilities of the shopping cart. Verbs may also help you identify connections between objects.

The last point is a bit more subtle: a user story can also help you discover connections between objects. In this example, it is probably fairly obvious. One online shopper is typically associated with one shopping cart. The shopping cart should be capable of holding multiple items.

通过User Story我们可以获得很多信息,我们可以识别到3个对象,线上购物者、物品

、购物车。然后我们可以知道这些对象之间的关系,购物者把物品加到购物车里

CRC Card: Class, Responsbility, Collaborator

CRC cards help you to organize your components into classes, identify the responsibilities and determine how they will collaborate with each other.

CRC卡片可以帮助我们讲物理时间的组件转换为代码中的类(Class)

  • 在 “Collaborator “部分,您可以列出当前组件为履行职责而连接或交互的其他组件