Google
 

Friday, January 19, 2007

Ajax (programming)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
For other uses, see Ajax (disambiguation).
Ajax, shorthand for Asynchronous JavaScript and XML, is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user requests a change. This is meant to increase the web page's interactivity, speed, and usability.
The Ajax technique uses a combination of:
XHTML (or HTML) and CSS, for marking up and styling information.
The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript, to dynamically display and interact with the information presented.
The XMLHttpRequest object is used to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server, and in other implementations, dynamically added <script> tags may be used.
XML is sometimes used as the format for transferring data between the server and client, although any format will work, including preformatted HTML, plain text, JSON and even EBML. These files may be created dynamically by some form of server-side scripting.
Like DHTML, LAMP and SPA, Ajax is not a technology in itself, but a term that refers to the use of a group of technologies.
Contents[hide]
1 History
2 Justification
3 Pros and cons
3.1 Pros
3.1.1 Bandwidth utilization
3.1.2 User interface
3.1.3 Separation of Data, Format, Style, and Function
3.2 Cons
3.2.1 Browser integration
3.2.2 Response-time concerns
3.2.3 Search Engine Optimization
3.2.4 Javascript reliability
4 Accessibility
5 See also
6 References
7 External links
//

[edit] History
The first use of the term in public was by Jesse James Garrett in February 2005[1]. Garrett thought of the term when he realized the need for a shorthand term to represent the suite of technologies he was proposing to a client[2].
Although the term "Ajax" was coined in 2005, most histories of the technologies that enable Ajax start a decade earlier with Microsoft's initiatives in developing Remote Scripting. Techniques for the asynchronous loading of content on an existing Web page without requiring a full reload date back as far as the IFRAME element type (introduced in Internet Explorer 3 in 1996) and the LAYER element type (introduced in Netscape 4 in 1997, abandoned during early development of Mozilla). Both element types had a src attribute that could take any external URL, and by loading a page containing JavaScript that manipulated the parent page, Ajax-like effects could be attained. This set of client-side technologies was usually grouped together under the generic term of DHTML. Macromedia's Flash could also, from version 4, load XML and CSV files from a remote server without requiring a browser refresh.
Microsoft's Remote Scripting (or MSRS, introduced in 1998) acted as a more elegant replacement for these techniques, with data being pulled in by a Java applet with which the client side could communicate using JavaScript. This technique worked on both Internet Explorer version 4 and Netscape Navigator version 4 onwards. Microsoft then created the XMLHttpRequest object in Internet Explorer version 5 and first took advantage of these techniques using XMLHttpRequest in Outlook Web Access supplied with the Microsoft Exchange Server 2000 release.
The Web development community, first collaborating via the microsoft.public.scripting.remote newsgroup and later through blog aggregation, subsequently developed a range of techniques for remote scripting in order to enable consistent results across different browsers. In 2002, a user-community modification[3] to Microsoft Remote Scripting was made to replace the Java applet with XMLHttpRequest.
Remote Scripting Frameworks such as ARSCIF[4] surfaced in 2003 not long before Microsoft introduced Callbacks in ASP.NET[5].
In addition, the World Wide Web Consortium has several Recommendations that also allow for dynamic communication between a server and user agent, though few of them are well supported. These would include:
The object element defined in HTML 4 for embedding arbitrary content types into documents, (replaces inline frames under XHTML 1.1)
The Document Object Model (DOM) Level 3 Load and Save Specification [1]

