posted 3 years ago
The second sentence in the note at the end of page 827 of the study guide is quite confusing indeed. Elsewhere in the study guide, the authors clearly explained that the provides keyword specifies that a module employs a class to provide an implementation of a service. In agreement with this explanation, the study guide also states thus, in the third-to-last and penultimate sentences of the last paragraph on the same page (i.e., page 827), just before the aforementioned note on that page: “Instead, we use the provides directive. This allows us to specify that we provide an implementation of the interface with a specific implementation class.”
Consider the following two points: (1) The foregoing clear and lucid explanations provided in the study guide, on the mechanism by which a module employs a class to provide an implementation of a service and (2) The fact that the arrow from the service provider interface module to the service provider module, in Figure 17.10 (on page 823), has been formally acknowledged to be amongst other errata in the study guide, because it points the wrong way. Based on these foregoing two points, shouldn’t that second sentence, in the note at the end of page 827, be more like the sentence in the point number 1, rather than be exactly the sentence in the point number 2, below:
(1.) “Instead, we have made the implementation available to a service provider interface using the class”?
(2.) “Instead, we have made the implementation available to a service provider using the interface”?
Correct me if I wrong, but the following is the way I understand how the module dependency arrow, between the service provider interface module and the service provider module in Figure 17.10, should work:
(3.) The arrow should point from the service provider module to the service provider interface module, because the former module requires a package provisioned in the latter module.
(4.) The arrow should not point from the service provider interface module to the service provider module, even though the latter module employs a class to provide an implementation of a service provisioned in the former module, because the direction of a dependency arrow specifies that a module requires another module, rather than specifies that a module provides an implementation of a service provisioned in another module.