-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBridge.cs
More file actions
20 lines (18 loc) · 837 Bytes
/
Bridge.cs
File metadata and controls
20 lines (18 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
namespace DesignPatterns.Structural.Bridge;
/// <summary>
/// Bridge Pattern
///
/// Intent: Decouple an abstraction from its implementation so that the two can vary independently.
///
/// When to use:
/// - When you want to avoid a permanent binding between an abstraction and its implementation
/// - When both the abstractions and their implementations should be extensible by subclassing
///
/// Real-world analogy: A TV remote — the remote (abstraction) works with any TV brand (implementation)
/// via a common interface. You can change remotes or TVs independently.
/// </summary>
// TODO: Implement Bridge
// 1. Implementation interface (e.g., IDevice)
// 2. Concrete implementations (e.g., TV, Radio)
// 3. Abstraction class that holds a reference to the implementation
// 4. Refined abstractions (e.g., AdvancedRemote)