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

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.

主站蜘蛛池模板: 金堂县| 余庆县| 长兴县| 和政县| 安顺市| 北票市| 新巴尔虎左旗| 章丘市| 北票市| 大竹县| 卓资县| 高安市| 娄烦县| 休宁县| 仪陇县| 聂荣县| 凤城市| 水城县| 栾城县| 郸城县| 武威市| 藁城市| 宿松县| 平安县| 东光县| 宁安市| 茌平县| 南通市| 封丘县| 来安县| 梅河口市| 四子王旗| 山阳县| 万盛区| 内黄县| 辽宁省| 玛曲县| 奉新县| 治多县| 焦作市| 汉源县|