FACTOID # 90: Russia has almost twice as many judges and magistrates as the United States. Meanwhile, the United States has 8 times as much crime.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > AJILE

AJILE, pronounced "Agile", is the Advanced JavaScript Importing & Loading Extension.

Ajile

Ajile's Official Site
Maintainer: Michael A. I. Lee
Latest release: 0.6.5 / September 11th, 2006
OS: Cross-platform
Use: JavaScript
License: MPL 1.1 / LGPL 2.1 / GPL 2.0
Website: ajile.iskitz.com

Ajile is an open-source JavaScript module that extends the JavaScript language with the namespace support it does not inherently provide. Image File history File links Ajile. ... In software engineering, software maintenance is the process of enhancing and optimizing deployed software (software release), as well as remedying defects. ... A software release refers to the creation and availability of a new version of a computer software product. ... September 11 is the 254th day of the year (255th in leap years). ... 2006 (MMVI) is a common year starting on Sunday of the Gregorian calendar. ... To meet Wikipedias quality standards, this article or section may require cleanup. ... A cross-platform (or platform independent) programming language, software application or hardware device works on more than one system platform (e. ... JavaScript is the name of Netscape Communications Corporations implementation of ECMAScript, a scripting programming language based on the concept of prototypes. ... A software license is a legal agreement which may take the form of a proprietary or gratuitous license as well as a memorandum of contract between a producer and a user of computer software. ... MPL may refer to: Mozilla Public License MPL Communications This is a disambiguation page — a navigational aid which lists other pages that might otherwise share the same title. ... GNU logo The GNU Lesser General Public License (formerly the GNU Library General Public License) is an FSF approved Free Software license designed as a compromise between the GNU General Public License and simple permissive licenses such as the BSD license and the MIT License. ... The GNU logo For other uses of GPL, see GPL (disambiguation). ... Website - Wikipedia, the free encyclopedia /**/ @import /skins-1. ... Open source software refers to computer software available with its source code and under an open source license. ... JavaScript is the name of Netscape Communications Corporations implementation of ECMAScript, a scripting programming language based on the concept of prototypes. ... In many programming languages, a namespace is a context for identifiers. ...


Ajile allows developers to create JavaScript modules with unique namespaces and clearly defined dependencies. These scripts can be automatically loaded and/or imported as necessary for reuse and interoperability.

Contents


Defining a Namespace

Ajile provides the Namespace directive for defining namespaces. The following example demonstrates its use:

 Namespace ("com.iskitz.ajile.examples"); com.iskitz.ajile.examples.NamespaceExample = function() { alert("This is the NamespaceExample!"); }; 

In the above example the com.iskitz.ajile.examples namespace is created and the NamespaceExample module is added to it. A reversed domain name is used as the namespace to assure that the module is uniquely named. The ability to uniquely identify modules is especially important when using multiple modules from varied sources within the same page or site. It has been suggested that this article or section be merged into Domain Name System. ...


When working with modules within an Intranet or non-Internet environment, it may be sufficient to use simpler namespaces. Ajile provides the flexibility to create as simple or as complex a namespace as desired. An intranet is a private computer network that uses Internet protocols, network connectivity, and possibly the public telecommunication system to securely share part of an organizations information or operations with its employees. ...


Namespace Importing

As effective as namespaces can be in promoting interoperability, they can complicate development by requiring the use of long module names. Ajile addresses this issue by providing the Import directive.


The Import directive provides these key benefits:

  • Simple names to reference uniquely named JavaScript modules.
  • Simple definition of JavaScript module dependencies.
  • Simple programmatic loading of external JavaScript modules.

Example

The following code demonstrates how the Import directive is used:

 Import ("com.iskitz.ajile.examples.Complex"); function testImport() { var complex = new Complex(); complex.sayHello(); } 

The Import directive in the code above indicates that there is a dependency that must be imported. The externally defined com.iskitz.ajile.examples.Complex.js JavaScript module is automatically imported and made accessible via its short name, Complex. The imported Complex module is then used by the testImport function.


Complex Module

The following is the content of the Complex module:

 Namespace ("com.iskitz.ajile.examples"); Import ("com.iskitz.ajile.examples.Simple"); com.iskitz.ajile.examples.Complex = function() { var simple = new Simple(); this.sayHello = function sayHello() { var message = "Hello World!nnThis is a " + this.toString() + " object that imported and isnusing a " + simple.toString() + " object!"; alert(message); }; this.toString = function toString() { return "[Complex]"; }; }; 

The Import directive in the code above automatically imports the externally defined com.iskitz.ajile.examples.Simple.js JavaScript module then makes it available via its short name Simple.


Simple Module

The following is the content of the Simple module:

 Namespace ("com.iskitz.ajile.examples"); com.iskitz.ajile.examples.Simple = function() { this.toString = function toString() { return "[Simple]"; }; }; 

Namespace Importing with Aliases

When importing multiple modules it is possible to encounter naming conflicts. Ajile provides the ImportAs directive as a solution to this problem.


The ImportAs directive provides two benefits in addition to those provided by the Import directive:

  • Flexibility to import a module using any un-used short name.
  • Ability to handle naming conflicts by assigning aliases to similarly named modules.

Example

The following code demonstrates how the ImportAs directive can be used to handle module naming conflicts:

 Import ("com.iskitz.ajile.examples.Complex"); ImportAs ("AComplex", "com.iskitz.ajile.examples.ambiguity.Complex"); function testAmbiguity() { var complex = new Complex(); complex.sayHello(); var aComplex = new AComplex(); aComplex.sayHello(); return false; } 

In the code above two modules with identical short names Complex are imported. The Import directive automatically imports the externally defined com.iskitz.ajile.examples.Complex.js JavaScript module as is. The ImportAs directive also automatically imports the externally defined com.iskitz.ajile.examples.ambiguity.Complex.js JavaScript module but performs the extra step of assigning it the AComplex alias.


By assigning the AComplex alias to the imported com.iskitz.ajile.examples.ambiguity.Complex module, the testAmbiguity() function is able to reference both modules without encountering any naming conflicts.


AComplex Module

The following is the content of the AComplex module:

 Namespace ("com.iskitz.ajile.examples.ambiguous"); Import ("com.iskitz.ajile.examples.Simple"); com.iskitz.ajile.examples.ambiguous.Complex = function() { var simple = new Simple(); this.sayHello = function sayHello() { var message = "Hello World!nnThis is an ambiguous " + this.toString() + " object thatnimported and is using a " + simple.toString() + " object!"; alert(message); }; this.toString = function toString() { return "[Complex]"; }; }; 

External links


  Results from FactBites:
 
AJILE - Wikipedia, the free encyclopedia (501 words)
AJILE, pronounced "Agile", is the Advanced JavaScript Importing and Loading Extension.
Ajile is an open-source JavaScript module that extends the JavaScript language with the namespace support it does not inherently provide.
Ajile provides the flexibility to create as simple or as complex a namespace as desired.
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m