UML Lab9

NameZhuoran Wang
MU ID19105339
FZU ID831902126

Live-streaming sale, through some Internet platforms, is a new way of service using live-streaming technology for close commodity display, consultation response, and shopping guide. Merchants can open their own live broadcast room, or employ professional anchors to recommend goods. At present, not only many celebrities flock into this field, but some big companies’ executives are also frequently involved. Please try to design a comprehensive live-streaming sale system.
网络直播销售是一种利用网络直播技术进行商品近距离展示、咨询应答、导购的新型服务方式。商家可以开设自己的直播室,或者聘请专业主播推荐商品。目前,不仅有很多名人进入这一领域,一些大公司的高管也频繁介入。请尝试设计一个全面的直播销售系统。

Also, it is worth mentioning that in this lab, personally, I will use a professional UML tool, namely Visual Paradigm.
在这里插入图片描述

1. List actors

(i) List some actors that interact with this system. Explain the relevance of each actor.

  1. User用户, a person who uses the system, including Merchant, Anchor, Buyer, and other watchers
  2. Merchant 商家, the person who sales the commodity
  3. Anchor 主播, the person who conducts the live-streaming sale
  4. Administrator 管理员, including the recommend system, the person who responsible for delete some illegal video.
  5. Customer 购买者, a person who buys the commodity

2. Use case diagram用例图

(ii) Prepare a use case diagram for this system.
在这里插入图片描述

3. A normal scenario for each use case.

(iii) Prepare a normal scenario for each use case. (i.e. describe each use case in words)

(1) Login and Logout 登录退出

用例名:Login and Logout 登录退出
简述:用于所有使用者登录退出系统
参与者:User, Customer, Merchant, Anchor
包含:无
扩展:无
继承:无
前置条件:用户正确输入用户名密码
细节:无
后置条件:无
限制:无
注释:无

(2) Create a live broadcast room创建直播间

用例名:Create a live broadcast room创建直播间
简述:商家和主播创建直播间
参与者:Merchant, Anchor
包含:无
扩展:无
继承:无
前置条件:商家和主播成功登录系统
细节:商家和主播可以创建直播间,商家可以在直播间里发布商品,由主播进行直播。
后置条件:无
限制:无
注释:无

(3) Watch video观看直播

用例名:Watch video观看直播
简述:用户和顾客观看直播
参与者:User, Customer
包含:无
扩展:无
继承:无
前置条件:商家和主播已经创建直播间,用户成功登录系统
细节:用户和顾客可以在直播间里观看直播
后置条件:无
限制:无
注释:无

(4) Make the payment付款

用例名:Make the payment付款
简述:顾客对喜欢的商品进行付款
参与者:Customer
包含:无
扩展:无
继承:无
前置条件:商家和主播已经创建直播间,用户成功登录系统
细节:顾客可以在直播间里观看直播,对喜欢的商品进行付款
后置条件:无
限制:无
注释:无

(5) Recommend video推荐视频

用例名:Recommend video推荐视频
简述:由管理员(推荐系统)进行视频推荐
参与者:Customer, User, Administrator
包含:无
扩展:无
继承:无
前置条件:商家和主播已经创建直播间,用户成功登录系统
细节:由管理员(推荐系统)推荐直播视频给用户
后置条件:无
限制:无
注释:无

(6) Refund and after-sale售后和退款

用例名:Refund and after-sale售后和退款
简述:由管理员处理顾客发出的售后和退款请求
参与者:Customer, Administrator
包含:无
扩展:无
继承:无
前置条件:商家和主播已经创建直播间,用户成功登录系统,用户已经进行付款
细节:由管理员处理顾客发出的售后和退款请求
后置条件:无
限制:无
注释:无

4. Sequence diagrams & Activity diagrams

(iv) Prepare sequence diagrams or activity diagrams for primary scenarios. By the way, each scenario can be described by a sequence diagram or an activity diagram, but both diagrams must be used in the question.
在这里插入图片描述
在这里插入图片描述

5. Class diagram

(v) Prepare a class diagram for this system. Explain which principles of object-oriented are applied in your design.
在这里插入图片描述
In this class diagram, I used Single Responsiblility principle(SRP).

6. State diagram

(vi) Prepare state diagrams for primary classes.

在这里插入图片描述

7. Skeleton code

(vii) Write the skeleton code corresponding to the class diagram in C++, Java, Python, or C#.

class User
{
private:
    /* data */
    string userInfo;
};

class Customer : User
{
private:
    string customerInfo;
};

class Merchant
{
private:
    string merchantInfo;
};

class Anchor : Merchant
{
private:
    string anchorInfo;

public:
    void createLiveRoom() {}
};

class LiveStreamingSystem
{
private:
    /* data */
    User user;
    Merchant merchant;

public:
    LoginLogout loginlogout;
    Player player;
    PaymentSystem paymentsystem;
    Administrator admin;
};

class LoginLogout
{
public:
    bool login() {}
    bool logout() {}
};

class Player
{
public:
    string playVideo() {}
};

class PaymentSystem
{
public:
    void makePayment(double money) {}
};

class Administrator
{
public:
    string recommendVideo() {}
};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值