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

العمارة السداسية

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

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

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

في هذا الدرس

place the domain at the centre and push frameworks to the edge.

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

  • Ports are interfaces owned by the domain; adapters implement them for a technology.
  • Driving (inbound) side: REST controller calls an inbound port (use case).
  • Driven (outbound) side: the domain calls an outbound port (PaymentGateway); an adapter talks to the real provider.
  • The dependency rule: adapters depend on the domain, never the reverse.
  • Payoff: unit-test the domain without Spring, swap adapters freely.
  • Do not add an interface where no boundary exists.
تفاصيل المخطط المبدئي

عرض عملي

java
// domain: no Spring, no JPA imports
public interface PaymentGateway { PaymentResult charge(OrderId id, Money amount); }

// adapter (infrastructure)
@Component class StripePaymentAdapter implements PaymentGateway { ... }

اختبر فهمك

Who owns the PaymentGateway interface, the domain or the adapter?

أظهر الإجابة

The domain.

التطبيق

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

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

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

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