Do you use design patterns?
http://stackoverflow.com/questions/11586/do-you-use-design-patterns引用
Any large program that is well written will use design patterns, even if they aren't named or recognized as such. That's what design patterns are, designs that repeatedly and naturally occur. If you're interfacing with an ugly API, you'll likely find yourself implementing a Facade to clean it up. If you've got messaging between components that you need to decouple, you may find yourself using Observer. If you've got several interchangeable algorithms, you might end up using Strategy.
It's worth knowing the design patterns because you're more likely to recognize them and then converge on a clean solution more quickly. However, even if you don't know them at all, you'll end up creating them eventually (if you are a decent programmer).
And of course, if you are using a modern language, you'll probably be forced to use them for some things, because they're baked into the standard libraries.
通过Java例子代码学习设计模式:
https://thenewcircle.com/bookshelf/java_fundamentals_tutorial/design_patterns.html
http://www.avajava.com/tutorials/categories/design-patterns
设计模式最佳例子之JAVA API:
Examples of GoF Design Patterns [closed]:
http://stackoverflow.com/questions/1673841/examples-of-gof-design-patterns
Design Patterns in the JDK:
http://www.briandupreez.net/2010/11/design-patterns-in-jdk.html
Structural比较 之:装饰 组合
Behavioral比较 之:策略 状态 命令
http://www.cnblogs.com/Mainz/archive/2007/12/15/996081.html
http://www.vincehuston.org/dp/
http://www.jdon.com/designpatterns/index.htm
Iterator:
http://www.journaldev.com/1716/iterator-design-pattern-in-java-example-tutorial
http://www.scribd.com/doc/16738161/Java-Design-Patterns-With-Examples#outer_page_46
设计模式笔记
http://www.riabook.cn/doc/designpattern/
设计模式之禅,写的不错哈:
http://cbf4life.iteye.com/
http://www.cnblogs.com/cbf4life/tag/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/
23设计模式
http://www.cnblogs.com/singlepine/category/59538.html
Lazy loading 懒加载 模式的设计与实现:
http://jtechies.blogspot.com/2012/07/item-71-use-lazy-initialization.html
http://stackoverflow.com/questions/3578604/how-to-solve-the-double-checked-locking-is-broken-declaration-in-java
http://timezra.blogspot.com/2008/04/threadsafe-lazy-instantiation-without.html
http://books.google.com/books?id=Jl5rkQnbfAIC&pg=PA202&lpg=PA202&dq=java+lazy+load+list+object&source=bl&ots=guy4dQmaJU&sig=TjbgDB3Y4hds8--zh563hcavqGI&hl=en&sa=X&ei=6FZ1Uq70GcqErAfzpIDACA&ved=0CJcEEOgBMDc#v=onepage&q=java%20lazy%20load%20list%20object&f=false
http://twit88.com/blog/2008/01/22/design-pattern-in-java-101-lazy-load-part-i/
http://www.javabeat.net/2012/07/lazy-initialisation-singleton-and-double-check-locking/
filter 模式的设计与实现:
http://stackoverflow.com/questions/18062023/interface-method-that-has-different-parameters-in-java
http://erikras.com/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/
非常好的一篇关于责任链模式的文章:
http://www.cnblogs.com/java-my-life/archive/2012/05/28/2516865.html
Builder Pattern(建造者模式/生成器模式):
极好的Builder范例:http://blog.crisp.se/2013/10/09/perlundholm/another-builder-pattern-for-java
Builder 和 继承:引用
[url]http://www.javacodegeeks.com/2012/07/builder-design-pattern-in-java.html
http://www.drdobbs.com/jvm/creating-and-destroying-java-objects-par/208403883?pgno=2
eclipse中生成 Builder,代码,见:
http://wuaner.iteye.com/blog/444391
关于State Pattern一篇好E文:
http://www.informit.com/guides/content.aspx?g=java&seqNum=576
Bridge pattern:
hhttp://javapapers.com/design-patterns/bridge-design-pattern/
http://www.oodesign.com/bridge-pattern.html
用 Decorator 设计邮件发送程序的一个例子:
http://www.developer.com/tech/article.php/3689436/Working-with-Design-Pattern-Decorator.htm
Simple Factory vs. Factory Method vs. Abstract Factory:
http://corey.quickshiftconsulting.com/1/post/2009/5/first-post.html
There are three kinds of design patterns:
Creational patterns:
They are related with how objects and classes are created. While class-creation patterns use inheritance effectively in the instantiation process,while object-creation patterns use delegation to get the job done.
* Abstract Factory groups object factories that have a common theme.
* Builder constructs complex objects by separating construction and representation.
* Factory Method creates objects without specifying the exact object to create.
* Prototype creates objects by cloning an existing object.
* Singleton restricts object creation for a class to only one instance.
Structural patterns:
They are related to class and object composition.This pattern uses inheritance to define new interfaces in order to compose new objects and hence new functionalities.
* Adapter allows classes with incompatible interfaces to work together by wrapping its own interface around that of an already existing class.
* Bridge decouples an abstraction from its implementation so that the two can vary independently.
* Composite composes one-or-more similar objects so that they can be manipulated as one object.
* Decorator dynamically adds/overrides behavior in an existing method of an object.
* Facade provides a simplified interface to a large body of code.
* Flyweight reduces the cost of creating and manipulating a large number of similar objects.
* Proxy provides a placeholder for another object to control access, reduce cost, and reduce complexity.
Behavioral patterns:
These design patterns deal with objects communication. They are specifically concerned with communication between objects.
* Chain of responsibility delegates commands to a chain of processing objects.
* Command creates objects which encapsulate actions and parameters.
* Interpreter implements a specialized language.
* Iterator accesses the elements of an object sequentially without exposing its underlying representation.
* Mediator allows loose coupling between classes by being the only class that has detailed knowledge of their methods.
* Memento provides the ability to restore an object to its previous state (undo).
* Observer is a publish/subscribe pattern which allows a number of observer objects to see an event.
* State allows an object to alter its behavior when its internal state changes.
* Strategy allows one of a family of algorithms to be selected on-the-fly at runtime.
* Template method defines the skeleton of an algorithm as an abstract class, allowing its subclasses to provide concrete behavior.
- 大小: 64.6 KB
分享到:
相关推荐
DesignPattern 设计模式,共10章。内容详细,案例设计齐全。对设计可复用的面向对象的软件很有帮助,有助你写出又质量,并且可重复使用的高品质软件
本书已经成为面向对象技术人员的圣经和词典,书中定义的23个模式逐渐成为开发界技术交流所必备的基础知识和语汇。
golang design pattern go 设计模式实现,包含 23 -go-design-pattern
DesignPattern(设计模式迷你手册)
C++ 23种设计模式(全_解释+源代码).zip 23种设计模式都是基于以下原则,务必记牢 依赖倒转原则 里氏代换原则 开闭原则 接口隔离原则 合成聚合复用原则 迪米特法则 23种设计模式如下:
DesignPattern_BasicKnowledge设计模式之类关系:设计模式 类关系 基础 依赖 关联
C语言设计模式 PDF《C Design Pattern》C语言设计模式 PDF《C Design Pattern》C语言设计模式 PDF《C Design Pattern》C语言设计模式 PDF《C Design Pattern》
chain 设计模式 DesignPattern 供应链模式
Mobile Design Pattern Gallery : UI Patterns for Mobile Applications原版 全彩 120M大容量《移动应用ui设计模式》是一本移动应用ui 设计模式参考书,分10 大类介绍了70 个移动应用设计模式(包括反模式),用400 ...
GoF的经典著作设计模式(Design Pattern)
golang design pattern; 设计模式golang版本-go-design-patterns
36种最新设计模式整理 Design Pattern: Simple Factory 模式 Design Pattern: Abstract Factory 模式 Design Pattern: Builder 模式 Design Pattern: Factory Method 模式 Design Pattern: Prototype 模式 ...
深入浅出设计模式 (Head First Design Pattern)_带书签 深入浅出设计模式 (Head First Design Pattern)_带书签
<br>关于这份讲义 做为一名同济大学的学生,有幸听到了侯捷先生的《设计模式》授课。如很多朋友所说,侯sir的技术未必是最好的。但是,能像侯sir一样,将晦涩难懂的东西用浅显易懂的方式说出来,却不是一般人...
23种设计模式(Design Pattern)的C++实现范例,包括下面列出的各种模式,代码包含较详细注释。另外附上“设计模式迷你手册.chm”供参考。 注:项目在 VS2008 下使用。 创建型: 抽象工厂模式(Abstract Factory) 生成...
DesignPattern设计模式迷你手册CHM
每种设计模式都有相应的UML图,有相应的代码实现,深刻的学习底层的一些机制。 希望更加深入了解学习的可以深入设计模式的文献,推荐《Java 设计模式》 GITHUB:git@github.com:akumalzw/design-pattern.git
四巨头设计模式,不用多介绍了吧,清晰中文版