9. 什麼是設計?
• A design is a plan for how to build a thing. To
design is to build a thing in one’s mind but not
yet in the real world.
《POSA volume 5》Copyright@2013 Teddysoft
39. Each pattern is a three-part rule, which
expresses a relation between a certain
context, a problem, and a solution.
As an element in the world, each pattern is
a relationship between a certain context, a
certain system of forces which occurs
repeatedly in that context, and a certain
spatial configuration which allows these
forces to resolve themselves.
Copyright@2013 Teddysoft
40. An Example, Take 5.1
• Context: 線上遊戲的市場競爭非常激烈,玩家的
選擇很多,除非你是知名大廠,能推出曠世巨
作,否則以傳統先付費才可以玩的遊戲模式,
要玩家在尚未入迷之前就先付費變得越來越困
難。
• Problem: 要如何讓玩家在線上遊戲中付費?
• Forces:
– 安裝繁瑣或費時的遊戲將不易吸引玩家試玩,更談
不上收費的可能。
– 若玩家永遠只是付費,將減少他們持續玩同一款遊
戲的意願。
• Solution: 提供免費遊戲,先吸引玩家上癮,再
以販賣道具與周邊商品作為獲利來源。
Copyright@2013 Teddysoft
41. An Example, Take 5.2
• Context: 線上遊戲的市場競爭非常激烈,玩家的
選擇很多,因此傳統需要先付費才可以玩的遊
戲模式,要玩家在尚未入迷之前就先付費變得
越來越困難。
• Problem: 要如何讓玩家在線上遊戲中付費?
• Forces:
– 安裝繁瑣或費時的遊戲將不易吸引玩家試玩,更談
不上收費的可能。
– 若玩家永遠只是付費,將減少他們持續玩同一款遊
戲的意願。
• Solution: 提供快速、分段或免安裝的免費遊戲,
先吸引玩家上癮,再以販賣道具與周邊商品作
為獲利來源。提供網路商城,讓玩家可以買賣
道具,以提高遊戲的黏著度。Copyright@2013 Teddysoft
63. 第1次分化
Client
Type C
Client
Type B
Client
Type A
Server
Client
Type D
Device A
Device B
Device C
Device D
DatabaseUI
User
<server>
<client>
<client>
<server>
<client> <server>
<server>
<client>
<server><client>
Copyright@2013 Teddysoft
64. 第2次分化
Client
Type C
Client
Type B
Client
Type A
Server
Client
Type D
Device A
Device B
Device C
Device D
DatabaseUI
User
<server>
<client>
<client>
<server>
<client> <server>
<server>
<client>
<server><client>
Plug-in
Plug
-in
Copyright@2013 Teddysoft
65. 第3次分化
Client
Type C
Client
Type B
Client
Type A
Server
Client
Type D
Device A
Device B
Device C
Device D
DatabaseUI
User
<server>
<client>
<client>
<server>
<client> <server>
<server>
<client>
<server><client>
Plug-in
Plug
-in
OR-
Mapping
OR-
Mapping
Copyright@2013 Teddysoft
66. 第4次分化
Client
Type C
Client
Type B
Client
Type A
Server
Client
Type D
Device A
Device B
Device C
Device D
DatabaseUI
User
<server>
<client>
<client>
<server>
<client> <server>
<server>
<client>
<server><client>
Plug-in
Plug
-in
OR-
Mapping
OR-
Mapping
State
Observer
Command …
Copyright@2013 Teddysoft
69. 6個物件導向設計原則
• 模組化。
• 減少耦合,增加內聚。
• 尋找hot spot。
• 生物多樣性原則。
• Programming to an Interface, not an
Implementation (GoF).
• Favor object composition over class
inheritance (GoF).
Copyright@2013 Teddysoft
73. GoF (Gang of Four) 設計模式的格式
• 為什麼叫做 GoF Design Patterns?
– 因為作者有四個人, Erich Gamma, Richard Helm,
Ralph Johnson, John Vlissides
• GoF設計模式包含13個元素:
– Pattern Name, Intent, Also Known As, Motivation,
Applicability, Structure, Participants,
Collaborations, Consequences, Implementation,
Sample Code, Known Uses, Related Patterns
Copyright@2013 Teddysoft