官术网_书友最值得收藏!

Differences between an extension and a plugin

The Ext JS extensions and plugins are used for the same purpose; they add extended functionality to Ext JS classes. But they mainly differ in terms of how they are written and the reason for which they are used.

Ext JS extensions are extension classes or subclasses of Ext JS classes. To use these extensions, we need to instantiate these extensions by creating an object. We can provide additional properties, functions, and can even override any parent member to change its behavior. The extensions are very tightly coupled to the classes from which they are derived. The Ext JS extensions are mainly used when we need to modify the behavior of an existing class or component, or we need to create a fully new class or component.

Ext JS plugins are also Ext JS classes, but they include the init function. To use the plugins we don't need to directly instantiate these classes; instead, we need to register the plugins in the plugins' configuration option within the component. After adding, the options and functions will become available to the component itself. The plugins are loosely coupled with the components they are plugged in, and they can be easily detachable and interoperable with multiple components and derived components. Plugins are used when we need to add features to a component. As plugins must be attached to an existing component, creating a fully new component, as done in the extensions, is not useful.

主站蜘蛛池模板: 依兰县| 海盐县| 贵州省| 尉犁县| 景洪市| 句容市| 荥阳市| 太仓市| 本溪市| 安阳市| 繁昌县| 靖江市| 汉沽区| 成安县| 南溪县| 屏东市| 枣阳市| 韶山市| 华宁县| 搜索| 仲巴县| 西昌市| 和政县| 彰化县| 勃利县| 金华市| 保定市| 修文县| 嘉荫县| 屯昌县| 外汇| 顺平县| 四子王旗| 沙洋县| 武宁县| 龙川县| 迁西县| 金阳县| 达州市| 定州市| 铁岭市|