<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>整洁架构 on DoDoRo的梦想空间-码农,数学,算法,哲学,园艺</title>
    <link>https://dodoro.chouxiangpai.com/categories/%E6%95%B4%E6%B4%81%E6%9E%B6%E6%9E%84/</link>
    <description>Recent content in 整洁架构 on DoDoRo的梦想空间-码农,数学,算法,哲学,园艺</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Thu, 14 Mar 2024 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://dodoro.chouxiangpai.com/categories/%E6%95%B4%E6%B4%81%E6%9E%B6%E6%9E%84/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>《架构整洁之道》：Chap11. DIP: THE DEPENDENCY INVERSION PRINCIPLE DIP：依赖反转原则</title>
      <link>https://dodoro.chouxiangpai.com/archives/2065/</link>
      <pubDate>Thu, 14 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/2065/</guid>
      <description>&lt;p&gt;The Dependency Inversion Principle (DIP) tells us that the most flexible systems are those in which source code dependencies refer only to abstractions, not to concretions.&lt;/p&gt;
&lt;p&gt;依赖反转原则（DIP）主要想告诉我们的是，如果想要设计一个灵活的系统，在源代码层次的依赖关系中就应该多引用抽象类型，而用具体实现。&lt;/p&gt;
&lt;p&gt;In a statically typed language, like Java, this means that the use, import, and include statements should refer only to source modules containing interfaces, abstract classes, or some other kind of abstract declaration. Nothing concrete should be depended on.&lt;/p&gt;
&lt;p&gt;也就是说，在 Java 这类静态类型的编程语言中，在使用 use、import、include 这些语句时应该只引用那些包含接口、抽象类或者其他抽象类型声明的源文件，不应该引用任何具体实现。&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap10. ISP: THE INTERFACE SEGREGATION PRINCIPLE ISP：接口隔离原则</title>
      <link>https://dodoro.chouxiangpai.com/archives/2063/</link>
      <pubDate>Wed, 13 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/2063/</guid>
      <description>&lt;p&gt;The Interface Segregation Principle (ISP) derives its name from the diagram shown in Figure 10.1.&lt;/p&gt;
&lt;p&gt;“接口隔离原则（ISP）”这个名字来自图 10.1 所示的这种软件结构。&lt;/p&gt;
&lt;p&gt;The Interface Segregation Principle&lt;/p&gt;
&lt;p&gt;In the situation illustrated in Figure 10.1, there are several users who use the operations of the OPS class. Let’s assume that User1 uses only op1, User2 uses only op2, and User3 uses only op3.&lt;/p&gt;
&lt;p&gt;在图 10.1 所描绘的应用中，有多个用户需要操作 OPS 类。现在，我们假设这里的 User1 只需要使用 op1，User2 只需要使用 op2，User3 只需要使用 op3。&lt;/p&gt;
&lt;p&gt;Now imagine that OPS is a class written in a language like Java. Clearly, in that case, the source code of User1 will inadvertently depend on op2 and op3, even though it doesn’t call them. This dependence means that a change to the source code of op2 in OPS will force User1 to be recompiled and redeployed, even though nothing that it cared about has actually changed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap9. LSP: THE LISKOV SUBSTITUTION PRINCIPLE LSP：里氏替换原则</title>
      <link>https://dodoro.chouxiangpai.com/archives/2061/</link>
      <pubDate>Tue, 12 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/2061/</guid>
      <description>&lt;p&gt;In 1988, Barbara Liskov wrote the following as a way of defining subtypes.&lt;/p&gt;
&lt;p&gt;1988 年，Barbara Liskov 在描述如何定义子类型时写下了这样一段话：&lt;/p&gt;
&lt;p&gt;What is wanted here is something like the following substitution property: If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T.1&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap8. OCP: THE OPEN-CLOSED PRINCIPLE OCP：开闭原则</title>
      <link>https://dodoro.chouxiangpai.com/archives/2059/</link>
      <pubDate>Mon, 11 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/2059/</guid>
      <description>&lt;p&gt;The Open-Closed Principle (OCP) was coined in 1988 by Bertrand Meyer.1 It says:&lt;/p&gt;
&lt;p&gt;开闭原则（OCP）是 Bertrand Meyer 在 1988 年提出的，该设计原则认为：&lt;/p&gt;
&lt;p&gt;A software artifact should be open for extension but closed for modification.&lt;/p&gt;
&lt;p&gt;设计良好的计算机软件应该易于扩展，同时抗拒修改。&lt;/p&gt;
&lt;p&gt;In other words, the behavior of a software artifact ought to be extendible, without having to modify that artifact.&lt;/p&gt;
&lt;p&gt;换句话说，一个设计良好的计算机系统应该在不需要修改的前提下就可以轻易被扩展。&lt;/p&gt;
&lt;p&gt;This, of course, is the most fundamental reason that we study software architecture. Clearly, if simple extensions to the requirements force massive changes to the software, then the architects of that software system have engaged in a spectacular failure.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap7. SRP: THE SINGLE RESPONSIBILITY PRINCIPLE SRP：单一职责原则</title>
      <link>https://dodoro.chouxiangpai.com/archives/2057/</link>
      <pubDate>Sun, 10 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/2057/</guid>
      <description>&lt;p&gt;Of all the SOLID principles, the Single Responsibility Principle (SRP) might be the least well understood. That’s likely because it has a particularly inappropriate name. It is too easy for programmers to hear the name and then assume that it means that every module should do just one thing.&lt;/p&gt;
