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

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.

主站蜘蛛池模板: 锦屏县| 白河县| 西充县| 阿拉尔市| 冀州市| 德昌县| 五台县| 西宁市| 韶关市| 镶黄旗| 扎囊县| 衡山县| 大连市| 红河县| 丰顺县| 兴海县| 泰安市| 巨鹿县| 芜湖县| 营山县| 隆德县| 宁陕县| 永年县| 黑龙江省| 江孜县| 瓮安县| 客服| 赣榆县| 东乡县| 资阳市| 威远县| 湖口县| 淮北市| 博湖县| 吉安市| 松江区| 郸城县| 宣城市| 沛县| 台湾省| 甘肃省|