`

Java设计模式

 
阅读更多
1. Singleton 单例模式

http://www.blogjava.net/kenzhh/archive/2013/03/15/357824.html

public class Singleton { 
      private static Singleton instance; 
      private Singleton (){}
      public static synchronized Singleton getInstance() { 
      if (instance == null) { 
          instance = new Singleton(); 
      } 
      return instance; 
      } 



2. Multiton 多例模式


3. Simple Factory 简单工厂模式

4. Factory Method 工厂方法模式

5. Abstract Factory 抽象工厂模式

6. Builder 建造模式


7. Prototype 原始模型模式

8. Adapter 适配器模式

9. Composite 合成模式

10. Decorator 装饰模式

11. Proxy 代理模式

12. Flyweight Pattern 享元模式

13. Facade 门面模式

14. Bridge 桥梁模式

15. Immutable 不变模式

16. Strategy 策略模式

17. Template Method 模板方法模式

18. Observer 观察者模式

XMPP例子:http://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions/index.html


19. MVC MVC模式

20. Iterator 迭代模式

21. Chain of Responsibility 责任链模式

22. Command 命令模式

23. Memento 备忘录模式

24. State 状态模式

25. Visitor 访问者模式

26. Interpreter 解释器模式

27. Mediator 调停者模式


28. publish-subscribe 发布订阅模式

类似应用,比如XMPP。 例子:http://www.igniterealtime.org/builds/smack/docs/latest/documentation/extensions/index.html

jenkins: https://wiki.jenkins-ci.org/display/JENKINS/El+Oyente+Plugin


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics