loading...

re: Design Patterns for Developers using JavaScript - Part Two VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Nice summary. I'd say that your "Module pattern" is more of a Facade, but that's more of a personal preference... the label is immaterial. I think...
 

Thank you, Mr. Miller, for the feedback, I appreciate that

Since Facade wraps a complex system to expose a simple API for the client to interact with the System, it might be confused with the Module Pattern, which also serves as a wrapper. But the Facade design pattern is often used when a system is very complex or difficult to understand because the system has a lot of dependencies. So it hides the complexities of the larger system and provides a simpler interface to the client. I will talk about the Facade Pattern when I write about the Structural Design Pattern, so let's stay in touch.

Also, about the Singleton Pattern, it was a mistake so I could create multiple instances. I have updated that by wrapping in IIFE. If you any other means of attaining that in Vannila js let me know. For Node since it uses CommonJs pattern it creates singleton anytime we load an instance of any module.

code of conduct - report abuse