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

الانعكاس وopens

  • الدرس 3 من 5
  • Mid-level
في هذا الدرس 4 موضوعات

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

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

في هذا الدرس

explain why frameworks need opens.

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

  • exports allows compile-time and runtime access to public types; it does not allow deep reflection on private members.
  • opens allows reflective access at runtime (including setAccessible) to a package.
  • open module opens everything; opens ... to targets specific modules.
  • Frameworks such as Spring, Hibernate, and Jackson reflect on your classes and need them opened.
  • Symptom: InaccessibleObjectException at startup.
تفاصيل المخطط المبدئي

عرض عملي

java
module com.shop.core {
    exports com.shop.core.api;
    opens com.shop.core.model to com.fasterxml.jackson.databind;
}

اختبر فهمك

Which keyword fixes an InaccessibleObjectException caused by reflection?

أظهر الإجابة

opens.

التطبيق

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

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

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

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