Introduction and Rationale
One of the many fabtastic features of YUI is that it supports sandboxing of individual modules. This means that a third-party plugin cannot interfere with core plugins in such a way that will have undesired consequences to anything using the core code.
As an example, a plugin could modify Y.Node to add a new function, or overwrite an existing function. This may be desirable for one instance of that Node, but undesirable for all others. For anyone wishing to use the additional function, they should depend upon the plugin instead which adds this functionality.
To benefit from this sandboxing fully however, we must write our YUI modules under the Y namespace.
To keep things consistent and clear, all Moodle-specific modules should be under a single Namespace. Ideally this namespace should be short, but still clear that it relates to Moodle.
The proposed namespace fits into:
The plugin_or_system_type should match the list defined in lib/classes/component.php in fetch_subsystems, with the additional 'core' subsytem used to for items within lib.
The optional component will be the plugin name where relevant
The YUI_modulename should match module name
The optional YUI_submodule should match the submodule if relevant