انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-010-L01

الـ ApplicationContext

  • الدرس 1 من 6
  • Junior
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

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

في هذا الدرس

explain what the container is and holds.

الموضوعات المخطط لها

  • 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.
تفاصيل المخطط المبدئي

عرض عملي

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

اختبر فهمك

Should services call getBean themselves?

أظهر الإجابة

No. Declare the dependency in the constructor.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

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

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

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