Hi, > >>>> $.dimensions = {}; > >>> > >>> OK, here we use $package('dimensions',{}) with jsPax - not really more > >>> complicated. > >> > >> Yeah, but I don't see that we actually gain anything that way. > > > > 1. If you use Stuff like $.dimensions = {}; You pollute the jQuery > > internal namespace. Maybe use something like $.plugins.dimensions = {}. > > That is a good point, but putting plugins into the $.plugins namespace > doesn't seem to help that much.
Well, it doesn't disturbe jQuery itsself. Just imageine a plugin called "foobar" that creates functions "jQuery.foo()" and "jQuery.bar()". Then another Plugin creates "jQuery.barbar()" but for some strange reason that plugin is named "bar". When you put the plugin names directly in jQuery, the second plugin will overwrite the function "jQuery.bar()" from the first one and a check for the second plugin will succeed even if only the first one is available. When you use "jQuery.plugins" you only need to make shure, that the plugins have different names and not care if plugin names clash with other function or variable names. You can e.g. do that by encouraging people to use Plugin names like java packages, e.g. "org.jquery.ajax". > From what I understood, so far the OpenAjax spec just manages a > different global namespace, or is there any more to it? From <http://openajax.org/OpenAjax Hub.html>: ---- The following are the major features that are included in OpenAjax Hub 1.0: 1. Ajax library loading and unloading control - The Hub provides APIs for registering libraries, unregistering libraries, and querying about previously registered libraries. 2. Techniques and tools to minimize JavaScript object collision - The Hub provides for managing the global objects that are added to the JavaScript runtime environment by Ajax libraries, thereby helping to minimize JavaScript objection collisions. 3. Load and Unload Event Manager - The Hub provides APIs and mediates processing of 'load' and 'unload' event handlers on the <body> element to ensure that event handlers from different Ajax libraries do not collide with each other and are invoked at the appropriate time. 4. Publish/Subscribe Event Hub - The Hub provides an event hub using a publish/subscribe approach allows libraries to publish and subscribe to events in a reliable manner in order to coordinate actions across components from different Ajax libraries. 5. Markup scanner - The Hub provides APIs and logic to controls markup scanning and dispatching of particular elements for processing by particular libraries. At initialization time, Ajax libraries identify to the Hub the pattern matching criteria for the markup that the given library controls. When the Hub scans the document, whenever it encounters markup that matches the criteria, it invokes the library's appropriate callback function. ---- Christof