Skip to content
Ameen Abozaid
Planned lessonJNR-013-L07

Demo: building the products feature layer by layer

  • Lesson 7 of 8
  • Junior
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

  1. Create the Product domain class and ProductRepository interface.
  2. Implement InMemoryProductRepository with a Map and sample data.
  3. Write ProductService with list() and get(id).
  4. Planned mistake: put the "not found" decision and a price calculation in the controller. Fix: move both into the service; the controller only delegates.
  5. Write ProductController, run the app, and call both endpoints with curl.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.