From the course: C#: Design Patterns Part 1

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Overview of the structural patterns for C#

Overview of the structural patterns for C# - Python Tutorial

From the course: C#: Design Patterns Part 1

Overview of the structural patterns for C#

- [Instructor] Let's move on to the structural patterns. The first is the adapter. It converts one interface into another. It lets classes expecting different interfaces work together just like an adapter to that old projector from your new laptop. Just because I have a new laptop doesn't mean that I need to replace the projector. The adapter can be used at the class level adapting types, but it can also be used at the object level where the adapter contains the object that it's adapting. A common use case for the adapter is a data mapper, like creating view models or command models from a shared or generalized data model. We'll explore that later. The bridge pattern allows an abstraction to change independently from a concrete implementation. It's like the adapter, but rather than being focused on bringing existing classes to a place where they can interoperate, it allows for a future state where an abstract class can use…

Contents