• <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        當前位置:雨林木風下載站 > 辦公軟件教程 > 詳細頁面

        如何使用visio畫UML序列圖

        如何使用visio畫UML序列圖

        更新時間:2024-02-12 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

        Office Visio 是Office軟件系列中的負責繪制流程圖和示意圖的軟件,是一款便于IT和商務(wù)人員就復(fù)雜信息、系統(tǒng)和流程進行可視化處理、分析和交流的軟件。使用 Office Visio 圖表,可以促進對系統(tǒng)和流程的了解。

        ?今天嘗試使用visio畫了一個序列圖。

        話不多說,先打開visio,新建一個UML序列。

        如何使用visio畫UML序列圖

        先新建幾個對象生命線

        如何使用visio畫UML序列圖

        加入幾個激活

        如何使用visio畫UML序列圖

        而后是消息,實線表示請求,虛線表示響應(yīng)。

        如何使用visio畫UML序列圖

        當然如果不影響理解,可以不用每個請求都配上一個響應(yīng)。

        此UML例子是在《UML精粹:標準對象建模語言簡明指南》中拿過來的,為了更好的理解這個UML,下面使用java來實現(xiàn)此UML。

        procuct

        packagecom.simon.uml.sequenceDiagram;

        /**

        *CreatedbyIntelliJIDEA.

        *

        *@author:Simon

        *@date:2019-05-09

        *@time:14:50

        *@description:產(chǎn)品

        */

        publicclassProduct{

        privateStringname;

        privatedoubleprice;

        publicStringgetName(){

        returnname;

        }

        publicvoidsetName(Stringname){

        this.name=name;

        }

        publicdoublegetPrice(){

        returnprice;

        }

        publicdoublegetPrice(intnumber){

        doubleorderLinePrice=price*number;

        System.out.println("productname:"+getName()

        +"\tprice:"+getPrice()

        +"\tnumber:"+number

        +"\torderlineprice:"+orderLinePrice

        );

        returnorderLinePrice;

        }

        publicvoidsetPrice(doubleprice){

        this.price=price;

        }

        }

        customer

        packagecom.simon.uml.sequenceDiagram;

        /**

        *CreatedbyIntelliJIDEA.

        *

        *@author:Simon

        *@date:2019-05-09

        *@time:14:51

        *@description:客戶

        */

        publicclassCustomer{

        privatedoublediscount;

        publicdoublegetDiscountedValue(Orderorder){

        returndiscount*order.getBaseValue();

        }

        publicdoublegetDiscount(){

        returndiscount;

        }

        publicvoidsetDiscount(doublediscount){

        this.discount=discount;

        }

        }

        order

        packagecom.simon.uml.sequenceDiagram;

        importjava.util.List;

        /**

        *CreatedbyIntelliJIDEA.

        *

        *@author:Simon

        *@date:2019-05-09

        *@time:14:50

        *@description:訂單

        */

        publicclassOrder{

        privatedoublebaseValue;

        privateCustomercustomer;

        privateListorderLineList;

        publicdoublecalculatePrice(){

        doublesumOrderLinePrice=0;

        for(OrderLineorderLine:orderLineList){

        doubleorderLinePrice=orderLine.calculatePrice();

        sumOrderLinePrice+=orderLinePrice;

        }

        this.setBaseValue(sumOrderLinePrice);

        System.out.println("orderbaseprice:"+sumOrderLinePrice);

        doublediscountedValue=getCustomer().getDiscountedValue(this);

        System.out.println("orderdiscountedprice:"+discountedValue);

        returndiscountedValue;

        }

        publicdoublegetBaseValue(){

        returnbaseValue;

        }

        publicvoidsetBaseValue(doublebaseValue){

        this.baseValue=baseValue;

        }

        publicListgetOrderLineList(){

        returnorderLineList;

        }

        publicvoidsetOrderLineList(ListorderLineList){

        this.orderLineList=orderLineList;

        }

        publicCustomergetCustomer(){

        returncustomer;

        }

        publicvoidsetCustomer(Customercustomer){

        this.customer=customer;

        }

        }

        orderline

        packagecom.simon.uml.sequenceDiagram;

        /**

        *CreatedbyIntelliJIDEA.

        *

        *@author:Simon

        *@date:2019-05-09

        *@time:14:50

        *@description:訂單明細

        */

        publicclassOrderLine{

        privateintnumber;

        privateProductproduct;

        publicOrderLine(intnumber,Productproduct){

        this.number=number;

        this.product=product;

        }

        publicdoublecalculatePrice(){

        returnproduct.getPrice(number);

        }

        publicintgetNumber(){

        returnnumber;

        }

        publicvoidsetNumber(intnumber){

        this.number=number;

        }

        publicProductgetProduct(){

        returnproduct;

        }

        publicvoidsetProduct(Productproduct){

        this.product=product;

        }

        }

        order的測試用例

        packagecom.simon.uml.sequenceDiagram;

        importorg.junit.Assert;

        importjava.util.ArrayList;

        importjava.util.List;

        /**

        *CreatedbyIntelliJIDEA.

        *

        *@author:Simon

        *@date:2019-05-09

        *@time:15:23

        *@description:

        */

        publicclassOrderTest{

        @org.junit.Test

        publicvoidcalculatePrice(){

        //這個商品是鞋子,123塊錢一雙

        ProductproductShoes=newProduct();

        productShoes.setName("shoes");

        productShoes.setPrice(123);

        //這個商品是襪子,8塊錢一雙

        ProductproductSocket=newProduct();

        productSocket.setName("socket");

        productSocket.setPrice(8);

        //這是一個老客戶,打七折

        Customercustomer=newCustomer();

        customer.setDiscount(0.7);

        //這個客戶下了一個單

        Orderorder=newOrder();

        order.setCustomer(customer);

        //買了一雙鞋子,兩雙襪子

        OrderLineorderLineShoes=newOrderLine(1,productShoes);

        OrderLineorderLineSocket=newOrderLine(2,productSocket);

        ListorderLineList=newArrayList();

        orderLineList.add(orderLineShoes);

        orderLineList.add(orderLineSocket);

        order.setOrderLineList(orderLineList);

        //算一算總共多少錢

        doublepriceActual=order.calculatePrice();

        Assert.assertEquals("97.3",String.valueOf(priceActual));

        }

        }

        測試用例的輸出

        productname:shoesprice:123.0number:1orderlineprice:123.0

        productname:socketprice:8.0number:2orderlineprice:16.0

        orderbaseprice:139.0

        orderdiscountedprice:97.3


        Visio幫助您創(chuàng)建具有專業(yè)外觀的圖表,以便理解、記錄和分析信息、數(shù)據(jù)、系統(tǒng)和過程。

        溫馨提示:喜歡本站的話,請收藏一下本站!

        本類教程下載

        系統(tǒng)下載排行

        主站蜘蛛池模板: 亚洲一区免费在线观看| 亚洲精品人成电影网| 国产免费观看黄AV片| 四虎影视永久免费观看地址| 亚洲AV日韩综合一区尤物| 久久久久se色偷偷亚洲精品av| 精品亚洲视频在线| 福利免费在线观看| 0588影视手机免费看片| 亚洲成人免费网址| 免费毛片在线看不用播放器| 久久天天躁狠狠躁夜夜免费观看 | 亚洲人成网站色在线观看| 国产精品免费精品自在线观看| 亚洲精品无码久久久久AV麻豆| 亚洲AV人无码综合在线观看| 亚洲精品无码久久久久秋霞| 91免费国产视频| 亚洲国产成人久久综合碰| 中文字幕在线观看亚洲日韩| 午夜电影免费观看| 亚洲特级aaaaaa毛片| 成人免费午夜在线观看| 久久精品国产亚洲av高清漫画| 曰批全过程免费视频免费看| 国产精品久久久久免费a∨| 亚洲色最新高清av网站| 97性无码区免费| MM1313亚洲精品无码久久| 中文字幕专区在线亚洲| 日韩国产欧美亚洲v片| 很黄很色很刺激的视频免费| 亚洲高清视频在线播放| 成人性生交大片免费看中文| 亚洲人成伊人成综合网久久| 免费观看无遮挡www的小视频| 亚洲国产精品成人午夜在线观看| 思思99re66在线精品免费观看| 国产av无码专区亚洲av毛片搜| 在线a级毛片免费视频| 日本中文字幕免费看|