[edit] Justification
The core justification for AJAX style programming is to overcome the page loading requirements of HTML/HTTP-mediated web pages. AJAX creates the necessary initial conditions for the evolution of complex, intuitive, dynamic, data-centric user interfaces in web pages - the realization of that goal is still a work in progress.
Web pages, unlike native applications, are loosely coupled, meaning that the data they display are not tightly bound to data sources and must be first marshalled into an HTML page format before they can be presented to a user agent on the client machine. For this reason, web pages have to be re-loaded each time a user needs to view different datasets. By using the XmlHttpRequest object to request and return data without a re-load, a programmer by-passes this requirement and makes the loosely coupled web page behave much like a tightly coupled application, but with a more variable lag time for the data to pass through a longer "wire" to the remote web browser.
For example, in a classic desktop application, a programmer has the choice of populating a tree view control with all the data needed when the form initially loads, or with just the top-most level of data - which would load quicker, especially when the dataset is very large. In the second case, the application would fetch additional data into the tree control depending on which item the user selects. This functionality is difficult to achieve in a web page without AJAX. To update the tree based on a user's selection would require the entire page to re-load, leading to a very jerky, non-intuitive feel for the web user who is browsing the data in the tree.

[edit] Pros and cons

[edit] Pros

[edit] Bandwidth utilization
By generating the HTML locally within the browser, and only bringing down JavaScript calls and the actual data, Ajax web pages can appear to load relatively quickly since the payload coming down is much smaller in size. An example of this technique is a large result set where multiple pages of data exist. With Ajax, the HTML of the page, e.g., a table control and related TD and TR tags can be produced locally in the browser and not brought down with the first page of the document.
In addition to "load on demand" of contents, some web based applications load stubs of event handlers and then load the functions on the fly. This technique significantly cuts down the bandwidth consumption for web applications that have complex logic and functionality.

[edit] User interface
The most obvious reason for using Ajax is an improvement to the user experience. Pages using Ajax behave more like a standalone application than a typical web page. Clicking on links that cause the entire page to refresh feels like a "heavy" operation. With Ajax, the page often can be updated dynamically, allowing a faster response to the user's interaction. While the full potential of Ajax has yet to be determined, some believe it will prove to be an important technology, helping make the web even more interactive and popular than it currently is.

[edit] Separation of Data, Format, Style, and Function
A less specific benefit of the AJAX approach is that it tends to encourage programmers to clearly separate the methods and formats used for the different aspects of information delivery via the web. Although AJAX can appear to be a jumble of languages and techniques, and programmers are free to adopt and adapt whatever works for them, they are generally propelled by the development motif itself to adopt separation between: (1) the raw data or content to be delivered - which is normally embedded in XML and sometimes derived from a server-side database; (2) the format or structure of the webpage - which is almost always built in HTML (or better, XHTML) and is then reflected and made available to dynamic manipulation in the DOM; (3) the style elements of the webpage - everything from fonts to picture placement - are derived by reference to embedded or referenced CSS; and (4) the functionality of the web page is provided by a combination of (A) Javascript on the client browser (also called DHTML), (B) Standard HTTP and XMLHttp for client-to-server communication, and (C) server-side scripting and/or programs utilizing any suitable language preferred by the programmer to receive the client's specific requests and respond appropriately.

[edit] Cons

[edit] Browser integration
The dynamically created page does not register itself with the browser history engine, so triggering the "Back" function of the users' browser might not bring the desired result.
Developers have implemented various solutions to this problem. These solutions can involve using invisible IFRAMEs to invoke changes that populate the history used by a browser's back button. Google Maps, for example, performs searches in an invisible IFRAME and then pulls results back into an element on the visible web page. The World Wide Web Consortium (W3C) did not include an iframe element in its XHTML 1.1 Recommendation; the Consortium recommends the object element instead.
Another issue is that dynamic web page updates make it difficult for a user to bookmark a particular state of the application. Solutions to this problem exist, many of which use the URL fragment identifier (the portion of a URL after the '#' [6] [7]) to keep track of, and allow users to return to, the application in a given state. This is possible because many browsers allow JavaScript to update the fragment identifier of the URL dynamically, so that Ajax applications can maintain it as the user changes the application's state. This solution also improves back-button support. It is, however, not a complete solution.

