Code Reading chap9

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+  

+                    Chapter9: Architecture

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

182.  One system can(and in nontrivial cases does)exhibit many different architectural styles simultaneously.

        Different styles can appear by looking at the same system in a different way,by examining different parts

       of the system,or by employing different levels of decomposition.(P.268)

        一个系统可以(在一些并不是不重要的用例中)同时的展示出许多不同的架构风格。通过检查该系统的不同部分,

       或者通过应用不同层次的分解不同的风格,以这样的不同方式查看相同的系统来显现出系统的不同风格。 

---------------------------------------------------

183. Centralized repository architectures are employed in collaborative applications and when different

        semiautonomous processes need to cooperate to access shared information or resources.(P.268)

       中央化的仓库体系架构被用于协作应用,以及应用于当不同的半自治处理程序需要协作以获取共享的信息

       或者资源的时候。

---------------------------------------------------

184.  A blackboard system uses a centralized repository of unstructured key/value pairs as a

        communications hub for a number of different code elements.(p.270)

        一个黑板系统使用了一个中央化的“非结构化键值对作为一系列不同代码元素的之通讯中心(hub )”仓库。

---------------------------------------------------

185. You will often find data—flow(or pipes—and—filters)architectures adopted when processing

        can be modeled,designed,and implemented as a series of data transformations.(p.273)

        你常常会发现数据流(或者管道与过滤器)体系架构在“进程可以被模式化,被计划,以及

       作为一系列数据传转换去实现” 的时候会被应用到。

---------------------------------------------------

186. Data—flow architectures are often employed in automatic data—processing batch—oriented

      environments,especially on platforms that efficiently support data—transformation tools.(P.273)

      数据流体系结构常常被应用到自动数据处理的批处理环境中, 特别是在有效支持数据转换工具的那些平台上。

---------------------------------------------------

187.  A telltale sign of a data-flow architecture is the use of temporary files or pipelines for communicating

        between different processes.(P.274)

        数据流体系结构的指示器显示是对了对不同进程之间通信,从而进行临时文件的使用,或者流水线的使用。

---------------------------------------------------

188.  Use diagrams to model the class relationships in object—oriented architectures.(p.278)

        在面向对象架构中,用图来模拟类的关系。

---------------------------------------------------

189.  Import source code into a modeling tool to reverse engineer a system’s architecture.(p.279)

         将源代码导入到模型工具中,用于逆向工程出一个系统的体系结构 。

---------------------------------------------------

190. Systems with a multitude of alternative peer subsystems are often organized  following

       a layered architecture.(P.279)

       有一个众多的且可选的对等子系统的那么一个系统常常被组织成层级结构。

---------------------------------------------------

191.  Layered architectures are typically implemented by stacking software components with

        standardized interfaces.(p.279)

        层级化结构典型的被通过有标准接口的栈软件组件来实现  。

---------------------------------------------------

192. A system’s layer Can view lower layers as abstract entities and(as long as the layer is satisfying

       its requirements)does not care how upper layers will use it.(p.279)

       一个系统的层级可以把低层的层级视为实体的抽象,并且(只要该层级满足其需求)不关心上层层级如何被使用。

---------------------------------------------------

193.  A layer interface can consist of either a family of complementary functions supporting a specific

        concept or a series of interchangeable functions supporting different underlying implementations

        of an abstract interface.(P.281)

        一个层级接口要么由“支持特定概念的补充函数族” (?)组成,要么由一系列可互换的“支持一个抽象接口的

       不同基础实现”函数支持。        

---------------------------------------------------

194.  Systems implemented in C often express layer interface multiplexing operations  by using arrays

        of function pointers.(P.282)

        C 里面的系统实现常常通过“使用函数指针数组”表达了层级接口的多路操作技术。

---------------------------------------------------

195.  Systems implemented in object—oriented languages directly express layer interface multiplexing

        operations by using virtual method calls.(P.282)

         用面向对象语言实现的系统,通过使用虚拟方法调用去直接的表达层级接口的多路操作技术。

---------------------------------------------------

196.  A system can be organized across various axes by using different and distinct  hierarchical

        decomposition models.(p.282)

        一个系统可以通过使用不同的以及唯一的等级体系分解模型去组织跨越不同的轴。

