空对象模式
空对象模式 (null object Pattern)是一种软件设计模式。可以用于返回无意义的对象时,它可以承担处理null的责任。有时候空对象也被视为一种设计模式。
示例
public class NoCommand : public Command
{
public void execute()
{}
}
|
---|
| 设计模式 | |
---|
| 并行模式 | |
---|
| 架构模式 | |
---|
| 云 分布式 | |
---|
| 其他模式 |
- Blackboard
- Business delegate
- Composite entity
- 委托
- 依赖注入
- Intercepting filter
- 惰性載入
- Method chaining
- 模拟对象
- 空对象
- 对象池
- Servant
- Twin
- Type tunnel
|
---|
| 书籍 | |
---|
| 人物 | |
---|
| 社区 |
- The Hillside Group
- The Portland Pattern Repository
|
---|
|