Decorator Pattern (TypeScript Design Patterns)
With the Decorator pattern you can add behaviour to classes dynamically. In this example I'll show you how to program a system to sell Tesla cars with many options (such as Auto Pilot). Each option affects the price of the car differently and a customer can choose many options or none at all. This is exactly the kind of problem that you can solve efficiently with a Decorator pattern. Interested? Continue watching this series and learn more design patterns: https://goo.gl/e1Ab4w Are you new to TypeScript? Check out my video series to get started with TypeScript: https://goo.gl/mOEotf The code used in this video is available on GitHub: https://github.com/SavjeeTutorials/typescript-design-patterns ► About me Follow me on Twitter: https://twitter.com/savjee Check out my blog: https://www.savjee.be Subscribe to newsletter: https://goo.gl/nueDfz Like my Facebook page: https://www.facebook.com/savjee
With the Decorator pattern you can add behaviour to classes dynamically. In this example I'll show you how to program a system to sell Tesla cars with many options (such as Auto Pilot). Each option affects the price of the car differently and a customer can choose many options or none at all. This is exactly the kind of problem that you can solve efficiently with a Decorator pattern. Interested? Continue watching this series and learn more design patterns: https://goo.gl/e1Ab4w Are you new to TypeScript? Check out my video series to get started with TypeScript: https://goo.gl/mOEotf The code used in this video is available on GitHub: https://github.com/SavjeeTutorials/typescript-design-patterns ► About me Follow me on Twitter: https://twitter.com/savjee Check out my blog: https://www.savjee.be Subscribe to newsletter: https://goo.gl/nueDfz Like my Facebook page: https://www.facebook.com/savjee