Demo: building the products feature layer by layer
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
build GET /products and GET /products/{id}; prepares JNR-013-LAB1.
Draft outline details
Step by step
- Create the
Productdomain class andProductRepositoryinterface. - Implement
InMemoryProductRepositorywith aMapand sample data. - Write
ProductServicewithlist()andget(id). - Planned mistake: put the "not found" decision and a price calculation in the controller. Fix: move both into the service; the controller only delegates.
- Write
ProductController, run the app, and call both endpoints withcurl.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.