الثوابت عبر الحدود
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
find the rules that must always hold across services and decide how each is protected.
الموضوعات المخطط لها
- An invariant is a statement that must stay true, such as "every captured payment has exactly one order" or "stock is never negative".
- Within one database a transaction can enforce it; across services nothing enforces it by default.
- List invariants by walking a workflow and asking what must be true after each step and after each failure.
- For each, choose: prevent it by design, detect it by checks, or repair it when broken.
تفاصيل المخطط المبدئي
عرض عملي
Table: invariant | services involved | enforced by | failure that breaks it. Example: payment captured implies order exists | payments, orders, provider | nothing yet | order insert fails after capture.
اختبر فهمك
Why do cross-service invariants need explicit design?
أظهر الإجابة
No single transaction enforces them across services.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.