Загрузка страницы

Javascript Design Patterns #8 - Visitor Pattern

What is the Visitor pattern?
The Visitor pattern allows you to add or define new functionality to an object without changing the code for that object. The new logic resides in a external object or function called the 'visitor'.

Visitors are useful when you are trying to extend the functionality of a library or framework. If the object you want to extend provides some kind of 'accept' method that accepts a visitor object/function, you can grant the visitor object access to the receiving object's internal properties. The visitor can then modify the behavior of the receiving object. This pattern allows you to provide an easy way for clients to implement future extensions to that object.
📚Materials/References:

GitHub Code: https://github.com/pkellz/devsage/blob/master/DesignPatterns/Visitor.js
"Design Patterns Explained Simply" Ebook: https://payhip.com/b/MLtJ

🌎 Find Me Here:

Twitter: https://twitter.com/realDevSage
Ebooks: https://payhip.com/devsage
Discord: https://discord.gg/BP8wPv6raA
Merch: https://cottonbureau.com/people/devsage

Видео Javascript Design Patterns #8 - Visitor Pattern канала DevSage
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
8 декабря 2019 г. 3:20:36
00:07:38
Яндекс.Метрика