views:

42

answers:

2

ExtJS have "adapter" for working with other javascript libraries. But why? Why not just use Ext Core?

UPDATE: I know it was designed for YUI. But why it need an adapter?

  • ExtJs use ExtJs namespace, almost all other framework use $, they should never conflict.
  • jQuery can work with others without any adapter. Why Extjs need it?
  • Is there any extra functionality provided by these adapters?

Am I missing anything?

+1  A: 

I know there are some people here that were part of the early ExtJS Team so they probably will have a better answer, but basically ExtJS started as an extension to YUI where it was using the YUI Library to create a set of components to use.

Then it was modified using the adapter design pattern to support people that were already using jQuery or Prototype which had a few advantages: Fewer JavaScript to load on the page (if you already used jQuery you didn't need to load the YUI library) and let coders re-use their existing skills.

I can only assume that as the set of Components evolved it became easier to write a core adapter written in an optimized way for the ExtJS set of Components, and not rely on an external library for bug fixing, etc.

I would add that personally, I feel much more comfortable using the Ext Core as the adapter even though I prefer jQuery for a lot of DOM manipulations, but I think there are less chances of facing bugs while using the components if the base adapter is Ext Core.

UPDATE -

Based on your updated question, I think what you are missing is the separation from Ext Core and ExtJS.

ExtJS - A library of JavaScript Components (mainly UI but also Data classes, themes, etc.) that allows to build Rich Internet Application.

Ext Core - A cross-browser javascript library used to enhance web pages with dynamic changes (some Dom Querying, Dom traversal/manipulation, Ajax requests, etc.)

If you want to make the comparison into the jQuery world, Ext Core = jQuery and ExtJS = jQueryUI.

Now with jQueryUI, you NEED the jQuery library with it, because jQueryUI is built on TOP of jQuery.

With ExtJS, because it was built on top of YUI originally even before Ext Core existed, you can if you want use ExtJS WITHOUT Ext Core, but with the jQuery or YUI adapter for example.

You CANNOT ust ExtJS on it's own without any of the adapters, just like you can't use jQueryUI without jQuery.

I hope this answer your question.

SBUJOLD
This about sums it up.
bmoeskau
see my updated question.
J-16 SDiZ
I updated my answer.
SBUJOLD
+1  A: 

ExtJS used to be built on top of YUI, so there were adapters created for operating with other libraries as well. I think as of version 1.1, ExtJS became a standalone framework, so these adapters are now optional. I think the adapters are now for people who are more comfortable with the basic frameworks of the other libraries, but want to use certain components of the ExtJS library (Ext's greatest strength is their UI widget toolkit, IMHO).

Take a look at this SO question too:

http://stackoverflow.com/questions/2000759/is-jquery-compatible-with-extjs

Kenny Peng
see my updated question.
J-16 SDiZ
It's not a matter of conflicts as much as the Ext-Core re-implements some basic functionality (DOM, AJAX, etc. utilities) already present in the other JavaScript toolkit libraries. Don't think of it as plugging in jQuery/YUI into ExtJS as much as exposing the ExtJS component infrastructure to jQuery/YUI. There's probably not much difference in functionality whether you use jQuery, YUI, or Ext-Core, but there are probably performance implications because of different implementations.
Kenny Peng