First, I must apologize for the confusion. Stoyan’s sandbox pattern is
different than the sandbox controller I describe in my talk.
Stoyan’s sandbox pattern is about creating a scope within which you can create
variables without fear of polluting the global context (and therefore, without
fear of accidentally affecting other code). The best example is the way YUI 3
works:
YUI().use(“node”, function(Y){
//sandbox!
});
This sandbox pattern allows you to have multiple instances of YUI on the page
with assurances that they won’t affect one another.
The sandbox controller I describe in my talk is an abstraction so that modules
don’t talk directly to the core controller.
Hope this helps,
Nicholas
_____________________________________________________
Nicholas C. Zakas
Twitter: @slicknet
Blog: http://www.nczonline.net/
From: Running Turtle
Sent: Wednesday, January 05, 2011 12:59 AM
To: [email protected]
Subject: [JSMentors] Sandbox Pattern ?
Hi all,
The current thread on the Observer pattern is interesting and got me thinking
about another one that intrigued me when I was reading Javascript Patterns by
Stoyan Stefanov: the sandbox pattern.
I found this pattern both interesting and absolutely confusing for a beginner
like me. Unfortunately, except for a talk by Nicolas Zakas that vaguely
touches on it, I was not able to find any resource/article on the web that
could help me better understand the merits of this pattern.
Suggestions anybody ?
Thanks
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]