【正文】
proposed solution. The problems are intended to be universal, and the proposed solutions are generic in the sense that they address the universal nature of the problem rather than proposing a solution for a particular case. 每種模式都包括了一個(gè)問題描述以及建議性的解決方案。這些問題是很普遍的,而這個(gè)建議性的解決方案也是一般性的 ——旨在強(qiáng)調(diào)他們闡述的是問題的一般的本質(zhì)而不是僅僅為一個(gè)特殊的例子提出一個(gè)解決方案。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 642 Design Patterns For example, one pattern, called Quiet Backs, addresses the need to escape the motion of a business center for short periods of refreshment. The proposed solution is to design quiet backs into business districts. In some cases, the district could be designed around a main street to which all buildings facethus, providing for quiet side streets behind the buildings. In other cases, quiet backs can be obtained by means of parks, rivers, or cathedrals. 例如,一個(gè)模式,叫做“安靜的后面”,闡述了躲避商業(yè)中心的喧囂而尋求短暫的精力恢復(fù)的需求。其建議性的解決方案就是在商業(yè)區(qū)中設(shè)計(jì)一個(gè)“安靜的后面”。在某些情況下,這個(gè)商業(yè)區(qū)要設(shè)計(jì)在所有建筑都要朝向的主要街道周圍 ——因此可以將安靜的輔路鋪在建筑的后面。在其他的情況下,“安靜的后面”可以采用公園、河流或者是教堂的形式。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 643 Design Patterns The important point for our discussion is that Alexander39。s wok attempted to identify universal problems and provide templates for solving them. Today, many software engineers are attempting to apply this same approach to the design of large software systems. In particular, researchers are applying design patterns as a means of providing generic building blocks with which software systems can be constructed. 我們所討論的重點(diǎn)就是 Alexander在著作中試圖確定的一般性問題并且提供解決它們的模板。今天,許多軟件工程師也試圖應(yīng)用同樣的方法來設(shè)計(jì)大型的軟件系統(tǒng)。特別地,研究人員正在應(yīng)用設(shè)計(jì)模式作為提供軟件構(gòu)建所需通用單元的方法。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 644 Design Patterns An example of such a pattern is the publishersubscriber pattern, consisting of a module (the publisher) that must send copies of its “publications” to other modules (the subscribers). As a specific example, consider a collection of data that is being displayed on a puter screen in more than one formatperhaps as a pie graph as well as a bar graphsimultaneously. In this setting, any change in the data should be reflected in both graphs. Thus the software modules in charge of drawing the graphs should be notified when changes in the data occur. In this case, then, the software module maintaining the data plays the role of the publisher that must send update messages to the subscribers, which are the modules charged with drawing the graphs. 這種模式的一個(gè)例子就是出版商和訂戶的模式:一個(gè)模塊(出版商)將其出版物發(fā)送給其他模塊(訂戶)。作為一個(gè)特殊的例子,考慮在計(jì)算機(jī)屏幕上同時(shí)顯示多種格式的數(shù)據(jù)集,如餅圖和條形圖。這樣,任何對數(shù)據(jù)的修改都將會(huì)被反映在兩張圖上。因此,當(dāng)數(shù)據(jù)發(fā)生更改的時(shí)候,這個(gè)負(fù)責(zé)畫圖的軟件模塊將會(huì)被告知。在這種情況下,維護(hù)數(shù)據(jù)的軟件模塊就會(huì)扮演出版商的角色 ——它必須要給訂戶發(fā)送更新的消息,而這些訂戶也是模塊,它們負(fù)責(zé)畫圖。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 645 Design Patterns Another example of software design pattern is the containerponent pattern. It captures the generic concept of a container that contains ponents that are themselves containers. Such a pattern is exemplified by the directories or folders used by an operating system39。s file manager. Each of these directories typically contains other directories, which may contain still other directories. In short, the containerponent pattern is meant to capture the recursive concept of containers that contain containers. 軟件設(shè)計(jì)模式的另一個(gè)例子是容器組件模式。它闡述了容器包括一些組件,而組件本身又是容器的一般性概念。這種模式的例子就是操作系統(tǒng)的文件管理器使用的目錄或者文件夾。每個(gè)這樣的目錄都包括了其他目錄,而這個(gè)被包含了的目錄可能又包含了其他的目錄。簡而言之,容器組件模式可以描述容器包含容器的遞歸概念。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 646 Design Patterns Once a pattern such as publishersubscriber or containerponent has been identified, software engineers propose the development of skeletal program units, called frameworks, that implement the pertinent features of the pattern39。s solution while leaving features specific to particular applications as slots to be filled in later. To acpany frameworks, software engineers propose documentation that describes how the framework can be filled in to obtain a plete implementation of the underlying pattern in a particular setting. Such documentation is called a recipe. Collections of frameworks along with their recipes are fondly known as cookbooks. 一旦像出版商與訂戶或者是容器和組件這樣的模式被確定,軟件工程師就會(huì)計(jì)劃開發(fā)一組程序單元作為骨架,這稱為框架,它實(shí)現(xiàn)模式方法所要解決的主要特征,而將特殊應(yīng)用程序的特性作為缺口,留待以后填入。為了補(bǔ)充框架,軟件工程師提出了如何填充框架的描述文檔。這種文擋被稱為處方,與處方在一起的框架集被昵稱為菜譜。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 647 Design Patterns Researchers hope that by means of cookbooks, software engineers will finally be able to construct large, plex software systems from offtheshelf ponentsthe ponents being frameworks. Early results have indicated that such an approach can significantly reduce the amount of programming required in the development of a new system. 研究人員希望:借助菜譜,軟件工程師最終可以從現(xiàn)成的組件 ——組件就是框架 ——構(gòu)建大型的復(fù)雜軟件系統(tǒng)。早期的結(jié)果表明,這種方法可以大大減少開發(fā)新系統(tǒng)所需的編程工作量。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 648 Design Patterns With all the excitement that has been generated in the software engineering munity over design patterns, it is interesting to note that Alexander was not pleased with the results of his patterns in architecture. In short, he found that the systems designed from his patterns were lacking in character, and his work since the early 1980s has focused on ways to capture this evasive quality. However, software engineers argue that the goal in software development does not involve such qualities as beauty and character, but instead accuracy and efficiency. Thus, they continue, design patterns will prove to be more successful in the field of software engineering than in architecture. 設(shè)計(jì)模式在軟件工程領(lǐng)域中引起了極大的熱情,而對于 Alexander而言,他對自己應(yīng)用于建筑學(xué)的模式卻不是很滿意,這是十分有趣的事。他發(fā)現(xiàn)根據(jù)自己的模式所設(shè)計(jì)的系統(tǒng)缺乏個(gè)性,并且從二十世紀(jì)八十年代初開始他主要致力于捕獲這個(gè)遺漏性質(zhì)的方法。但是,軟件工程師認(rèn)為軟件開發(fā)的目標(biāo)不是去追求諸如美觀和個(gè)性的特性,而是追求準(zhǔn)確和高效。因此,他們將這種方法發(fā)揚(yáng)光大,設(shè)計(jì)模式在軟件工程領(lǐng)域中將比在建筑領(lǐng)域中更加成功。 Chapter 6 Software Engineering 計(jì)算機(jī)專業(yè)英語 649 復(fù)雜定語 (從句 )的翻譯技巧