![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Design Pattern
文章平均质量分 59
_noname
Ideas worth spreading.
展开
-
Design Pattern_Java:Builder Pattern
Design Pattern:Builder Pattern建造者模式 Builder PatternSeparate the construction of a complex object from its representation so that the same construction process can create different representations.将一个复杂原创 2015-08-24 20:28:28 · 710 阅读 · 0 评论 -
DesignPattern_Java:设计模式分类和设计原则
设计模式分类:创建型:单例模式(Singleton Pattern)工厂方法模式(Factory Pattern)抽象工厂模式(Abstract Factory)建造者模式(Builder Pattern)原型模式(Prototype Pattern)结构型:代理模式(Proxy)装饰模式(Decorator)适配器模式(Adapter)组合模式(Com原创 2015-08-20 00:20:07 · 1616 阅读 · 0 评论 -
DesignPattern_Java:SingletonPattern
单例模式 SingletonPatternEnsure a class has only one instance,and provide a global point of access to it.单例模式的主要作用是确保一个类只有一个实例存在。懒汉式单例类:第一次引用类时,才进行对象实例化。package com.DesignPattern.Creational.Sing原创 2015-08-20 21:28:25 · 808 阅读 · 0 评论 -
DesignPattern_Java:Adapter Pattern
适配器模式 Adapter Pattern 变压器模式Convert the interface of a class into another interface clients expect.Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.将一个类的接口变换原创 2015-08-29 15:56:45 · 2195 阅读 · 0 评论 -
DesignPattern_Java:Bridge Pattern
桥梁模式 Bridge Pattern 桥接模式Decouple an abstraction from its implementation so that the two can vary independently.将抽象和实现解耦,使得两者可以独立地变化。抽象化角色(Abstraction):该角色抽象化的给出定义,并保存一个对实现化对象的引用。package com.DesignPatte原创 2015-09-01 19:59:35 · 568 阅读 · 0 评论 -
DesignPattern_Java:Composite Pattern
组合模式 Composite Pattern 合成模式compose objects into tree structures to represent part-whole hierarchies.Composite lets clients treat individual objects and compositions of objects uniformly.将对象组合成树形结构以表示“部原创 2015-08-31 22:05:49 · 1003 阅读 · 0 评论 -
DesignPattern_Java:Decorator Pattern
装饰模式 Decorator PatternAttach additional responsibilities to an object dynamically keeping the same interface.Decorators provide a flexible alternative to subclassing for extending functionality.动态地给一个对原创 2015-08-27 21:33:18 · 850 阅读 · 0 评论 -
DesignPattern_Java:Proxy Pattern
代理模式 Proxy Pattern 委托模式Provide a surrogate or placeholder for another object to control access to it.为其他对象提供一种代理以控制对这个对象的访问。抽象主题角色(Subject):该角色是真实主题和代理主题的共同接口,以便在任何可以使用真实主题的地方都可以使用代理主题。package com.Desi原创 2015-08-26 23:17:45 · 998 阅读 · 0 评论 -
DesignPattern_Java:Abstract Factory Pattern
抽象工厂模式 Abstract Factory PatternProvide an interface for creating families of related or dependent objects without specifying their concrete classes.为创建一组相关或相互依赖的对象提供一个接口,而且无须指定他们的具体类。抽象工厂角色(Abst原创 2015-08-23 22:46:42 · 842 阅读 · 0 评论 -
DesignPattern_Java:Prototype Pattern
原型模式 Prototype PatternSpecify the kinds of objects to create using a prototypical instance,and create new objects by copying this prototype.用原型实例指定创建对象的种类,并且通过复制这些原型创建新的对象。Java内置克隆机制:实现Cloneable接口覆盖Obj原创 2015-08-25 22:26:23 · 1053 阅读 · 0 评论 -
DesignPattern_Java:Factory Method Pattern
工厂方法模式 Factory Method :(虚拟构造函数模式 Virtual Constructor,多态性工厂模式 Ploymorphic Facoty)Define an interface for creating an object,but let subclasses decide which class to instantiate.Factory Method lets a原创 2015-08-21 21:28:19 · 813 阅读 · 0 评论