Javascript Design Patterns #8 - Visitor Pattern

Publié le: 07 décembre 2019
sur la chaîne: DevSage
19,339
485

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/blo...
"Design Patterns Explained Simply" Ebook: https://payhip.com/b/MLtJ

🌎 Find Me Here:

Twitter:   / realdevsage  
Ebooks: https://payhip.com/devsage
Discord:   / discord  
Merch: https://cottonbureau.com/people/devsage


Sur cette page du site, vous pouvez voir la vidéo en ligne Javascript Design Patterns #8 - Visitor Pattern durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur DevSage 07 décembre 2019, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 19,339 fois et il a aimé 485 téléspectateurs. Bon visionnage!