From the course: Design Patterns in Go for Object Oriented Programming
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Adapter pattern - Go Tutorial
From the course: Design Patterns in Go for Object Oriented Programming
Adapter pattern
- [Instructor] Let's jump in and deepen our understanding of the adapter pattern. The adapter pattern is a bridge between two incompatible types. It uses one single interface and joins two different functionalities together. In the adapter pattern both sides of the connection are unaware that an adapter is being used to communicate with each other. The adapter pattern is helpful when you want to use a specific class, but it is incompatible with the rest of your code base. It is also helpful when you want to reuse subclasses that don't have common functionality but you want them to be joined together. There are two main types of ways that adapters are constructed. Object adapter and class adapter. The object adapter implements the interface of one object and then wraps the other object into itself. This structure can be implemented across all programming languages. The class adapter is where the adapter inherits…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
What are structural patterns?54s
-
(Locked)
Adapter pattern2m 6s
-
(Locked)
Implement an Adapter pattern2m 50s
-
(Locked)
Composite pattern1m 51s
-
(Locked)
Implement a Composite pattern4m 10s
-
(Locked)
Decorator pattern2m 12s
-
(Locked)
Implement a Decorator pattern3m 32s
-
(Locked)
Facade pattern1m 49s
-
(Locked)
Implement a Facade pattern4m 25s
-
-
-