
Head First Design Patterns
文章平均质量分 74
Geurney
这个作者很懒,什么都没留下…
展开
-
Model-View-Controller MVC模式
A compound pattern combines two or more patterns into a solution that solves a recurring or general problem.View根据用户的操作调用对应的Controller的方法。Controller从Model获得当前状态的信息,并修改Model的状态。Model状态修改后通知View,V原创 2015-07-08 11:02:54 · 758 阅读 · 0 评论 -
Composite Pattern 组合模式
Composite Pattern: allows you to compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.This原创 2015-07-07 11:17:43 · 498 阅读 · 0 评论 -
Adapter Pattern 适配器模式
Adapter Pattern: converts the interface of a class into another interface the clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.Use of obj原创 2015-07-06 11:34:45 · 569 阅读 · 0 评论 -
Template Method Pattern 模板方法模式
Template Method Pattern: defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing t原创 2015-07-06 13:13:47 · 495 阅读 · 0 评论 -
Facade Pattern 门面模式
Facade Pattern provides a unified interface to a set of interfaces in a subsystem. Facade defines a higher level interface that makes the subsystem easier to use.门面模式中一个子系统的外部与其内部的通信可以通过一个统一的门面(Faca原创 2015-07-06 11:48:04 · 510 阅读 · 0 评论 -
Iterator Pattern 迭代器模式
Iterator Pattern: provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.It also places the task of traversal on the iterator object原创 2015-07-07 10:05:36 · 602 阅读 · 0 评论 -
Command Pattern 命令模式
Command Pattern: encapsulates a request as an object, thereby letting you parameterize other objects with different requests, queue or log requests, and support undoable operations.命令模式把一个请求或者操作封装原创 2015-07-06 05:52:55 · 569 阅读 · 0 评论 -
State Pattern 状态模式
State Pattern: allows an object to alter its behavior when its internal state changes. The object will appear to changes its class.Encapsulate state into separate classes. With the State Pattern, we原创 2015-07-07 12:42:11 · 523 阅读 · 0 评论 -
Singleton Pattern 单例模式
Singleton Pattern: ensures a class has only one instance, and provides a global point of access to it.Note: carefully deal with multithreading.Synchronizing a method can decrease performance by a原创 2015-07-05 04:39:18 · 484 阅读 · 0 评论 -
Strategy Pattern 策略模式
Design Principle:Identify the aspects of your application that vary and separate them from what stays the same. 将变化的分离出来,封装变化。Take what varies and "encapsulate" it so it won't affect the rest of t原创 2015-07-03 13:31:35 · 598 阅读 · 0 评论 -
Decorator Pattern 装饰者模式
When I inherit behavior by subclassing, that behavior is set statically at compile time. In addition, all subclasses must inherit the same behavior. If however, I can extend an object's behavior throu原创 2015-07-04 04:12:28 · 574 阅读 · 0 评论 -
Observer Pattern 观察者模式
Publisher, SubjectSubscriber, ObserverObserver Pattern: defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated a原创 2015-07-04 03:22:37 · 652 阅读 · 0 评论 -
Proxy Pattern 代理模式
RMI:1. Create a remote interface, which provides a set of methods that can be called remotely.2. Make sure all arguments and return type in the interface are serializable.3. You can declare tran原创 2015-07-07 13:31:59 · 637 阅读 · 0 评论 -
Factory Pattern 工厂模式
If your code is written to an interface, then it will work with any new classes implementing that interface through polymorphism. However, when you have code that makes use of lots of concrete classes原创 2015-07-04 10:50:05 · 505 阅读 · 0 评论