From the course: Python: Design Patterns
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Bridge - Python Tutorial
From the course: Python: Design Patterns
Bridge
- [Instructor] The bridge pattern helps untangle an unnecessarily complicated class hierarchy, especially when implementation-specific classes are mixed with implementation-independent classes. The problem here is that there are two parallel or orthogonal abstractions. One is implementation-specific and the other is implementation-independent. Our scenario involves implementation-independent circle abstraction and implementation-dependent circle abstraction. The implementation-dependent circle abstraction involves how to draw a circle. And the implementation-independent circle abstraction involves defining the properties of a circle and scaling it. Our solution is avoiding abstracting both implementation-specific and implementation-independent classes in a single class hierarchy. The abstract factory and adapter patterns are the related patterns to the bridge design pattern.
Contents
-
-
-
-
- (Locked) Decorator1m 5s
- (Locked) Decorator example4m 43s
- (Locked) Solution: Decorator1m 55s
- Proxy1m 22s
- (Locked) Proxy example5m 23s
- (Locked) Adapter48s
- (Locked) Adapter example6m 16s
- (Locked) Composite1m 21s
- (Locked) Composite example5m 25s
- Solution: Composite1m 44s
- (Locked) Bridge1m 14s
- (Locked) Bridge example5m 31s
- (Locked)
-
-
-