面向对象设计建模面向对象设计

面向对象设计建模面向对象设计

ID:11583006

大小:2.34 MB

页数:147页

时间:2018-07-12

面向对象设计建模面向对象设计_第1页
面向对象设计建模面向对象设计_第2页
面向对象设计建模面向对象设计_第3页
面向对象设计建模面向对象设计_第4页
面向对象设计建模面向对象设计_第5页
资源描述:

《面向对象设计建模面向对象设计》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、第5章面向对象设计建模1内容面向对象的模型及回答的问题面向对象设计方法面向对象建模的几个原则软件体系结构简介面向对象的软件体系结构数据管理的设计人-机交互的设计任务管理的设计面向对象设计内容2分析阶段的模型要回答的问题用例、活动图对象(概念)模型顺序图等功能模型领域过程是什么领域中的概念和术语是什么系统事件和操作是什么系统操作做了什么设计阶段的模型要回答的问题协作图状态图设计类图对象间的通讯细节设计软件实现的类图5.1面向对象的模型及回答的问题3publicclassDialer{privateVectordigits;intnDigits;pub

2、licvoiddigit(int:n);protectedbooleanrecordDigit(intn);}类名属性/成员变量操作/成员函数图5-2设计的类图Dialer拨号器-digits:Vector-nDigits:int+digit(n:int)#recordDigit(n:int):booleanDialer拨号器digitsnDigits概念记号一个Dialer代表了一次拨号的事件,它有digits概念的内涵Dialer1Dialer2Dialer3Dialer4概念的外延概念应用的一组实例软件类,不是概念的一部分分析设计图5-1分析

3、的类图实体实体信息实体职责4图5-3类的实现顺序POSTendSale()enterItem()makePayment()SalesLineitemquantity:Integersubtotal()Saledate:DateisComplete:Booleantime:TimebecomeComplete()makeLineItem()makePayment()Total()address:Addressname:TextaddSale()StorePaymentamount:QuantityProductCatalogspecification

4、()ProductSpecificationdescription:Textprice:Quantityupc:UPC设计的结果--销售点终端系统面向实现的类图Houses11Uses11Looks-in111..*1ContainsCaptures1111..*Contains1Describes*11Paid-by*1Loge-completed112345675ClassPaymentpackagepost;publicclassPayment{privatefloatamount;publicpayment(floatcashTendere

5、d){this.amount=cashTendered;}publicfloatgetAmount(){returnamount;}}6ClassProductCatalogpackagepost;importjava.util.*;publicclassProductCatalog{privateHashtableproductSpecifications=newhashtable();publicproductCatalog(){ProductSpecificationps=newproductSpecification(100,1,〃prod

6、uct1〃);productSpecifications.put(newInteger(100),ps);ps=newproductSpecifications(200,1,,〃product2〃);productSpecifications.put(newInteger(200),ps);}publicProductSpecificationgetSpecification(intupc){return(ProductSpecification)productSpecifications.get(newInteger(upc));}}7Class

7、POSTpackagepost;importjava.util.*;classPOST{privateProductCatalogproductCatalog;privateSalesale;publicPOST(ProductCatalogcatalog){productCatalog=catalog;}publicvoidendSale(){sale.becomeComplete();}8publicvoidenterIntem(intupc,intquantity){if(isNewSale()){sale=newSale();}Produc

8、tSpecificationspec=productCatalog.specification(upc);sale.mak

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。