Skip to content
Ameen Abozaid
Planned lessonJNR-010-L01

The ApplicationContext

  • Lesson 1 of 6
  • Junior
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 the container is and holds.

Planned topics

  • The ApplicationContext is the Spring container: it creates, wires, and keeps beans.
  • A bean is just an object the container manages.
  • Startup: find bean definitions, create beans in dependency order, then the app is ready.
  • You rarely touch the context directly; you ask for dependencies in constructors.
Draft outline details

Demonstration

java
ConfigurableApplicationContext ctx = SpringApplication.run(ShopApiApplication.class, args);
ProductService s = ctx.getBean(ProductService.class); // for the demo only

Check your understanding

Should services call getBean themselves?

Show answer

No. Declare the dependency in the constructor.

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.