[edit] Response-time concerns
Network latency — or the interval between user request and server response — needs to be considered carefully during Ajax development. Without clear feedback to the user [8], smart preloading of data and proper handling of the XMLHttpRequest object, users might experience delay in the interface of the web application, something which users might not expect or understand. Additionally, when an entire page is rendered there is a brief moment of re-adjustment for the eye when the content changes. The lack of this re-adjustment with smaller portions of the screen changing makes the latency more apparent. The use of visual feedback (such as throbbers) to alert the user of background activity and/or preloading of content and data are often suggested solutions to these latency issues.
In general the potential impact of latency has not been "solved" by any of the open source Ajax toolkits and frameworks available today, such as the effect of latency variance over time.

[edit] Search Engine Optimization
Websites that use Ajax to load data which should be indexed by search engines must be careful to provide equivalent data at a public, linked URL and in a format that the search engine can read, as search engines do not generally execute the JavaScript code required for Ajax functionality. This problem is not specific to Ajax, as the same issue occurs with sites that provide dynamic data as a full-page refresh in response to, eg, a form submit (the general problem is sometimes called the hidden web).

[edit] Javascript reliability
Ajax relies on Javascript, which may be implemented differently by different browsers or versions of a particular browser. Because of this, sites that use Javascript may need to be tested in multiple browsers to check for compatibility issues. It's not uncommon to see a Javascript code written twice, a part for IE, a part for Mozilla compatibles. (see also Cross-platform web design).

[edit] Accessibility
Using Ajax technologies in web applications provides many challenges for developers interested in adhering to WAI accessibility guidelines. In addition there are numerous development groups working on USA government projects which require strict adherence to Section 508 Compliance standards. Failure to comply with these standards can often lead to cancellation of contracts or lawsuits intended to ensure compliance.
Because of this, developers need to provide fallback options for users on other platforms or browsers, as most methods of Ajax implementation rely on features only present in desktop graphical browsers.
Web developers use Ajax in some instances to provide content only to specific portions of a web page, allowing data manipulation without incurring the cost of re-rendering the entire page in the web browser. Non-Ajax users would ideally continue to load and manipulate the whole page as a fallback, allowing the developers to preserve the experience of users in non-Ajax environments (including all relevant accessibility concerns) while giving those with capable browsers a much more responsive experience.

[edit] See also
Ajax framework
Comet (programming)
HTTP streaming
Progressive enhancement
Reverse Ajax
Rich Internet application
Single page application
Web 2.0
XMLHttpRequest
Gmail

[edit] References
^ Ajax: A New Approach to Web Applications. Adaptive Path (2005-02-18). Retrieved on 2006-08-01.
^ At subsequent talks and seminars Garrett has made the point that Ajax is not an acronym.
^ HTTPRequest-enabled RS. microsoft.public.scripting.remote newsgroup (2002-06-18). Retrieved on 2006-08-01.
^ ARSCIF: A Framework for Asynchronous Remote–Script Callback Invocation. Sebastiano Vigna. Retrieved on 2006-08-01.
^ Cutting Edge: Script Callbacks in ASP.NET. MSDN Magazine (2004-08-08). Retrieved on 2006-08-01.
^ Uniform Resource Identifiers (URI): Generic Syntax. The Internet Society (August 1998). Retrieved on 2006-07-21.
^ Uniform Resource Identifier (URI): Generic Syntax. The Internet Society (January 2005). Retrieved on 2006-07-21.
^ Remote Scripting with AJAX, Part 2. O'Reilly XML.com (2005-08-22). Retrieved on 2006-07-21.

[edit] External links
AJAX category on the Open Directory Project.
Articles
Jesse James Garrett. “Ajax: A New Approach to Web Applications”, Adaptive Path
Tutorials
Ajax:Getting Started by Mozilla Developer Center.
Ajax Tutorial with get, post, text and XML examples.
Presentation on Ajax Security issues given at the Black Hat security conference.
Retrieved from "http://en.wikipedia.org/wiki/Ajax_%28programming%29"

Saturday, January 6, 2007

JavaScript

