Draft Review
neuwerk opened this issue · 1 comments
- You will learn how to retrieve information from a remote service with MicroProfile Rest Client.
Since were talking about Rest Clients and services I think it would be more correct to introduce the learning topic as:
You will learn how to build a MicroProfile REST Client to access remote REST Services.
- In the Writing the RESTful client interface section, the code snippet for the
SystemClient
interface shows the@Dependent
,@RegisterProvider(UnknownUrlExceptionMapper.class)
and@RegisterRestClient
annotations, but later on in the Instantiating the RESTful client the guide suggests adding the@Dependent
and@RegisterRestClient
. Even though, the the same code snippet is used in both sections. In the Instantiating the RESTful client section the two annotations are explained:
@Dependent
tells the service the scope of this interface.
@RegisterRestClient
registers this interface as a RESTful client.
I think that since @Dependent
and @RegisterRestClient
are required in the earlier section, they should be introduced with the first code snippet.
- The ResponseExceptionMapper explanation is in the Writing the RESTful client interface section, but after the first code snippet is shown, so I think the
@RegisterProvider(UnknownUrlExceptionMapper.class)
annotation should be removed from that first snippet, and be added to the snippet in Instantiating the RESTful client and then an explanation of the annotation given.
I think you really means@RegisterRestClient
annotation because it is the one that registers this interface as a RESTful client.
In regards to this line in the Instantiating the RESTful client section:
@Inject
and@RestClient
implies that CDI injects an instance of the system client to the inventory service.
- I think that it would be helpful to explain that the @Inject annotation will only work when the object that it is is being injected into must be another CDI managed object like a Bean, Servlet, etc. It might not even need to be mentioned at that point, but at some point when explaining the CDI built Rest Client. The Introduction to the Rest Client that Andy McCright wrote mentions
Now we can inject the client in another managed object like this:
so something like
@Inject
and@RestClient
implies that CDI injects an instance of the system client to the inventory service. SinceInventoryManager
class is another CDI managed object (CDI requires one to inject theSystemClient
), we add it here.
That way you show the reason why you added it