الإعداد التلقائي والشروط
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
explain how Boot decides what to create.
الموضوعات المخطط لها
- Auto-configuration classes are bundled with starters and run at startup.
- Each is guarded by conditions:
@ConditionalOnClass(a library is present),@ConditionalOnMissingBean(you have not defined your own),@ConditionalOnProperty. - Result: add a library and a bean appears; define your own bean and Boot backs off.
- Nothing magic: it is ordinary
@Configurationwith conditions.
تفاصيل المخطط المبدئي
عرض عملي
@Bean
@ConditionalOnMissingBean
ObjectMapper objectMapper() { ... } // simplified shapeاختبر فهمك
What does @ConditionalOnMissingBean mean for your own bean?
أظهر الإجابة
Boot's default is skipped.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.