JavaScript is the name of Netscape Communications Corporation's implementation of the ECMAScript standard, a scripting language based on the concept of prototype-based programming. The language is best known for its use in websites (as client-side JavaScript), but is also used to enable scripting access to objects embedded in other applications.
Despite the name, JavaScript is only distantly related to the Java programming language, the main similarity being their common debt to the C syntax. Semantically, JavaScript has far more in common with the Self programming language.
JavaScript is a registered trademark of Sun Microsystems, Inc. It was used under license for technology invented and implemented by Netscape Communications and current entities such as the Mozilla Foundation.[1]

Ajax

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Contents[hide]
1 Mythology and literature
2 Sport
3 Vehicles
4 Fiction
5 Music
6 Places
7 Other uses
//
Ajax can refer to:

[edit] Mythology and literature
Ajax (mythology), also known as Telamonian Ajax or Ajax the Great, a Greek hero and legendary king of Salamis who plays an important role in Homer's Iliad
Ajax the Lesser, or Oilean Ajax, a Greek hero and legendary king of Locris who appears in Homer's Iliad
Ajax (Sophocles), a tragedy by the Greek playwright Sophocles, whose main character is Telamonian Ajax

[edit] Sport
Ajax America, also known as Ajax Orlando, an American soccer team from Orlando, Florida
Ajax Amsterdam, an association football club from Amsterdam, the Netherlands
Ajax Cape Town, a South African association football club
Ajax Kenitra, a Moroccan futsal (indoor football) club
Ajax (horse), a champion Australian racehorse of the 1930s
Rabat Ajax, a Maltese football club
Ajax Skoteras, a Greek football team from "Skotera" village in Aitoloakarnania, Greece
Ajax Sportman Combinatie (ASC), a cricket and football club in Leiden, The Netherlands

[edit] Vehicles
Ajax (1906 automobile), Aigner, Switzerland
Ajax (1913 automobile), Briscoe, France
Ajax (1921 automobile), prototype, U.S.
Ajax (automobile), Nash Motors, 1925–1926, U.S.
HMS Ajax, several ships of the Royal Navy
USS Ajax, several ships of the United States
Ajax (1860 locomotive), one of the eight South Devon Railway Dido class steam locomotives, in service 1860-1884
Ajax (1927 locomotive), a LMS Royal Scot Class express locomotive, in service 1927-1962

[edit] Fiction
Ajax (Mickey Mouse), a fictional company (the Disney eqivalent of Acme).
Ajax Duckman, a character in the animated television series Duckman
Martian Manhunter, a comic superhero called Ajax in Brazil

[edit] Music
Ajax (band), from New York City
Ajax Records (Chicago), a record label
Ajax Records (Quebec), a record label active in the 1920s

[edit] Places
Ajax, Ontario, Canada
Aspen Mountain (Colorado), also known as Ajax Mountain

[edit] Other uses
Ajax (programming) (Asynchronous JavaScript and XML), a technique used in web application development
Ajax (arcade game), a 1987 shoot 'em up arcade game released by Konami
Ajax cleanser, a household cleaner
Operation Ajax, a 1953 Anglo-American covert operation to overthrow the government of Iran
Apatosaurus ajax, the type species of the Apatosaurus genus of sauropod dinosaurs
Nike Ajax, an American anti-aircraft missile system
1404 Ajax, an asteroid
Ajax, an early flush toilet invented in England in 1596
Ajax, a name belonging to two Marvel Comics characters

MySQL

From Wikipedia, the free encyclopediaMySQL (pronounced /mɑɪ ɛs kʏuː ɛl/) is a multithreaded, multi-user, SQL Database Management System (DBMS) with more than six million installations.[1]
MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, which holds the copyright to most of the codebase. This is similar to the JBoss model and how the Free Software Foundation handles copyright in its projects, and dissimilar to how the Apache project does it, where the software is developed by a public community, and the copyright to the codebase is owned by its individual authors.
The company develops and maintains the system, selling support and service contracts, as well as proprietary-licensed copies of MySQL, and employing people all over the world who collaborate via the Internet. MySQL AB was founded by David Axmark, Allan Larsson, and Michael "Monty" Widenius.
The MySQL company also sells another DBMS, MaxDB, which is from an unrelated codebase.

