pattern-bridge

Decouple class hierarchies into independent abstraction and implementation layers.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/johnnystefan/test-saas-business --skill pattern-bridge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pattern-bridge
Source: https://github.com/johnnystefan/test-saas-business/tree/main/skills/design-patterns/structurals/pattern-bridge
Command: npx skills add https://github.com/johnnystefan/test-saas-business --skill pattern-bridge

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Bridge pattern stops large classes from forcing a single hierarchy by separating high-level abstractions from their platform-specific implementations, keeping both sides independently evolvable.

Core Features & Use Cases

  • Independent hierarchies: Define a stable implementation interface while letting abstractions delegate so that changes to platform providers do not ripple through core logic.
  • Refined controls: Create different abstraction subclasses for each business variant without duplicating provider-specific code.
  • Use case: Split notification sending into an abstraction that toggles between email, SMS, and push channels, or separate payment processing logic from Stripe, PayPal, and other providers.

Quick Start

Ask the pattern-bridge skill to split your notification service into an abstraction that delegates to provider-specific implementations.

Frequently Asked Questions about pattern-bridge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decouple abstraction and implementation to avoid tightly coupled class hierarchies?

To decouple abstraction and implementation, you define a shared implementation interface and a base abstraction that delegates work. This separates platform-specific logic from core business logic, allowing both hierarchies to evolve independently without tight coupling.

What is the best way to keep notification workflows platform-independent across multiple delivery channels?

Keeping notification workflows platform-independent requires splitting the service into a base abstraction that delegates to provider-specific implementations. You create refined abstractions for logic variations while delivery channels like email, SMS, and push are handled by the implementation layer.

How do I separate payment processing logic from different provider integrations?

You separate payment processing logic by applying the bridge pattern to split the abstraction from the implementation. The core processing logic delegates to a shared interface, while specific payment providers like Stripe and PayPal are implemented as independent platform-specific classes.

When should I use the bridge pattern instead of a single inheritance hierarchy?

Use the bridge pattern when large classes force a single hierarchy that couples platform providers to core logic. It is needed when you must support multiple delivery channels or providers and want both abstraction and implementation layers to remain independently evolvable.

Can I create different abstraction subclasses for business variants without duplicating provider code?

Yes, you can create refined abstraction subclasses for each business variant without duplicating provider-specific code. The base abstraction delegates work to a stable implementation interface, ensuring changes to platform providers do not ripple through your core logic.