OpenLiberty/guide-microprofile-rest-client

Content review

evelinec opened this issue · 3 comments

Intro

  • seems like the RestClientBuilder method should go first.. Agree that it's not an issue

Try what you’ll build

Writing the RESTful client interface

  • This added dependency provides the library that your code requires to implement the MicroProfile Rest Client interface.
    => The word “added” doesn’t seem necessary
    => I don’t like the mention of “your code”, but it’s optional to make a change

  • The mpRestClient-1.0 feature is also enabled in the src/main/liberty/config/server.xml file. This feature allows you to use the MicroProfile Rest Client to invoke RESTful services over HTTP in a type-safe way.
    => still don’t see why user need this very clearly. perhaps remove “over HTTP in a type-safe way” because it draws away the importance of using the MP Rest Client to invoke RESTful services. Or make it more specific that this feature is the implementation of the API in Open Liberty; then user needs it for the application to run.

  • It simulates a remote RESTful service that the inventory service tries to invoke.
    => I think it is not a simulation. It simply is the remote RESTful service the the inventory service tries to invoke. Agree that it's not an issue

  • Now, create a RESTful client interface that represents the system service, call it the SystemClient. Create the SystemClient class in the src/main/java/io/openliberty/guides/inventory/client/SystemClient.java file:
    => May be good to put it as:
    Now, create a RESTful client interface that represents the system service. To do this, create the SystemClient class in the src/main/java/io/openliberty/guides/inventory/client/SystemClient.java file:
    => the word “represents” doesn’t seem accurate here. how about “for the system service”?

  • The @dependent annotation tells the service the scope of the interface.
    => seems necessary to explain more for this annotation, especially to state why this scope annotation is used for this class.

  • I thought the “Handling exceptions..” section was to be a subsection under “Writing the RESTful client interface”?

Injecting the client with dependency injection

  • 9080 in the InventoryManager class should not be hard coded?

General:

  • Clean up the comments like “// Not Found” in the code

  • {your_ip_address} can be a hostname other than the “localhost” too. Perhaps change the name to be more generic.

Fixed by #29 #36

Under "Try what you'll build", I think for the 3 URLs, you can refer to them with their service names. Just listing them as URLs defeats the purposes, ie, not sure why we want have the http://localhost:9080/system/properties URL for a specific localhost. The way you listed the URLs in the "Building and running the application" section seems much clearer.

In the "Try what you'll build" section, it'd good to refer to the results (ie, URLs) back to the services that were introduced in the "What you'll learn" section.

Still think this one can be made clearer that the feature in the server.xml file relates to OL.

The mpRestClient-1.0 feature is also enabled in the src/main/liberty/config/server.xml file. This feature allows you to use the MicroProfile Rest Client to invoke RESTful services over HTTP in a type-safe way.
=> still don’t see why user need this very clearly. perhaps remove “over HTTP in a type-safe way” because it draws away the importance of using the MP Rest Client to invoke RESTful services. Or make it more specific that this feature is the implementation of the API in Open Liberty; then user needs it for the application to run.