&lt;p&gt;SRP 是 SOLID 五大设计原则中最容易被误解的一个。也许是名字的原因，很多程序员根据 SRP 这个名字想当然地认为这个原则就是指：每个模块都应该只做一件事。&lt;/p&gt;
&lt;p&gt;Make no mistake, there is a principle like that. A function should do one, and only one, thing. We use that principle when we are refactoring large functions into smaller functions; we use it at the lowest levels. But it is not one of the SOLID principles—it is not the SRP.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Part3. DESIGN PRINCIPLES 设计原则</title>
      <link>https://dodoro.chouxiangpai.com/archives/2054/</link>
      <pubDate>Sat, 09 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/2054/</guid>
      <description>&lt;p&gt;Good software systems begin with clean code. On the one hand, if the bricks aren’t well made, the architecture of the building doesn’t matter much. On the other hand, you can make a substantial mess with well-made bricks. This is where the SOLID principles come in.&lt;/p&gt;
&lt;p&gt;通常来说，要想构建一个好的软件系统，应该从写整洁的代码开始做起。毕竟，如果建筑所使用的砖头质量不佳，那么架构所能起到的作用也会很有限。反之亦然，如果建筑的架构设计不佳，那么其所用的砖头质量再好也没有用。这就是 SOLID 设计原则所要解决的问题。&lt;/p&gt;
&lt;p&gt;The SOLID principles tell us how to arrange our functions and data structures into classes, and how those classes should be interconnected. The use of the word “class” does not imply that these principles are applicable only to object-oriented software. A class is simply a coupled grouping of functions and data. Every software system has such groupings, whether they are called classes or not. The SOLID principles apply to those groupings.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap6. FUNCTIONAL PROGRAMMING 函数式编程</title>
      <link>https://dodoro.chouxiangpai.com/archives/2026/</link>
      <pubDate>Fri, 08 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/2026/</guid>
      <description>&lt;p&gt;In many ways, the concepts of functional programming predate programming itself. This paradigm is strongly based on the l-calculus invented by Alonzo Church in the 1930s.&lt;/p&gt;
&lt;p&gt;函数式编程所依赖的原理，在很多方而其实是早于编程本身出现的。因为函数式编程这种范式强烈依赖于 Alonzo Church 在 20 世纪 30 年代发明的 λ 演算。&lt;/p&gt;
&lt;p&gt;SQUARES OF INTEGERS 整数平方 To explain what functional programming is, it’s best to examine some examples. Let’s investigate a simple problem: printing the squares of the first 25 integers.&lt;/p&gt;
&lt;p&gt;我们最好还是用一个例子来解释什么是函数式编程。请看下面的这个例子：这段代码想要输出前 25 个整数的平方值。&lt;/p&gt;
&lt;p&gt;In a language like Java, we might write the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap5. OBJECT-ORIENTED PROGRAMMING 面向对象编程</title>
      <link>https://dodoro.chouxiangpai.com/archives/1972/</link>
      <pubDate>Thu, 07 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/1972/</guid>
      <description>&lt;p&gt;As we will see, the basis of a good architecture is the understanding and application of the principles of object-oriented design (OO). But just what is OO?&lt;/p&gt;
&lt;p&gt;稍后我们会讲到，设计一个优秀的软件架构要基于对面向对象设计（Object-Oriented Design）的深入理解及应用。但我们首先得弄明白一个问题：究竟什么是面向对象？&lt;/p&gt;
&lt;p&gt;One answer to this question is “The combination of data and function.” Although often cited, this is a very unsatisfying answer because it implies that o.f() is somehow different from f(o). This is absurd. Programmers were passing data structures into functions long before 1966, when Dahl and Nygaard moved the function call stack frame to the heap and invented OO.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap4. STRUCTURED PROGRAMMING 结构化编程</title>
      <link>https://dodoro.chouxiangpai.com/archives/1969/</link>
      <pubDate>Wed, 06 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/1969/</guid>
      <description>&lt;p&gt;Edsger Wybe Dijkstra was born in Rotterdam in 1930. He survived the bombing of Rotterdam during World War II, along with the German occupation of the Netherlands, and in 1948 graduated from high school with the highest possible marks in math, physics, chemistry, and biology. In March 1952, at the age of 21 (and just 9 months before I was born), Dijkstra took a job with the Mathematical Center of Amsterdam as the Netherlands’ very first programmer.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap3. PARADIGM OVERVIEW 编程范式总览</title>
      <link>https://dodoro.chouxiangpai.com/archives/1967/</link>
      <pubDate>Tue, 05 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/1967/</guid>
      <description>&lt;p&gt;The three paradigms included in this overview chapter are structured programming, object-orient programming, and functional programming.&lt;/p&gt;
