Hello all,
There is a part in APOSD which has been bothering me for some time now:
"In an ideal world, each module would be completely independent of the
others: a developer could work in any of the modules without knowing
anything about any of the other modules. In this world, the complexity
of a system would be the complexity of its worst module. /
Unfortunately, this ideal is not achievable. Modules must work together
by calling each other's functions or methods. As a result, modules must
know something about each other. [...] The goal of modular design is to
minimize the dependencies between modules." (4.1)
I don't think that this is a good description of the ideal world; it
takes it too far. Modules that don't interact at all cannot function
together. The goal is a functioning program, and thus any ideal must
still be a functioning program.
I think that the distinction i'm trying to make is between these
two positions:
1. Dependencies are bad. Our work is to eliminate them.
2. Dependencies are essential. Our work is to identify, organize,
simplify, and clarify them.
It's not about ideal versus practical---it's about our basic
values and where they take us in the extreme.
I don't think that having to know things about other modules is a
problem. Learning about and using a good module is one of my
favorite experiences in programming. I think that the problem is
when that knowledge is difficult to acquire or use---namely,
complexity.
Even just the idea of using a module at all---"creating a
dependency"---is the essence of modularity. It's a way to manage
complexity. Perhaps i am saying that dependencies in themselves
aren't a source of complexity, but obscure dependencies are.
Many thanks for the discussion,
paul
--
You received this message because you are subscribed to the Google Groups "software-design-book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to software-design-...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/software-design-book/434e3bf2-8df5-4a52-b70b-741f139a13f0n%40googlegroups.com.
I think that the distinction i'm trying to make is between these two positions:
1. Dependencies are bad. Our work is to eliminate them.
2. Dependencies are essential. Our work is to identify, organize, simplify, and clarify them.
It's not about ideal versus practical---it's about our basic values and where they take us in the extreme.
I don't think that having to know things about other modules is a problem. Learning about and using a good module is one of my favorite experiences in programming. I think that the problem is when that knowledge is difficult to acquire or use---namely, complexity.
Even just the idea of using a module at all---"creating a dependency"---is the essence of modularity. It's a way to manage complexity. Perhaps i am saying that dependencies in themselves aren't a source of complexity, but obscure dependencies are.

--
You received this message because you are subscribed to the Google Groups "software-design-book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to software-design-...@googlegroups.com.
solution: not dependency injection but dependency extraction :)

To view this discussion visit https://groups.google.com/d/msgid/software-design-book/bbc65cb0-9a19-4c15-b054-fe7d34a61d98n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/software-design-book/bbc65cb0-9a19-4c15-b054-fe7d34a61d98n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/software-design-book/cffa0663-e034-467d-acfa-caa907dc8011n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/software-design-book/1c431138-3848-44b7-83e7-6c1e12452a78n%40googlegroups.com.
John,
Hopefully this clarifies how i see it:
On 5/18/26 11:55 PM, John Ousterhout
wrote:
Imagine two systems that are identical in every respect except one has an additional dependency not present in the other; can you identify a scenario where the system with the extra dependency is better?
Is this not what you discuss in chapter 9 of APOSD, "better together or better apart?" You give examples where a single module is better split into two modules. Thus a single dependency becomes two. "When deciding whether to combine or separate, the goal is to reduce the complexity of the system as a whole and improve its modularity."
We can separate modules (thus increasing the number of dependencies) and yet reduce complexity.
By defining a clean module we eliminate most of those dependencies, replacing them with a smaller and simpler set.
Yes. That smaller and simpler set of dependencies is good. If they were removed, we would be forced to implement the functionality that they provide within the current module.
Modules are useless without dependencies. Saying that we want no dependencies is equivalent to saying that we don't want modules.
paul
On 5/18/26 11:55 PM, John Ousterhout wrote:
Imagine two systems that are identical in every respect except one has an additional dependency not present in the other; can you identify a scenario where the system with the extra dependency is better?I'm not sure that i fully understand the question.
Is this not what you discuss in chapter 9 of APOSD, "better together or better apart?" You give examples where a single module is better split into two modules. Thus a single dependency becomes two.
"When deciding whether to combine or separate, the goal is to reduce the complexity of the system as a whole and improve its modularity."
We can separate modules (thus increasing the number of dependencies) and yet reduce complexity.
You seem to be equating "number of modules" with "number of dependencies", but a single module can introduce many dependencies. Thus, splitting a module into two modules does not necessarily increase the number of dependencies.
Module A has gone from one dependency to two.
I don't say this as a rule, but as a possible outcome.
I don't think that you've addressed my main complaint, which is "If [all external dependencies] were removed [from a module], we would be forced to implement the functionality that they provide within the current module."
paul
I don't think that you've addressed my main complaint, which is "If [all external dependencies] were removed [from a module], we would be forced to implement the functionality that they provide within the current module."