Patterns tổ chức quan hệ giữa các objects: Adapter, Decorator, Facade, Proxy, Composite.
Adapter - Chuyển Đổi Interface
csharp// Bọc third-party SDK cho phù hợp với interface của bạn
public interface IPaymentGateway
{
Task<PaymentResult> ChargeAsync(decimal amount, string currency);
}
// Stripe SDK dùng API khác hoàn toàn