🍏 OBJ-C RUNES DIFFICULTY: Adept Structural

The Bridge

Decoupling the ethereal from the physical.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Bridge
ARCANUM SCHOOL: Transmutation // Subschool: Projection
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// OBJC PATTERN //
@protocol TKEnchantment <NSObject>
- (void)applyEffect;
@end

@interface TKWeapon : NSObject
@property (nonatomic, strong) id<TKEnchantment> enchantment;
- (instancetype)initWithEnchantment:(id<TKEnchantment>)enchantment;
- (void)strike;
@end
@implementation TKWeapon
- (instancetype)initWithEnchantment:(id<TKEnchantment>)enchantment {
    if (self = [super init]) { _enchantment = enchantment; }
    return self;
}
- (void)strike { [self.enchantment applyEffect]; }
@end

Bridge isolates the weapon from its magical aura, preventing an explosion of subclass hierarchies. Message passing handles the rest.

Runic Tags: #objc #bridge #structural