Learn YUI3: Difference between Plugin and Widget. Extensions!

I was reading an article and read about plugin. I came to know that plugin exists in YUI3. Then the question come to my mind what to do with plugins in YUI3. Widget are already there.

1323431369_diagram_v2-10.png

As I read here, Plugins are for atomic functionality and not for a set of functionalities. Also, important point here is that it can be used in selected instance of host (component instance). So, when we need a functionality provided by a plugin in an instance of a component , we can use that plugin. This way component will be be loaded with many functionalities.

Extensions are similar to plugins. Plugins mix and match code at instance level whereas extensions mix and match code at class level to create new classes.

Plugin or Extension?