
Java面向对象
新发现FLY
寻找开发与产品的平衡
展开
-
Decorator pattern and Proxy pattern
You want to add behavior or state to individual objects at run-time. Inheritance is not feasible because it is static and applies to an entire class.Typical Example as follows, with the typic...原创 2012-08-03 15:09:12 · 106 阅读 · 0 评论 -
Liskov Substitution Principle (LSP) - OO设计的里氏替换原则
Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it. Robert C. Martin氏为我们总结了在面向对象的设计(OOD)中应该遵循的原则,这些原则被称为“Principles...原创 2012-08-06 15:46:08 · 85 阅读 · 0 评论