PHP

From Wikipedia, the free encyclopedia
PHP (PHP: Hypertext Preprocessor) is a reflective programming language originally designed for producing dynamic Web pages.[1] PHP is used mainly in server-side application software, but can be used from a command line interface or in standalone graphical applications.
PHP competes with other programming languages such as Perl, Ruby, and Python; as of December 2006, it is ranked 5th, down from 4th last year, by TIOBE Programming Community Index. The rankings are based on world wide availability of practitioners, courses and vendors.[2]
The sole implementation is produced by The PHP Group and released under the PHP License. It is considered to be free software by the Free Software Foundation. This implementation serves to define a de facto standard for PHP, as there is no formal specification.
History
PHP was written as a set of CGI binaries in the C programming language by the Danish-Canadian programmer Rasmus Lerdorf in 1994, to replace a small set of Perl scripts he had been using to maintain his personal homepage.[3] Lerdorf initially created PHP to display his résumé and to collect certain data, such as how much traffic his page was receiving. "Personal Home Page Tools" was publicly released on June 8, 1995 after Lerdorf combined it with his own Form Interpreter to create PHP/FI (this release is considered PHP version 2).[4][5]
Zeev Suraski and Andi Gutmans, two Israeli developers at the Technion - Israel Institute of Technology, rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism "PHP: Hypertext Preprocessor". The development team officially released PHP/FI 2 in November 1997 after months of beta testing. Public testing of PHP 3 began immediately and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999.[6] They also founded Zend Technologies in Ramat Gan, Israel, which actively manages the development of PHP.
In May 2000, PHP 4, powered by the Zend Engine 1.0, was released. The latest version as of December 2006 is 4.4.4. PHP 4 is currently still supported by security updates for those applications that require it.
On July 13, 2004, PHP 5 was released, powered by the new Zend Engine II. PHP 5 included new features such as:[7]
Robust support for Object-Oriented Programming
The PHP Data Objects extension, which defines a lightweight and consistent interfaces for accessing databases
Performance enhancements taking advantage of the new engine
Better support for MySQL through a completely rewritten extension
Embedded support for SQLite
Integrated SOAP support
Data iterators
Error handling through Exceptions
The latest version as of December 2006 is PHP 5.2.0.

