python-patterns使用 Python 實現(xiàn)設(shè)計模式的集合
python-patterns是使用Python實現(xiàn)設(shè)計模式的集合。設(shè)計模式(Design Patterns)是一套被反復(fù)使用、多數(shù)人知曉的、經(jīng)過分類編目的、代碼設(shè)計經(jīng)驗的總結(jié)。使用設(shè)計模式是為了可重用代碼、讓代碼更容易被他人理解、保證代碼可靠性。通過這個項目,可以讓Python程序員很好地熟悉設(shè)計模式。
目前項目中已經(jīng)實現(xiàn)的設(shè)計模式有:
3-tier: 三層架構(gòu)
abstract_factory:抽象工廠
adapter:適配器模式
borg:單例模式
bridge:橋接模式
builder:建造者模式
chain:鏈模式
command:命令模式
composite:組合模式
decorator:裝飾模式
facade:外觀模式
factory_method:工廠方法
flyweight:享元模式
graph_search:圖搜索模式
iterator:迭代器模式
mediator:中介模式
memento:備忘錄模式
mvc:mvc模式
null:空模式
observer:觀察者模式
pool:連接池模式
prototype:原型模式
proxy:代理模式
publish_subscribe:發(fā)布/訂閱模式
state:狀態(tài)模式
strategy:策略模式
template:模板方法模式
visitor:訪問者模式
評論
圖片
表情
