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

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.

主站蜘蛛池模板: 汝南县| 林芝县| 公安县| 高青县| 南汇区| 通海县| 罗源县| 北京市| 醴陵市| 莱西市| 博野县| 辛集市| 固始县| 玛纳斯县| 新郑市| 河西区| 潜江市| 综艺| 绍兴县| 金阳县| 库车县| 武陟县| 钦州市| 双柏县| 栾城县| 葫芦岛市| 阳高县| 孟村| 乌鲁木齐县| 隆回县| 宁津县| 南召县| 新乡市| 财经| 根河市| 安康市| 莒南县| 宁河县| 忻城县| 淮滨县| 杭锦后旗|