design pattern 0 - pattern langrage overview

17
Design Pattern pattern language Nat

Upload: nat-chung

Post on 17-Nov-2014

272 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Design pattern 0 - Pattern langrage overview

Design Patternpattern language

Nat

Page 2: Design pattern 0 - Pattern langrage overview

Pattern

Page 3: Design pattern 0 - Pattern langrage overview

Pattern

A pattern is a solution to a problem in a context

Page 4: Design pattern 0 - Pattern langrage overview

A pattern is a solution to a

problem in a context

World

Context

Problem Solution

Page 5: Design pattern 0 - Pattern langrage overview

A pattern is a solution to a

problem in a context

World

Problem

Page 6: Design pattern 0 - Pattern langrage overview

A pattern is a solution to a

problem in a context

World

Problem中餐時間

Page 7: Design pattern 0 - Pattern langrage overview

A pattern is a solution to a

problem in a context

World

Problem Solution炒飯 清粥小菜水餃 牛肉麵7 11﹣ 泡麵

中餐時間

Page 8: Design pattern 0 - Pattern langrage overview

A pattern is a solution to a

problem in a context

World

Context

Problem

宿醉

中餐時間Solution清粥小菜

Page 9: Design pattern 0 - Pattern langrage overview

Pattern

A pattern is a solution to a problem in a context

Page 10: Design pattern 0 - Pattern langrage overview

Pattern

A pattern is a proven solution to a recurring problem in a specific

context

Page 11: Design pattern 0 - Pattern langrage overview

6 Elements of Pattern

Name

Context

Problem

Force (Restriction/Characteristic of problem)

Solution

Resulting Context (Consequence)

Page 12: Design pattern 0 - Pattern langrage overview

Force 讓 Problem 更明確Force 讓 Solution 更加完整與成

Page 13: Design pattern 0 - Pattern langrage overview

Force

Context: 你居住在靠海邊的台地上,在冬季時東北季風很強,室內溫度經常降到 15 度以下。就算沒有季風吹拂,在冬天海邊還是很冷。居住在這樣的生活環境中,尤其是老人與小孩,經常感到身體不適且容易生病。Problem: 要如何保持室內溫暖?solution :裝暖氣 / 裝地板暖氣 / 裝壁爐 / 牆壁採用隔熱(保溫)材質 etc

Page 14: Design pattern 0 - Pattern langrage overview

Force

Context: 你居住在靠海邊的台地上,在冬季時東北季風很強,室內溫度經常降到 15 度以下。就算沒有季風吹拂,在冬天海邊還是很冷。居住在這樣的生活環境中,尤其是老人與小孩,經常感到身體不適且容易生病。Problem: 要如何保持室內溫暖?Force:

1. 強烈的季風不斷地直接吹襲建築物,將會降低室內保溫效果。2. 透過熱氣裝置提高溫度將大量消耗能源,不利節能減碳。

Page 15: Design pattern 0 - Pattern langrage overview

ForceContext: 你居住在靠海邊的台地上,在冬季時東北季風很強,室內溫度經常降到 15 度以下。就算沒有季風吹拂,在冬天海邊還是很冷。居住在這樣的生活環境中,尤其是老人與小孩,經常感到身體不適且容易生病。Problem: 要如何保持室內溫暖?Force:

1. 強烈的季風不斷地直接吹襲建築物,將會降低室內保溫效果。2. 透過熱氣裝置提高溫度將大量消耗能源,不利節能減碳。

Solution: 在住宅的東北方種植不同層次的防風林,以減少季風直接吹襲住宅。在室內安裝合適的暖氣設備來維持室內的溫度

Page 16: Design pattern 0 - Pattern langrage overview

Creational - How do you create an object?(Abstract Factory, Builder, Factory Method, Prototype, Singleton)

Structural - How do you compose classes and object from larger struct?(Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy)

Behavioral - How do you assign algorithms and responsibilities between objects to manage complex control flow?(Chain of responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, template Method, Visitor)

Page 17: Design pattern 0 - Pattern langrage overview

Thanks