`

gof的23个设计模式5w1h

阅读更多
10.3
今天来开始我往天准备写的东西,gof的23个设计模式5w1h。以及我对任务分配器的研发的具体情况介绍。
1、gof的23个设计模式主要分为:构造模式、结构模式、行为模式。
2、构造模式,包括5个模式。具体为:抽象工厂模式、工厂函数模式、单态模式、builder模式、原型模式。
3、结构模式,包括7个模式。具体为:briadge模式、adapter模式、proxy模式、decator模式、facade模式。
4、行为模式,包括11个模式。具体为:vistor模式、command模式。

abstract factory and factory method:这两个模式一般情况下都是不严格区分的,他们的作用也都相同,主要是替代construtor,及消除construt乱用造成的混乱。
when:当用来消除construt时一般用这个来消除混乱。
what:去除construtor,隐藏具体实现。
where:同上。
who:object program。
why:using facotry method or abstract factory to avoid construt. the construt has           some disadvantage .no type check ,the construt name and class name is same.
how:用函数代替constut。
...
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics