![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
gof23
拉格朗日爱吃咸鱼
这个作者很懒,什么都没留下…
展开
-
装饰模式
装饰模式: 不改变原有对象功能的基础之上进行扩展, 1.面向抽象component 2.实体组件 concretComponent 3.Decrator: 一般实现为一个抽象类 4.具体装饰concreateDecrator 以log日志文件格式改变为例。将log日志文件的格式以json格式输出、 public class DecoratorLogger implements Logger { public Logger logger; public DecoratorLogger(Log原创 2020-12-26 14:53:28 · 92 阅读 · 0 评论 -
门面模式
门面模式 提供统一的接口,去访问子系统的接口。 外观角色:统一接口faceade 子系统角色:subsystem 积分商城为例: public class GiftFaceade { private QualifyService qualifyService = new QualifyService(); private PaymentService paymentService = new PaymentService(); private DeliveryService del原创 2020-12-26 12:03:36 · 114 阅读 · 0 评论