This is a good article for displaying a nice clean architectural structure and separation of concerns within your deployable application, but I think it's misleading to compare this with the microservice concept you introduce at the beginning.
The services you implement in these examples are domain services within your deployable unit, not external microservices that are separately deployed and maintained. Doing so would require each microservice to have the necessary infrastructure to facilitate distributed communication between other external microservices, whether through REST, RPC, event queues, or other communication paradigms.
This could be presented as one example of a deployable microservice within the context of a shopping cart system. But in that case I think it would be misleading to name the REST resource class ShoppingCartResource since its a resource entry for the specific domain of product listings, not the shopping cart as a whole.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is a good article for displaying a nice clean architectural structure and separation of concerns within your deployable application, but I think it's misleading to compare this with the microservice concept you introduce at the beginning.
The services you implement in these examples are domain services within your deployable unit, not external microservices that are separately deployed and maintained. Doing so would require each microservice to have the necessary infrastructure to facilitate distributed communication between other external microservices, whether through REST, RPC, event queues, or other communication paradigms.
This could be presented as one example of a deployable microservice within the context of a shopping cart system. But in that case I think it would be misleading to name the REST resource class
ShoppingCartResource
since its a resource entry for the specific domain of product listings, not the shopping cart as a whole.