---
title: "الاقتران التسلسلي"
type: "antipattern"
slug: "sequential-coupling"
url: "http://localhost:3000/ar/antipatterns/sequential-coupling.md"
description: "مشكلة تصميم في البرمجة كائنية التوجه"
---
# الاقتران التسلسلي

> مشكلة تصميم في البرمجة كائنية التوجه

في [البرمجة كائنية التوجه](https://en.wikipedia.org/wiki/Object-oriented%5Fprogramming "Object-oriented programming")، **الاقتران التسلسلي** (المعروف أيضاً بـ**الاقتران الزمني**) هو شكل من أشكال [الاقتران](https://en.wikipedia.org/wiki/Coupling%5F%28computer%5Fprogramming%29 "Coupling (computer programming)") حيث تستلزم [الكلاس](https://en.wikipedia.org/wiki/Class%5F%28computer%5Fscience%29 "Class (computer science)") استدعاء [دوالها](https://en.wikipedia.org/wiki/Method%5F%28computer%5Fscience%29 "Method (computer science)") بترتيب معين. قد يُعدّ هذا [نمطاً مضاداً](https://en.wikipedia.org/wiki/Anti-pattern "Anti-pattern")، حسب السياق.

قد تدل الدوال التي تبدأ أسماؤها بـ Init أو Begin أو Start وما شابهها على وجود اقتران تسلسلي.

كتشبيه باستخدام [السيارة كنموذج تشبيهي](https://en.wikipedia.org/wiki/Car%5Fanalogy "Car analogy")، إذا ضغط المستخدم على دواسة الغاز دون تشغيل المحرك أولاً، فإن السيارة لا تتعطل ولا تفشل ولا ترمي استثناءً - بل ببساطة تفشل في التسارع.

يمكن إعادة هيكلة **الاقتران التسلسلي** باستخدام [نمط الدالة النموذجية](https://en.wikipedia.org/wiki/Template%5Fmethod%5Fpattern "Template method pattern") للتغلب على المشكلات التي يطرحها استخدام هذا [النمط المضاد](https://en.wikipedia.org/wiki/Anti-pattern "Anti-pattern").
