Clean Architecture: A Craftsman's Guide to Software Structure and Design
Rate it:
Open Preview
4%
Flag icon
The path we are most interested is the cleanest one. It recognizes the softness of software and aims to preserve it as a first-class property of the system.
7%
Flag icon
These developers buy into a familiar lie: “We can clean it up later; we just have to get to market first!”
8%
Flag icon
Software was invented to be “soft.” It was intended to be a way to easily change the behavior of machines. If we’d wanted the behavior of machines to be hard to change, we would have called it hardware.
9%
Flag icon
he replaced those jumps with the more familiar if/then/else and do/while/until constructs.
9%
Flag icon
Structured programming imposes discipline on direct transfer of control.
9%
Flag icon
Object-oriented programming imposes discipline on indirect transfer of control.
9%
Flag icon
Functional programming imposes discipline upon assignment.
10%
Flag icon
Notice how well those three align with the three big concerns of architecture: function, separation of components, and data management.
11%
Flag icon
“Testing shows the presence, not the absence, of bugs.”
11%
Flag icon
Structured programming forces us to recursively decompose a program into a set of small provable functions. We can then use tests to try to prove those small provable functions incorrect. If such tests fail to prove incorrectness, then we deem the functions to be correct enough for our purposes.
15%
Flag icon
OO is the ability, through the use of polymorphism, to gain absolute control over every source code dependency in the system. It allows the architect to create a plugin architecture, in which modules that contain high-level policies are independent of modules that contain low-level details. The low-level details are relegated to plugin modules that can be deployed and developed independently from the modules that contain high-level policies.
15%
Flag icon
You cannot have a race condition or a concurrent update problem if no variable is ever updated. You cannot have deadlocks without mutable locks.
16%
Flag icon
Event sourcing is a strategy wherein we store the transactions, but not the state. When state is required, we simply apply all the transactions from the beginning of time.
17%
Flag icon
SRP: The Single Responsibility Principle An active corollary to Conway’s law: The best structure for a software system is heavily influenced by the social structure of the organization that uses it so that each software module has one, and only one, reason to change.
17%
Flag icon
OCP: The Open-Closed Principle Bertrand Meyer made this principle famous in the 1980s. The gist is that for software systems to be easy to change, they must be designed to allow the behavior of those systems to be changed by adding new code, rather than changing existing code.
17%
Flag icon
LSP: The Liskov Substitution Principle Barbara Liskov’s famous definition of subtypes, from 1988. In short, this principle says that to build software systems from interchangeable parts, those parts must adhere to a contract that allows those parts to be substituted one for another.
17%
Flag icon
ISP: The Interface Segregation Principle This principle advises software designers to avoid depending on things that they don’t use.
17%
Flag icon
DIP: The Dependency Inversion Principle The code that implements high-level policy should not depend on the code that implements low-level details. Rather, details should depend on policies.
18%
Flag icon
Thus the final version of the SRP is: A module should be responsible to one, and only one, actor.
18%
Flag icon
That word “cohesive” implies the SRP. Cohesion is the force that binds together the code responsible to a single actor.
19%
Flag icon
At the level of components, it becomes the Common Closure Principle. At the architectural level, it becomes the Axis of Change responsible for the creation of Architectural Boundaries.
21%
Flag icon
will force User1 to be recompiled and redeployed, even though nothing that it cared about has actually changed.
23%
Flag icon
The source code dependencies are inverted against the flow of control—which is why we refer to this principle as Dependency Inversion.
25%
Flag icon
We are now living in the age of software reuse—a fulfillment of one of the oldest promises of the object-oriented model.
25%
Flag icon
It is not uncommon for developers to be alerted about a new release and decide, based on the changes made in that release, to continue to use the old release instead. Therefore the release process must produce the appropriate notifications and release documentation so that users can make informed decisions about when and whether to integrate the new release.
25%
Flag icon
Gather into components those classes that change for the same reasons and at the same times. Separate into different components those classes that change at different times and for different reasons.
26%
Flag icon
Gather together those things that change at the same times and for the same reasons. Separate those things that change at different times or for different reasons.
26%
Flag icon
THE COMMON REUSE PRINCIPLE Don’t force users of a component to depend on things they don’t need.
26%
Flag icon
The REP and CCP are inclusive principles: Both tend to make components larger. The CRP is an exclusive principle, driving components to be smaller. It is the tension between these principles that good architects seek to resolve.
26%
Flag icon
26%
Flag icon
Generally, projects tend to start on the right hand side of the triangle, where the only sacrifice is reuse. As the project matures, and other projects begin to draw from it, the project will slide over to the left. This means that the component structure of a project can vary with time and maturity. It has more to do with the way that project is developed and used, than with what the project actually does.