Chapter Two. Communication and the Use of Language
A project faces serious problems when its language is fractured. Domain experts use their
jargon while technical team members have their own language tuned for discussing the domain
in terms of design.
The terminology of day-to-day discussions is disconnected from the terminology embedded in
the code (ultimately the most important product of a software project). And even the same
person uses different language in speech and in writing, so that the most incisive
expressions of the domain often emerge in a transient form that is never captured in the
code or even in writing.
Translation blunts communication and makes knowledge crunching anemic.
Yet none of these dialects can be a common language because none serves all needs.
???????? 當(dāng)用于交流的語(yǔ)言出現(xiàn)斷層的時(shí)候,項(xiàng)目將會(huì)面臨一系列嚴(yán)重的問(wèn)題。域?qū)<覀兣c技術(shù)團(tuán)隊(duì)自
說(shuō)自話(huà)。
??????? 日常討論所用的術(shù)語(yǔ)不再與代碼(它們會(huì)成為軟件項(xiàng)目的重要部分)中的術(shù)語(yǔ)相聯(lián)系。甚至同
一個(gè)人會(huì)在交流中和在記錄中所用的術(shù)語(yǔ)不相一致,以至于問(wèn)題域中那些重要的表達(dá)方式出現(xiàn)得如此短
暫進(jìn)而使它們無(wú)法被捕獲到代碼中去甚至無(wú)法被記錄下來(lái)。
Use the model as the backbone of a language. Commit the team to exercising that language
relentlessly in all communication within the team and in the code. Use the same language in
diagrams, writing, and especially speech.
Iron out difficulties by experimenting with alternative expressions, which reflect
alternative models. Then refactor the code, renaming classes, methods, and modules to
conform to the new model. Resolve confusion over terms in conversation, in just the way we
come to agree on the meaning of ordinary words.
Recognize that a change in the UBIQUITOUS LANGUAGE is a change to the model.
Domain experts should object to terms or structures that are awkward or inadequate to
convey domain understanding; developers should watch for ambiguity or inconsistency that
will trip up design.
??????? 把模型作為通用語(yǔ)言的核心。推動(dòng)整個(gè)團(tuán)隊(duì)在各種各樣的交流中以及在編碼中嚴(yán)格的實(shí)踐這種
語(yǔ)言。在圖表、記錄特別是談話(huà)中統(tǒng)一交流方式。
??????? 通過(guò)選擇性的表達(dá)方式,即那些對(duì)應(yīng)不同模型的表達(dá)方式來(lái)消除通用語(yǔ)言中的難點(diǎn)。然后重構(gòu)
代碼,重新命名那些類(lèi)、方法模塊,使它們和新的模型相一致。我們對(duì)那些常用詞匯的理解漸漸的達(dá)成
一致,并以此來(lái)解決交談期間的那些混淆。
??????? 要知道,對(duì)于通用語(yǔ)言的任何變化都是對(duì)模型的變化。
?????? 域?qū)<覀儜?yīng)當(dāng)積極反對(duì)那些尷尬的或者不能充分傳達(dá)域概念的術(shù)語(yǔ),開(kāi)發(fā)者應(yīng)當(dāng)時(shí)時(shí)留意含義不
明確或者有矛盾的地方,這些地方會(huì)給設(shè)計(jì)埋下隱患。
Play with the model as you talk about the system. Describe scenarios out loud using the
elements and interactions of the model, combining concepts in ways allowed by the model.
Find easier ways to say what you need to say, and then take those new ideas back down to
the diagrams and code.
??????? 當(dāng)你談?wù)撓到y(tǒng)的時(shí)候,多多使用模型。大聲地使用模型所提供的那些元素和交互方式描述情節(jié)
,以模型所接受的方式聯(lián)結(jié)域中的概念。盡可能簡(jiǎn)單的表達(dá)你所要表達(dá)的東西,然后反過(guò)頭來(lái)把這些思
路轉(zhuǎn)變?yōu)閳D表和代碼。
posted on 2006-08-29 21:25
littlegai 閱讀(222)
評(píng)論(0) 編輯 收藏 引用 所屬分類(lèi):
我的讀書(shū)筆記