• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Sybex CSG 11: Possible Erratum in the OCP Java SE 11 Developer Complete Study Guide

 
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 40685
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The setnenece in question is discussing what is logically provided for use; not about compile time dependencies.
 
Nyeng Gyang
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, this is how I read the sentence and I opine the sentence can be better written: The implementation (of the interface) is made available to a service provider using the interface. Why not, instead, say that the implementation (of the interface) is made available to a service provider interface using the class? Isn’t the implementation of an interface provided to a service provider interface, rather than provided to a service provider? My reference to compile time dependences was because the wording of your sentence suggests that the implementation (of the interface) is made available to a service provider, rather than made available to a service provider interface.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic