Thursday, July 2, 2015
Namespace importance:
http://higher-order.blogspot.com/2008/02/designing-clientserver-web-applications.html
http://jquery-howto.blogspot.com/2009/01/namespace-your-javascript-function-and.html
An example which utilizes 3 distinctly different sets of scripts from different organizations. We use Ext JS for enhancements, Google Analytics for tracking site usage and the native vBulletin scripts. You can see how all of this code from different sources has been included in the same page.
Namespacing is important for developers in order to organize their code and ensure that their code is not overwritten when loaded in the JavaScript interpreter. If another developer defines a variable with the same name your existing definition will be overwritten.
Because JavaScript is a functionally scoped language creating a function and/or variable which is not wrapped in another function will result in that variable being created in the global scope (window). To combat this, developers place their classes in Objects.
As the client-side JavaScript included in web applications gets larger and more advanced, organization of 3rd party code and your own code becomes increasingly important. Using namespaces will ensure your JavaScript code is safe from other code overwriting it in the global namespace.
Example grid pre-configured class,apply config, Register Grid , used as xtype
http://examples.extjs.eu/ (grid in border layout)
Extjs Vs jQuery:
ExtJs and JQuery are kind of apples and oranges. You can compare Ext Core to JQuery, and ExtJs to JQuery UI.
Ext JS is a full-fledged widget library while jQuery (not jQuery UI) and Mootools are JavaScript frameworks that help with DOM manipulation etc.
Whilst jQuery and Mootools help with the general workings of a site.
jQuery UI is a much less rich set of components.
Ext JS seems to be focussed on tables and storing data, plus manipulating it.
ExtJS as a framework wrapping around widgets/constrols.
Alternatives:
Backbase Ajax Framework,jQuery,qooxdoo
http://qooxdoo.org/demo
http://yuilibrary.com/gallery/
http://www.smartclient.com/
Do you have any advice for developers using Ext for the first time?
Ext can be used by Web Application developers who are familiar with HTML but may have little or no experience with JavaScript application development. If you are starting to build a new web application, or you are revamping an existing application, then take your time to understand the basics of the library including:
What features could we add to Ext to make building a rich application like PLANet easier in the future?
Once an application gets over a certain size, and customer releases become more frequent, the burden of testing the application starts to take its toll. An Ext supported test suite would save huge amounts of time. The current problem of test suites with Ext is being able to reliably predict the automatic ids that Ext generates for page elements. Test tools are beginning to implement support for CSS selectors to overcome this problem, but few currently exist. Ext could provide better documentation on how to build better test cases with Ext so that more time can be spent on development rather than testing.
Why did you choose Ext JS?
http://blogs.yellowfish.biz/tag/extjs/
Given the wide range of JavaScript libraries available it was important to choose the right one. We needed to choose a library that was consistent in the way that it presents information to the user, but also consistent in the way that you code using the library.
With all Ext components extending the ‘Observable’ class we had the ability to write consistent code in an event-driven manner, much like writing a desktop application, not easily achieved with other libraries. What’s more is that we knew it would work cross-browser, again something not easily achieved that saves countless hours on large projects
Given the wide range of JavaScript libraries available it was important to choose the right one. We needed to choose a library that was consistent in the way that it presents information to the user, but also consistent in the way that you code using the library.
With all Ext components extending the ‘Observable’ class we had the ability to write consistent code in an event-driven manner, much like writing a desktop application, not easily achieved with other libraries. What’s more is that we knew it would work cross-browser, again something not easily achieved that saves countless hours on large projects
Subscribe to:
Posts (Atom)
What is restrict option in directive?
The restrict option in angular directive, is used to specify how a directive will be invoked in your angular app i.e. as an attribute, class...
-
jQLite is a subset of jQuery that is built directly into AngularJS. jQLite provides you all the useful features of jQuery. In fact it provi...
-
<script type="text/javascript"> var days = new Array(); days[0] = "Sunday" days[1] = "Monday"...