如何区分需求/功能与业务逻辑?

问题描述 投票:0回答:1

我正在记录一个项目,我发现自己想知道这是一个需求、功能还是业务逻辑,毕竟它是一个聊天系统,如果这不是业务逻辑,我将无法说出它是什么。 这就是我认为的 bl:

我们将从用户“A”连接到与用户 B 的聊天并且“A”发送消息的事实开始进行描述。需要考虑的案例:

User B is also connected. Any exchanged message should be displayed in real-time for both.
Afterwards, it should be saved in the database so that the chat has a history (marked as read).
The list of chats mentioned above should be reordered.

User B is within the app but not connected to the chat with user A.
The message should be saved in the database (marked as unread).
User B should be notified and shown that there are new unread messages in the chat (notification or display within the app).
The aforementioned list of chats should be updated for reordering.

User B is completely disconnected.
The message will be saved in the database (as unread).
A push notification will be sent to user B.
architecture system-design business-logic business-logic-layer system-requirements
1个回答
0
投票

需求:我作为用户希望能够完成X 功能:提供功能 Y(为了满足 X) 业务逻辑:软件实现逻辑Z(为了满足Y)

需求是用户的目标是什么,他们必须满足什么需求,这就是为什么。功能是系统的功能。业务逻辑就是系统如何做到这一点。

在您的示例中,需求是用户 A 可以向用户 B 传递消息。该需求没有讨论如何、数据库或接口,只是用户 A 向用户 B 传递消息的目标。

功能包括:

  • 双方在线时消息实时传递。
  • 当用户B与用户A不同时在线时离线发送消息
  • 等等

业务逻辑包括:

  • 用户 B 在应用程序内,但未连接到与用户 A 的聊天。 该消息应保存在数据库中(标记为未读)
  • 应更新聊天列表以便重新排序。
  • 等等
© www.soinside.com 2019 - 2024. All rights reserved.