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

أحداث المجال

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

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

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

في هذا الدرس

record that something happened in the domain.

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

  • A domain event is a fact in the past tense: OrderPlaced, OrderCancelled.
  • The aggregate raises events as part of a state change; other code reacts.
  • Events are immutable and carry the aggregate ID and time.
  • Within a service they decouple side effects; to leave the service they become integration events (MID-026, MID-029).
  • Do not publish before the state change is saved.
تفاصيل المخطط المبدئي

عرض عملي

Order.place() adds new OrderPlaced(id, Instant.now()) to an internal list that the application service publishes after saving.

اختبر فهمك

Why past tense?

أظهر الإجابة

An event states a fact that already happened.

التطبيق

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

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

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

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