انتقل إلى المحتوى
أمين أبوزيد
JNR-008

منظومة Spring

  • 5 درس
  • 1 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • Spring Framework مقابل Spring Boot مقابل Spring Data مقابل Spring Security

تعلّم أولًا

1 ساعة تدريب (تقدير)

مخرجات التعلم

  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.

الدروس

  1. 01لماذا توجد الأطر البرمجية
  2. 02عائلة Spring
  3. 03جولة في Spring Initializr
  4. 04قراءة توثيق Spring
  5. 05عرض عملي: أول تطبيق Spring Boot من Initializr إلى نقطة نهاية تعمل

المختبر والتمارين

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.
أظهر الحلول
  • 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).

الاختبار

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

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  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

الجزء العملي

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.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.