You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blog/2019-04-15-inversion-of-control.html
+1-1
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ <h2>Removing cycles by inverting control</h2>
111
111
<p>There are a few ways to tackle a circular dependency. You may be able to extract a shared dependency into a separate
112
112
module, that the other two modules depend on. You may be able to create an extra module that coordinates the two modules,
113
113
instead of them calling each other. Or you can use inversion of control.</p>
114
-
<p>At the moment, each module calls each other. We can pick one of the calls (let’s say <code>A</code>‘s call to <code>B</code>) and invert
114
+
<p>At the moment, each module calls each other. We can pick one of the calls (let’s say <code>A</code>’s call to <code>B</code>) and invert
115
115
control so that <code>A</code> no longer needs to know anything about <code>B</code>. Instead, it exposes a way of plugging into its
116
116
behaviour, that <code>B</code> can then exploit. This can be diagrammed like so:</p>
117
117
<p><imgsrc="/images/why-di/plugin.png" alt="B plugging into A" /></p>
0 commit comments