---------------------------------------------------

197. Use program—slicing techniques to bring together a program's data and control 

      dependencies.(p.283)

      使用程序切片技术去把程序的数据以及控制依赖放置到一起。

---------------------------------------------------

198.  In concurrent systems a single system component often acts as a centralized manager,startlng,

        stopping,and coordinating the execution of other system processes and tasks.(p.289)

        在并发系统中,一个单独系统的组件常常扮演了一个集中管理者的角色,开启,终止,以及协调其它

        系统进程与任务的执行。

---------------------------------------------------

199.  Many real world systems adopt the best parts of multiple architectures.When  dealing with such

        a system,do not seek in vain for the all-encompassing  architectural picture;locate,recognize,

        and appreciate each different architectural  style as a separate yet interrelated entity.(p.291)

        许多真实世界中的系统采纳了多个体系结构中最佳的诸部分。当应对这样一个系统的时候,不要白费力气的去

        寻找所谓全面的,统摄一切的系统架构图像;作为独立的但仍旧是相互有关的实体的方式去定位,认出以及

       去欣赏各个不同的体系结构风格。

---------------------------------------------------

200.  A state transition diagram will often help you untangle a state machine‘s operation.(P.291)

        一张状态转换图会常常帮助你整理一个状态机的操作(译注:默认是指有限自动机么?)。

---------------------------------------------------

201.  When dealing with a large body of code,it is important to understand the mechanisms employed

        to decompose it into separate units.(p.292)

         当你要处理一大段的代码时,了解用来分解到各个独立单元的机制是很重要的。

---------------------------------------------------

202.   A module’s physical boundary boundary is in most cases a single file,a directory or a collection of files with

         a unique prefix.(p.293)

         一个模块的物理边界在大多是情况下是一个单独文件,一个目录或者一个有唯一前缀的文件集。

---------------------------------------------------

203.   Modules in C often consist of a header file providing the module's public interface  and a source

         file providing the corresponding implementation.(P.295)

         C中的模块常常由一个头文件作为组成部分,提供了该模块的公共接口,以及一个源文件提供相应的实现部分。

---------------------------------------------------

204.   Object constructors are often used to allocate the resources associated with an object and to

         initialize its state.Destructors are typically used to free the resources  an object has appropriated

         during its lifetime.p.302)

          对象的构造器常常用于分配相关于一个对象的资源,并初始化其状态。 析构器典型的用于释放一个对象

          在其生命周期中占据的资源。

---------------------------------------------------

205.   Object methods often use class fields for storing data that controls the operation of all methods

          (such as a lookup table or a dictionary)or for maintaining state  information about the class’s

          operation(for example,a counter for assigning a  unique identifier to each object).(p.303)

           对象方法常常用类字段来存储控制所有方法操作的数据(例如,查询表或者一个字典),或者用于维护关于类操作

          的状态信息(例如, 一个用于分配唯一识别器到各个对象的计数器)。

---------------------------------------------------

206.    In well—designed classes all fields are declared as private with access to them  provided through

           public access methods.(p.304)

           在良好定义的类中,所有的字段被申明为私有的,通过共公共存取的方法来提供到这些私有字段的存取。

---------------------------------------------------

207.   When you encounter friend declarations,pause to question the actual design  reason for

         overriding the class’s encapsulation.(p.306) 

          当你遇到 friend声明,   要停下来询问为了重载类的封装背后的实际设计原因 。

---------------------------------------------------

208.   Operator overloading is used either sparingly to enhance the usability of a particular class or

         overreachingly to endow a class implementing a number-like  entity with the full functionality

         associated with the built-in arithmetic types.(P307)

         操作符重载或者用于少量的强化特定类的可用性,或者过度的赋予一个类实现类似数字的,且全功能相关于

         内置算法类型的实体(?)。

---------------------------------------------------

209. Generic implementations are realized either at compile time through macro substitution and

       language—supported facilities such as the C++templates and the Ada generic packages or at

       runtime by using element and function pointers or object polymorphism.(P.313)

       通用实现可以“在编译时通过宏替换,以及诸如C++模板, Ada 通用包这样的语言支持工具”去被实现,

      或者也可以通过使用元素以及函数指针或者对象多态在运行时被实现。

