183
社区成员
发帖
与我相关
我的任务
分享| The Link Your Class | https://bbs.csdn.net/forums/MUEE308FZ |
|---|---|
| The Link of Requirement of This Assignment | https://bbs.csdn.net/topics/603389875 |
| The Aim of This Assignment | Improve the understanding of UML |
| MU STU ID and FZU STU ID | 19104529_831901217 |
Requirement
1. Please issue your Lab Blog on CSDN.
2. The Link of your blog of this lab and This Lab Sheet (This word file) must be submitted to Moodle, or you will lose the score of this Lab. (VERY IMPORTANT: You should submit TWO things)
3. Modeling must use professional tools.
4. You should EXPLAIN your diagrams in words if necessary.
UML is a standard language for describing, visualizing and documenting the products of object-oriented system. It is a non patented third-generation modeling and specification language. UML is a modeling tool for object-oriented design, which is independent of any specific programming language.
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.
|
(i) List some actors that interact with this system. Explain the relevance of each actor. |
|
Your Answer: For life streaming sale system two main actor must be contained: customer and streamer (or seller). Streamer the person who sell goods through livestreaming in the system; Customer: the person who buying goods through the system which broadcast by streamer. the system administrator the platform who maintain the website, manage the website and provide website traffic. |
|
(ii) Prepare a use case diagram for this system. |
|
Your Answer:
Customer: has the jurisdiction of login, subscribe for streamers, send barrage, paying for goods, and get refund or after-sale service.
Streamer: Has the jurisdiction of login, create a live room, provide product, refund and after services.
System administrator: Has the jurisdiction of enter the system background; ban & delete users, upgrade systems
|
|
(iii) Prepare a normal scenario for each use case. (i.e. describe each use case in words) |
|
Your Answer: System administrator create the website and drain for website, then the weighted situation is divided for the anchor of the website. The streamer launched a live room and broadcasts live: The platform distributes traffic to attract customers; The anchor publicizes the goods agreed with the merchant: The platform keeps the consumption records of customer. The customer need after-sales service: The platform connects customer with the Customer service of anchor team.
|
|
(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. |
|
Your Answer: Sequence diagrams for payment scenarios.
Activity diagrams for shopping chart scenarios
|
|
(v) Prepare a class diagram for this system. Explain which principles of object-oriented are applied in your design. |
|
Your Answer:
In this class diagram, Synthetic Reuse, Interface isolation Principle & Dependence Inversion Principle |
|
(vi) Prepare state diagrams for primary classes. |
|
Your Answer:
|
(vii) Write the skeleton code corresponding to the class diagram in C++, Java, Python, or C#.
Your Answer:
public class User {
public String userName;
protected String password;
private String account;
public void register() {
register register=new resgiter
}
public void login() {
login login=new login
}
public void search() {
search search=new search
}
public void Ordermaintenance() () {
Ordermaintenance Ordermaintenance =new Ordermaintenance
}
}
//子类
public class costumer extends User{
private String address;
public void chart() {
chart chart =new chart
}
public void payment() {
payment payment=new payment
}
public void returngoods() {
returngoods returngoods=new returngoods
}
public void subscribe() {
subscribe subscribe=new subscribe
}
public void subscribe.like() {
like like=new like
}
}
public class costumer extends User{
public void room() {
room room =new room
}
private void merchanControl() {
merchanControl merchanControl=new merchanControl
}
public void salesreturn() {
salesreturn salesreturn =new salesreturn
}
}
public class order {
public int orderNumber;
public String merchanNews;
public int merchandise.goodsnumber;
public String consignee;
public int orderTime
public int orderAmount;
public String orderStatus;
public String PaymentHistory
}
public class merchandise {
public int goodsNumber;
public String description;
public float price;
public png MerchanPic;
public int salesVolume
}
public class subscribe {
public anchor anchor;
public void like() {
…
}
}
public class room{
public int roomNum;
public int roomTraffic;
private void highlight() {
…
}
public void barrage() {
…
}
public void like() {
subscribe like=new like
}
}
public class salesreuturn {
public int order.orderNumber;
public void salesreturn() {
…
}
}
public class chart {
public int order.goodsNumber;
public int quantity;
public void add() {
…
}
public void query() {
…
}
public void delete() {
…
}
}
public class search {
public String keywords;
public String wordsType;
public merchandise merchandise
public void search() {
…
}
}
public class merchanControl {
public String User.username;
public merchandise merchandise
public void newStock () {
…
}
public void merchanEdit () {
…
}
public void merchanDelete () {
…
}
}
public class paymentl {
public int order.orderNumber;
private float paymentamount
public void payment() {
…
}
}
public class returns{
public String User.username;
public merchandise merchandise
public void newStock () {
…
}
public void merchanEdit () {
…
}
public void merchanDelete () {
…
}
}
public class ordermaintance{
public int order.orderNumber;
public order order
public void orderInquiry () {
…
}
public void orderdelete () {
…
}
}
public class register{
public String User.username;
public String User.password
public int ID
private void register () {
…
}
}
public class login{
public String User.username;
public String User.password
private void login () {
…
}
}