Why frameworks exist
On This Lesson 4 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
explain what problem a framework solves for the Shop API.
Planned topics
- Every web service needs the same plumbing: receive HTTP, create objects, connect them, read settings, handle errors.
- A library is code you call. A framework is code that calls yours.
- Without a framework you wire every object by hand with
new, and you rewrite the plumbing in each project. - Spring takes over creating and connecting objects so you write business code.
Draft outline details
Demonstration
// by hand: you build the whole chain
var repo = new InMemoryProductRepository();
var service = new ProductService(repo);
var controller = new ProductController(service);Then say: "Now imagine 60 classes."
Check your understanding
Library or framework: who calls whom?
Show answer
A framework calls your code; you call a library.
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.