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

عرض عملي: بناء @Timed مصغّر باستخدام وكيل

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

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

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

في هذا الدرس

build an annotation-driven interceptor; prepares MID-009-LAB1.

تفاصيل المخطط المبدئي

خطوة بخطوة

  1. Define @Timed (RUNTIME, METHOD) and an interface PriceService with an implementation.
  2. Write a Proxy.newProxyInstance handler that checks the annotation on the target method and logs elapsed time.
  3. Call through the proxy; see the timing log.
  4. Planned mistake: annotate only the interface method and read the annotation from the implementation class (not found). Fix: look up the annotation on the target class method (and note Spring's own lookup rules).
  5. Add an internal call between two methods; show it is not timed (self-invocation).
  6. Discuss reflection cost and caching Method lookups.

التطبيق

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

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

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

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