منظومة Spring
في هذه الصفحة 8 موضوعات
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
نظرة عامة
الموضوعات
- Spring Framework مقابل Spring Boot مقابل Spring Data مقابل Spring Security
تعلّم أولًا
1 ساعة تدريب (تقدير)
مخرجات التعلم
- Distinguish Spring Framework, Spring Boot, Spring Data, and Spring Security and state what each adds.
- Explain what problem Spring solves compared with wiring objects by hand.
- Generate a project with Spring Initializr and identify its parts.
الدروس
المختبر والتمارين
Lab
JNR-008-LAB1 · Shop API skeleton
Outcomes: 1–3 · Time: ~1 h
- Generate a Maven project with Spring Initializr: Java, current Boot, dependencies Web, Validation, Actuator.
- Open it in the IDE and list its parts (pom, wrapper, main class, resources, tests).
- Run it with
./mvnw spring-boot:run. - Call
/actuator/healthwith a browser orcurl. - Commit to a new
shop-apirepository 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)
| ID | Outcome | Task |
|---|---|---|
| JNR-008-EX01 | 1 | In one sentence each, state what Spring Framework, Boot, Data, and Security add. |
| JNR-008-EX02 | 2 | Take three classes that depend on each other and write the new wiring in main. List two problems that appear as classes grow. |
| JNR-008-EX03 | 3 | Generate a project; label each generated file or folder with its purpose. |
| JNR-008-EX04 | 3 | Add the Web starter, then run ./mvnw dependency:tree and name three libraries it brought (for example Tomcat, Jackson, Spring MVC). |
| JNR-008-EX05 | 1 | Place these in the right project: password hashing, @SpringBootApplication, JpaRepository, dependency injection. |
| JNR-008-EX06 | 2 | Find in the Boot docs how to change the server port; write the property. |
أظهر الحلول
- 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.xmlbuild and dependencies;mvnwwrapper;src/main/javacode with the@SpringBootApplicationclass;src/main/resourcessettings;src/testtests. - 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(orserver.port: 9090in YAML).
الاختبار
Outcomes: O1 the Spring family · O2 why Spring · O3 Initializr and project parts.
اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.
الجزء العملي
Six exercises JNR-008-EX01 to EX06 plus the lab. Pass: quiz at least 8/10, lab acceptance met.
أخطاء شائعة
Adding every starter "just in case".
التقييم
Quiz.
الصلة بالمسار الوظيفي
Orientation for the rest of the level.