Object-oriented programming

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Object-oriented programming (OOP) is a programming paradigm that uses abstraction to create models based on the real world. It utilizes several techniques from previously established paradigms, including modularity, polymorphism, and encapsulation. Even though it originated in the 1960s, OOP was not commonly used in mainstream software application development until the 1990s. Today, many popular programming languages (such as Java, JavaScript, C#, C++, Python, PHP, Ruby and Objective-C) support OOP.
Object-oriented programming's roots reach all the way back to the creation of the Simula programming language in the 1960s, when the nascent field of software engineering had begun to discuss the idea of a software crisis. As hardware and software became increasingly complex, how could software quality be maintained? Object-oriented programming in part addresses this problem by strongly emphasizing modularity in software.[1]
Object-oriented programming may be seen as a collection of cooperating objects, as opposed to a traditional view in which a program may be seen as a collection of functions, or simply as a list of instructions to the computer. In OOP, each object is capable of receiving messages, processing data, and sending messages to other objects. Each object can be viewed as an independent little machine with a distinct role or responsibility.[2]
Object-oriented programming is intended to promote greater flexibility and maintainability in programming, and is widely popular in large-scale software engineering. By virtue of its strong emphasis on modularity, object oriented code is intended to be simpler to develop and easier to understand later on, lending itself to more direct analysis, coding, and understanding of complex situations and procedures than less modular programming methods.
==Fundamental concepts== A survey of nearly 40 years of computing literature by Deborah J. Armstrong[3] identified a number of "quarks," or fundamental concepts, identified in the strong majority of definitions of OOP. They are:
Class — a class defines the abstract characteristics of a thing, including the thing's characteristics (its attributes or properties) and the things it can do (its behaviors or methods or features). For example, the class Dog would consist of traits shared by all dogs, for example breed, fur color, and the ability to bark. Classes provide modularity and structure in an object-oriented computer program. A class should typically be recognizable to a non-programmer familiar with the problem domain, meaning that the characteristics of the class should make sense in context. Also, the code for a class should be relatively self-contained. Collectively, the properties and methods defined by a class are called members.
Object — a particular instance of a class. The class of Dog defines all possible dogs by listing the characteristics that they can have; the object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur; Lassie has brown-and-white fur. In programmer jargon, the object Lassie is an instance of the Dog class. The set of values of the attributes of a particular object is called its state.
Method — an object's abilities. Lassie, being a Dog, has the ability to bark. So bark() is one of Lassie's methods. She may have other methods as well, for example sit() or eat(). Within the program, using a method should only affect one particular object; all Dogs can bark, but you need one particular dog to do the barking.
Message passing — "The process by which an object sends data to another object or asks the other object to invoke a method."[3]
Inheritance — In some cases, a class will have "subclasses," more specialized versions of a class. For example, the class Dog might have sub-classes called Collie, Chihuahua, and GoldenRetriever. In this case, Lassie would be an instance of the Collie subclass. Subclasses inherit attributes and behaviors from their parent classes, and can introduce their own. Suppose the Dog class defines a method called bark() and a property called furColor. Each of its sub-classes (Collie, Chihuahua, and GoldenRetriever) will inherit these members, meaning that the programmer only needs to write the code for them once. Each subclass can alter its inherited traits. So, for example, the Collie class might specify that the default furColor for a collie is brown-and-white. The Chihuahua subclass might specify that the bark() method is high-pitched by default. Subclasses can also add new members. The Chihuahua subclass could add a method called tremble(). So an individual chihuahua instance would use a high-pitched bark() from the Chihuahua subclass, which in turn inherited the usual bark() from Dog. The chihuahua object would also have the tremble() method, but Lassie would not, because she is a Collie, not a Chihuahua. In fact, inheritance is an "is-a" relationship: Lassie is a Collie. A Collie is a Dog. Thus, Lassie inherits the members of both Collies and Dogs. When an object or class inherits its traits from more than one ancestor class, it's called multiple inheritance. This is not always supported, as it can be hard both to implement and to use well.
Encapsulation — conceals the exact details of how a particular class works from objects that use its code or send messages to it. So, for example, the Dog class has a bark() method. The code for the bark() method defines exactly how a bark happens (e.g., by inhale() and then exhale(), at a particular pitch and volume). Timmy, Lassie's friend, however, does not need to know exactly how she barks. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface — those members accessible to that class. The reason for encapsulation is to prevent clients of an interface from depending on those parts of the implementation that are likely to change in future, thereby allowing those changes to be made more easily, that is, without changes to clients. For example, an interface can ensure that puppies can only be added to an object of the class Dog by code in that class. Members are often specified as public, protected and private, determining whether they are available to all classes, sub-classes or only the defining class. Some languages go further: Java uses the protected keyword to restrict access also to classes in the same package, C# and VB.NET reserve some members to classes in the same assembly using keywords internal (C#) or Friend (VB.NET), and Eiffel allows one to specify which classes may access any member.
Abstraction — simplifying complex reality by modeling classes appropriate to the problem, and working at the most appropriate level of inheritance for a given aspect of the problem. For example, Lassie the Dog may be treated as a Dog much of the time, a Collie when necessary to access Collie-specific attributes or behaviors, and as an Animal (perhaps the parent class of Dog) when counting Timmy's pets.
Polymorphism — polymorphism is behavior that varies depending on the class in which the behavior is invoked, that is, two or more classes can react differently to the same message. For example, if a Dog is commanded to speak() this may elicit a Bark; if a Pig is commanded to speak() this may elicit an Oink.