Brandon Aaron schrieb:
> Maybe I can make more sense today ... hopefully. Lets say I had a
> plugin that depended on this plugin and I changed the defaults in my
> plugin. Now when the developer includes my plugin, the defaults have
> been changed and the expected behavior of the plugin is different.
> That would be very frustrating as a plugin developer and a developer
> using the plugins.
>
> My plugin:
> ...
> jQuery.hoverIntent.defaults = { sensitivity: 10, interval 500 };
> ...
>
> Now, my plugin depends on those "defaults" and the developer has
> changed the defaults to something completely different. Of course as a
> plugin developer I could *not* depend on the defaults but they
> shouldn't be called defaults then. I believe it is best to keep the
> defaults internal and not allow others to change the defaults for all
> implementations of the plugin. It could also be a problem if the
> defaults have been changed on a very big project with lots of
> developers. I don't think it is a good idea to have a general
> setDefaults function either unless it was per an instance based, not
> global for the plugin.
>
> Hopefully that made more sense.
>   
Yep, it does. I understand the issue you are referring to, but don't see 
that as critical.

A simple example: Validation plugin depends (by default) on metadata 
plugin. It doesn't care how the metadata plugin is configured, as long 
as it works as expected.

So the trick should be to allow customization without breaking dependend 
plugins.

-- 
Jörn Zaefferer

http://bassistance.de


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to