shopping
2015-11-13 13:44:04 0 举报
shopping
作者其他创作
大纲/内容
list
Fruit
+ accept(Visitor visitor) :void+ operation1() :void
PayMethod
+ pay() :void
CashPay
+ pay() :void //现金支付处理代码
商品种类繁杂,每种商品都有不同的型号或颜色:享元模式,以Book类举例查看商品、对商品操作;顾客和卖家两种角色:访问者模式多种支付方式:支付宝、银行卡、现金(货到付款):简单工厂模式用手机软件如U盾处理网银付款:中介者模式订单提交后需要审核订单,经淘宝网审核后,卖家审核是否发货:职责链模式送货到家后,顾客买了水果盘,想吃遍盘中水果
CardPay
+ pay() :void //银行卡支付处理代码
ObjectStructure
Pear
+eat() :void
UnsharedConcreteBook
- allState
+ operation( extrinsicState)
Taobao
+ handleRequest() :
Saler
+ visitConsumer(Consumer consumer) :void+ visitSaler(Saler saler) :void
Client
Plate
- list:ArrayList
+eat() :void+addElement(FruitElement element) :void+ removeElement(FruitElement element) :void
Mediator
Book
- books :HashMap
+ accept(Visitor visitor) :void+ operation2() :void+ getBook(String key) :Books
ConcreteBook
- intrinsicState
FruitElement{abstract}
Orange
PayMethodFactory
+ static getPayMethod() : PayMethod
AliPay
+ pay() :void //支付宝支付处理代码
successor
Visitor
Apple
Handler
- successor :Handler
Books
Consumer
Clothes
+ accept(Visitor visitor) :void+ operation3() :void
Goods
+ accept(Visitor visitor) :void
UDun
0 条评论
下一页