---------------------------------------------------

210.  Abstract data types are often used to encapsulate commonly used data organization schemes

        (such as trees,lists,or stacks)or to hide a data type’s implementation details from its user (P.319)

        抽象数据类型常用来封装常用的数据组织计划(诸如 树, 列表, 或者栈)或者用于对其用户隐藏一数据类型的实现细节。        

---------------------------------------------------

211.  Libraries are employed for a number of different purposes:to reuse source and object code,

         to organize module collections,to structure and optimize the buildprocess,and to load

         application features on demand.(P.319)

         库被应用于一系列的不同的目的:重用源以及对象代码, 组织模块集合, 结构化以及优化构建过程,

        并且随需装载应用。

---------------------------------------------------

212.   Large and distributed systems are often implemented as a number of cooperating processes.(P.323)

          大型的以及分布式的系统常常是作为一系列协作的进程来实现的。

---------------------------------------------------

213.   You can decipher the structure of a text—based data repository by browsingthrough the data

         stored in it.(p.32 7)

          你可以通过浏览存储于基于文本的数据仓库内部的数据来 破译这个文本数据仓库的结构。

---------------------------------------------------

214.   You can examine a relational database’s schema by performing queries on the tables of the data

         dictionary or by using database—specific SQL commands such as SHOW TABLE.(P.327) 

         你可以通过查询数据字典上的表或者使用数据库-特定的诸如SHOW TABLE一样的SQL命令,

         来检查一个关系型数据库模式。            

---------------------------------------------------

215.   After recognizing a reused architectural element,look up its original description to gain additional

         insight on the way it is used or abused.(P.329)

         一旦当你认出了一个可重用的架构元素,那么就去查下这个元素的初始描述,以期获得关于它被

        使用或者被滥用的附加洞察力。

---------------------------------------------------

216.  When examining in-depth an application built on top of a framework,the best  course of action

        is to begin by studying the framework itself.(p.330)

        当彻底的检查一个在框架之上的应用的时候,最佳行动路线是学习框架本身。

---------------------------------------------------

217.  Limit your expectations when reading wizard—generated code and you will not  be disappointed.(P.330)

        当阅读到向导生成的代码时,要限制自己的期望,这样你就不会失望了。

---------------------------------------------------

218.   Learn a few basic design pattems and you will find that the way you view code architectures will

         change: your vision and vocabulary will extend to recognizeand describe many commonly

         used forms.(P.332)

        学习一点点设计模式,你会发现你使用代码体系架构的方式将会改变:你的视野以及词汇量会扩展以识别到许多

       通用形式的描述。

---------------------------------------------------

219.  You will often encounter frequently used patterns without explicit references to their names since

        the reuse of architectural designs often predates their description in the form of patterns.(p.332)

        你会遭遇到频繁使用的模式,而且这些模式不会明白的告诉你它们的模式名字,那是因为重用体系架构设计常常会先于

         它们的模式形式描述。(译注:模式只是对大量实际运行的代码的总结)

---------------------------------------------------

220.  Try to understand architectures in terms of the underlying patterns,even if the  patterns are

        not explicitly mentioned in the code.(p.333)

    试着从在模式的角度去理解体系架构,即便这个模式没有在代码中明显的提到过。

---------------------------------------------------

221.  Most interpreters follow a processing architecture built around a state machine whose operation

        depends on the interpreter’S current state,the program instruc—tion,and the program state.(P.336)

       大多数解释器跟随了一个围绕状态机器构建的处理体系结构,而该状态机的操作又依赖于该解释器的当前状态,

---------------------------------------------------

222.  In many cases,reference architectures prescribe a notational structure for an  application domain,

        which is not neccessarily followed by the concrete implementations.(P.336)

        在许多情况下 ,引用体系结构规定了一个应用域的计数结构,这不必跟随具体的实现。

+++++++++++++++++++++++++end of chap9 ++++++++++++++++++++++++++++++++

原文地址:https://www.cnblogs.com/parsifal/p/2092498.html