Difference between revisions of "Closure"
(glossary itemThe Module pattern) |
(private/public aspect of a closure) |
||
Line 1: | Line 1: | ||
{{glossary}} | {{glossary}} | ||
− | A closure is like a bubble in [[JavaScript]] in that it acts like a separate self-contained global scope, and can contain variables, functions, and even entire JavaScript frameworks like [[jQuery]]. The [[viewer]] onto the [[unified ontology]] intenernally maintains a closure for each [[node]], and many of these nodes have a visible interface aspect in the form of an associated DOM element in the page. The unified ontology viewer also allows each node to be persistent by storing them in a [[peer-to-peer]] semantic network. | + | A closure is like a bubble in [[JavaScript]] in that it acts like a separate self-contained global scope, and can contain variables, functions, and even entire JavaScript frameworks like [[jQuery]]. A closure is in the form of a function rather than an object, it's brought into existence by calling it, and is accessible via the public interface it returns. The content of the scope within the closures definition is private and exists for as long as the returned public interface exists. |
+ | |||
+ | The [[viewer]] onto the [[unified ontology]] intenernally maintains a closure for each [[node]], and many of these nodes have a visible interface aspect in the form of an associated DOM element in the page. The unified ontology viewer also allows each node to be persistent by storing them in a [[peer-to-peer]] semantic network. | ||
== See also == | == See also == |
Revision as of 17:42, 10 September 2012
A closure is like a bubble in JavaScript in that it acts like a separate self-contained global scope, and can contain variables, functions, and even entire JavaScript frameworks like jQuery. A closure is in the form of a function rather than an object, it's brought into existence by calling it, and is accessible via the public interface it returns. The content of the scope within the closures definition is private and exists for as long as the returned public interface exists.
The viewer onto the unified ontology intenernally maintains a closure for each node, and many of these nodes have a visible interface aspect in the form of an associated DOM element in the page. The unified ontology viewer also allows each node to be persistent by storing them in a peer-to-peer semantic network.