Design Pattern Note

Someday, I will use them. They are not so simple just as what they seem like.

Observer Pattern

Publishers + Subscribers = Oberver Pattern

Regist/Remove

The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified an updated automatically.

Java built-in support: java.util.Observerable / java.util.Observer

Decorator Pattern

The Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

Factory Pattern

The Factory Method Pattern defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

评论

发表评论

了解 零壹派 – ZeroOne Circle 的更多信息

立即订阅以继续阅读并访问完整档案。

继续阅读