日历

October 2020
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  

为什么是这4个原则?

Home Forums 《冒号课堂》讨论区 为什么是这4个原则?

  • This topic is empty.
Viewing 1 reply thread
  • Author
    Posts
    • #1060
      Todd
      Member

      设计原则有很多,比如熟悉的DRY,SOLID等原则。本书选择了间接,依赖,内聚和保变4个设计原则作为大的分类。这样选择的用意是什么呢?

      SCIP先讲了抽象(等同于间接),然后讲模块化(等同于内聚),可能SCIP的作者也认为抽象和内聚应该是一级原则。下面是SCIP的一段话:

      The preceding chapters introduced the basic elements from which programs are made. We saw how primitive procedures and primitive data are combined to construct compound entities, and we learned that abstraction is vital in helping us to cope with the complexity of large systems. But these tools are not sufficient for designing programs. Effective program synthesis also requires organizational principles that can guide us in formulating the overall design of a program. In particular, we need strategies to help us structure large systems so that they will be modular, that is, so that they can be divided naturally” into coherent parts that can be separately developed and maintained.

    • #1217
      hui
      Keymaster

      设计原则有很多,但归根结底是抽象原则。书中提到的抽象可能比SCIP中的abstraction更广义:模块化的本质也是抽象——它无非是如何划分抽象边界的问题。本书中将设计原则归为间接、依赖、内聚和保变等四类,主要是考虑到它们具有典型代表性,而且以之为中心组织内容比较方便。

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
 请您评分1星(很差)2星(不行)3星(一般)4星(不错)5星(很棒)