Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

媽! 我學會Design Pattern了 - 23種Design Pattern範例 #7

Open
Hsueh-Jen opened this issue Sep 12, 2018 · 0 comments
Open

媽! 我學會Design Pattern了 - 23種Design Pattern範例 #7

Hsueh-Jen opened this issue Sep 12, 2018 · 0 comments

Comments

@Hsueh-Jen
Copy link
Owner

Hsueh-Jen commented Sep 12, 2018

https://codepen.io/collection/nYebQp

上方連結收錄了基本的23個Design Pattern,因為Design Pattern並不好讀,加上要原封不動地置入自己的專案中有點難,所以我覺得學習其中的設計精神與實際應用案例應該就夠用了,但是Design Pattern真的太難讀啦!所以我整理了一些較簡單的Javascript Sample Code跟說明在這邊,希望可以幫助到想學Design Pattern的人。

總體來說設計模式分為3大類:

創建型模式,共5種:

工廠方法模式(Factory Method),抽象工廠模式(Abstract Factory),單例模式(Singleton),建造者模式(Builder),原型模式(Prototype)

結構型模式,共7種:

適配器模式(Adapter),裝飾器模式(Decorator),代理模式(Proxy),外觀模式(Facade),橋接模式(Bridge),組合模式(Composite),享元模式(Flyweight)

行為型模式,共11種:

策略模式(Strategy),模板方法模式(Template Method),觀察者模式(Observer),迭代子模式(Iterator),責任鏈模式(Chain of Responsibility),命令模式(Command),備忘錄模式(Memento),狀態模式(State),訪問者模式(Visitor),中介者模式(Mediator),解釋器模式(Interpreter)。

==================================================================

參考資料:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant