I am currently learning the principles of software design, specifically Acyclic Dependencies Principle (page 18)
From the example that was given I interpreted it as: when one class in package A depends on a class in package B, then package A depends on all classes in package B as well as their dependencies (transitively)
I know that package A will be dependent on package B. But all of package B’s classes that weren’t actually depended on – I am not so sure about that. The only way that I think it could cascade as in the example is when the class that was depended on in package B actually has a dependency on some classes in package B which then have dependencies on other packages.
A package is just a namespace. Dependencies on packages don’t exist. You can depend on classes, and these classes are in a package, but that’s all. You don’t depend on all the classes of a package if you depend on one of them.
Saying that a class or package depends on another package is just a shortcut to say that it depends on at least one class of this package.