Skip to content
Ameen Abozaid
JNR-008

Spring ecosystem

  • 5 Lessons
  • 1 h practice (estimate)
On this page 8 topics

Overview

Topics

  • Spring Framework vs Spring Boot vs Spring Data vs Spring Security

Learn first

1 h of practice (estimate)

Learning outcomes

  1. Distinguish Spring Framework, Spring Boot, Spring Data, and Spring Security and state what each adds.
  2. Explain what problem Spring solves compared with wiring objects by hand.
  3. Generate a project with Spring Initializr and identify its parts.

Lessons

  1. 01Why frameworks exist
  2. 02The Spring family
  3. 03Spring Initializr walkthrough
  4. 04Reading Spring's documentation
  5. 05Demo: first Spring Boot app from Initializr to running endpoint

Lab and exercises

Lab

JNR-008-LAB1 · Shop API skeleton

Outcomes: 1–3 · Time: ~1 h

  1. Generate a Maven project with Spring Initializr: Java, current Boot, dependencies Web, Validation, Actuator.
  2. Open it in the IDE and list its parts (pom, wrapper, main class, resources, tests).
  3. Run it with ./mvnw spring-boot:run.
  4. Call /actuator/health with a browser or curl.
  5. Commit to a new shop-api repository with a short README.

Acceptance: runs from the terminal with ./mvnw spring-boot:run; /actuator/health returns UP; only the three starters are present.

Exercises (assessment: quiz)

IDOutcomeTask
JNR-008-EX011In one sentence each, state what Spring Framework, Boot, Data, and Security add.
JNR-008-EX022Take three classes that depend on each other and write the new wiring in main. List two problems that appear as classes grow.
JNR-008-EX033Generate a project; label each generated file or folder with its purpose.
JNR-008-EX043Add the Web starter, then run ./mvnw dependency:tree and name three libraries it brought (for example Tomcat, Jackson, Spring MVC).
JNR-008-EX051Place these in the right project: password hashing, @SpringBootApplication, JpaRepository, dependency injection.
JNR-008-EX062Find in the Boot docs how to change the server port; write the property.
Show solutions
  • EX01 Framework: container, DI, MVC. Boot: starters, auto-configuration, runnable app. Data: repositories over databases. Security: authentication, authorization, attack protection.
  • EX02 Problems: every change to a constructor forces edits in the wiring; swapping an implementation or creating test versions means editing the code; shared instances must be managed by hand.
  • EX03 pom.xml build and dependencies; mvnw wrapper; src/main/java code with the @SpringBootApplication class; src/main/resources settings; src/test tests.
  • EX04 Examples: embedded Tomcat, Jackson, spring-webmvc, spring-boot-starter-logging.
  • EX05 Security: password hashing; Boot: @SpringBootApplication; Data: JpaRepository; Framework: dependency injection.
  • EX06 server.port=9090 (or server.port: 9090 in YAML).

Quiz

Outcomes: O1 the Spring family · O2 why Spring · O3 Initializr and project parts.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1Which project provides starters and auto-configuration?O1
  2. 2Which project adds login and permission checks?O1
  3. 3Which project removes boilerplate for database repositories?O1
  4. 4The container and dependency injection belong to:O1
  5. 5The main problem Spring solves in an app with many classes:O2
  6. 6The difference between a library and a framework:O2
  7. 7What is Spring Initializr?O3
  8. 8Which file lets a project build without a local Maven installation?O3
  9. 9Which starter provides /actuator/health?O3
  10. 10Adding every starter "just in case" is a mistake because:O3

Practical part

Six exercises JNR-008-EX01 to EX06 plus the lab. Pass: quiz at least 8/10, lab acceptance met.

Common mistakes

Adding every starter "just in case".

Assessment

Quiz.

Career relevance

Orientation for the rest of the level.

Type to search levels, phases, modules and lessons.