設計模式-裝飾者模式

1.UML類圖 Component是定義一個對象接口,可以給這些對象動態地添加職責。ConcreteComponent是定義一個具體對象,也可以給這個對象添加一些職責。Decorator,裝飾抽象類,繼承了Component,從外類來擴展Component類的功能,但對於Component來說,是無需知道Decorator的存在的。ConcreteDecorator就是具體的裝飾對象,起到給Com
相關文章
相關標籤/搜索