Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Core Logic - Question #2
In app.core the define function creates a var called 'temp' and runs the constructor. I don't understand why app.f.define is passed in as a parameter when the following check will work without it.
temp = constructor();
Perhaps I am not understanding the bigger picture here. Is this simply a matter of good practice?
Any help appreciated!
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
... looks like Addy tried to encapsulate mediator (publish, subscribe system) and DOM specific methods (HTML elements find, query, bind,unbind, etc) into facade object 'f' and pass it into each module during its "installation" inside core.define method. This facade pattern allows modules to use libraries like JQuery, Dojo etc in one single interface... so they can be changed in any time..