&lt;p&gt;本章将讲述三个编程范式，它们分别是结构化编程（structured programming）、 面向对象编程（object-oriented programming）以及函数式编程（functional programming）。&lt;/p&gt;
&lt;p&gt;STRUCTURED PROGRAMMING 结构化编程 The first paradigm to be adopted (but not the first to be invented) was structured programming, which was discovered by Edsger Wybe Dijkstra in 1968. Dijkstra showed that the use of unrestrained jumps (goto statements) is harmful to program structure. As we’ll see in the chapters that follow, he replaced those jumps with the more familiar if/then/else and do/while/until constructs.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Part2. STARTING WITH THE BRICKS: PROGRAMMING PARADIGMS 从基础构件开始：编程范式</title>
      <link>https://dodoro.chouxiangpai.com/archives/1965/</link>
      <pubDate>Mon, 04 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/1965/</guid>
      <description>&lt;p&gt;Software architecture begins with the code—and so we will begin our discussion of architecture by looking at what we’ve learned about code since code was first written.&lt;/p&gt;
&lt;p&gt;任何软件架构的实现都离不开具体的代码，所以我们对软件架构的讨论应该从第一行被写下的代码开始。&lt;/p&gt;
&lt;p&gt;In 1938, Alan Turing laid the foundations of what was to become computer programming. He was not the first to conceive of a programmable machine, but he was the first to understand that programs were simply data. By 1945, Turing was writing real programs on real computers in code that we would recognize (if we squinted enough). Those programs used loops, branches, assignment, subroutines, stacks, and other familiar structures. Turing’s language was binary.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap2. A TALE OF TWO VALUES 两个价值维度</title>
      <link>https://dodoro.chouxiangpai.com/archives/1963/</link>
      <pubDate>Sun, 03 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/1963/</guid>
      <description>&lt;p&gt;Every software system provides two different values to the stakeholders: behavior and structure. Software developers are responsible for ensuring that both those values remain high. Unfortunately, they often focus on one to the exclusion of the other. Even more unfortunately, they often focus on the lesser of the two values, leaving the software system eventually valueless.&lt;/p&gt;
&lt;p&gt;对于每个软件系统，我们都对以通过行为和架构两个维度来休现它的实际价值。软件研发人员应该确保自己的系统在这两个维度上的实际价值都能长时间维持在很高的状态。不幸的是，他们往往只关注一个维度，而忽视了另外一个维度。更不幸的是，他们常常关注的还是错误的维度，这导致了系统的价值最终趋降为零。&lt;/p&gt;
&lt;p&gt;BEHAVIOR 行为价值 The first value of software is its behavior. Programmers are hired to make machines behave in a way that makes or saves money for the stakeholders. We do this by helping the stakeholders develop a functional specification, or requirements document. Then we write the code that causes the stakeholder’s machines to satisfy those requirements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：Chap1. WHAT IS DESIGN AND ARCHITECTURE? 设计与架构到底是什么</title>
      <link>https://dodoro.chouxiangpai.com/archives/1961/</link>
      <pubDate>Sat, 02 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/1961/</guid>
      <description>&lt;p&gt;There has been a lot of confusion about design and architecture over the years. What is design? What is architecture? What are the differences between the two?&lt;/p&gt;
&lt;p&gt;一直以来，设计（Design）与架构（Architecture）这两个概念让大多数人十分迷惑——什么是设计？什么是架构？二者究竟有什么区别？&lt;/p&gt;
&lt;p&gt;One of the goals of this book is to cut through all that confusion and to define, once and for all, what design and architecture are. For starters, I’ll assert that there is no difference between them. None at all.&lt;/p&gt;
&lt;p&gt;本书的一个重要的目标就是要清晰、明确地对二者进行定义。首先我要明确地说，二者没有任何区别。一丁点区别都没有！&lt;/p&gt;
&lt;p&gt;The word “architecture” is often used in the context of something at a high level that is divorced from the lower-level details, whereas “design” more often seems to imply structures and decisions at a lower level. But this usage is nonsensical when you look at what a real architect does.&lt;/p&gt;</description>
    </item>
    <item>
      <title>《架构整洁之道》：AFTERWORD 后序</title>
      <link>https://dodoro.chouxiangpai.com/archives/1959/</link>
      <pubDate>Fri, 01 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://dodoro.chouxiangpai.com/archives/1959/</guid>
      <description>&lt;p&gt;My professional career as a software developer began in the 1990s, at a time when the dinosaurs of Big Architecture ruled the world. To get ahead, you had to learn about objects and components, about design patterns, and about the Unified Modeling Language (and its precursors).&lt;/p&gt;
&lt;p&gt;我的软件工程师生涯开始于 20 世纪 90 年代，那是一个恐龙级大型架构统治世界的时代。要想在那样的时代获得一席之地，我们必须学会对象及其组件、设计模式、统一建模语言（包括其前身）的相关知识。&lt;/p&gt;
&lt;p&gt;Projects—and boy, should we rue the day when we decided to call them that?—started with long design phases, where detailed blueprints for our systems were laid out by “senior” programmers for more “junior” programmers to follow. Which, of course, they didn’t. Ever.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
