Skip to content

Commit eb33bdf

Browse files
committed
Add Chapter 11
1 parent acbde1f commit eb33bdf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* [Chapter 8 - Boundaries](#chapter8)
1212
* [Chapter 9 - Unit Tests](#chapter9)
1313
* [Chapter 10 - Classes](#chapter10)
14+
* [Chapter 11 - Systems](#chapter11)
1415

1516

1617
<a name="chapter1">
@@ -1085,3 +1086,21 @@ For most systems, change is continual. Every change subjects ys to the risk that
10851086

10861087
### Isolating from Change
10871088
Needs will change, therefore code will change. We learned in OO 101 that there are concrete classes, which contain implementation details (code), and abstract classes, which represent concepts only. A client class depending upon concrete details is at risk when those details change. We can introduce intefaces and abstract classes to help isolate the impact of those details.
1089+
1090+
<a name="chapter11">
1091+
<h1>Chapter 11 - Systems</h1>
1092+
</a>
1093+
1094+
## Separe Constructing a System from using It
1095+
1096+
*Software Systems should separate the startuo process, when the application objects are constructed and the dependencies are "wired" thogether, from the runtime logic that takes over after startup*
1097+
1098+
### Separation from main
1099+
1100+
One way to separate construction from use is simply to move all aspects of construction to `main`, or modules called by `main`, and to design the rest of the system assuming that all objects have been created constructed and wired up appropriately.
1101+
1102+
The Abstract Factory Pattern is an option for this kind of approach.
1103+
1104+
### Dependency Injection
1105+
1106+
A powerful mechanism for separating construction from use is Dependency Injection (DI), the application of Inversion of control (IoC) to dependency management. Inversion of control moves secondary responsibilities from an object to other objects that are dedicated to the purpose, thereby supporting the Single Responsibility Principle. In context of dependency management, an object should not take responsibility for instantiating dependencies itself. Instead, it, should pass this responsibility to another "authoritative" mechanism, thereby inverting the control. Because setup is a global concern, this authoritative mechanism will usually be either the "main" routine or a special-purpose *container*.

0 commit comments

Comments
 (0)