Saturday, April 12, 2008
==> Introduction to AJAX
AJAX is not a new programming language, but a technique for creating better, faster, and more interactive web applications. With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can trade data with a web server, without reloading the page. AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages. The AJAX technique makes Internet applications smaller, faster and more user-friendly.
*** AJAX is a browser technology independent of web server software.
AJAX is based on the following web standards:
1) JavaScript
2) XML
3) HTML
4) CSS
The web standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent. AJAX is About Better Internet Applications
Web applications have many benefits over desktop applications; they can reach a larger audience, they are easier to install and support, and easier to develop. However, Internet applications are not always as "rich" and user-friendly as traditional desktop applications.
With AJAX, Internet applications can be made richer and more user-friendly.
In traditional JavaScript coding, if you want to get any information from a database or a file on the server, or send user information to a server, you will have to make an HTML form and GET or POST data to the server. The user will have to click the "Submit" button to send/get the information, wait for the server to respond, then a new page will load with the results.
Because the server returns a new page each time the user submits input, traditional web applications can run slowly and tend to be less user-friendly.
With AJAX, your JavaScript communicates directly with the server, through the JavaScript XMLHttpRequest object. With an HTTP request, a web page can make a request to, and get a response from a web server - without reloading the page. The user will stay on the same page, and he or she will not notice that scripts request pages, or send data to a server in the background.
A good AJAX material can be found at
http://www.w3schools.com/Ajax/default.asp
==> Introduction to Java
Java is a high-level language, like C, FORTRAN, Smalltalk, Perl, and many others. Java can be used to write computer applications that do operations on numbers, process words, play games, store data and do many other operations that a computer software can do.
Compared to other programming languages, Java is most similar to C. Java shares much of C's syntax. Knowing how to program C++ will certainly help you to learn Java more quickly, but you don't need to know C or C++ to learn Java.
Features of Java
1) Simple:-
Java was designed to make it much easier to write bug free code. The most important part of helping programmers write bug-free code is keeping the language simple.
Java has the rich feature set to help the programmers in writing the code. Despite its simplicity Java has considerably more functionality than C, primarily because of the large class library.
About half of the bugs in C and C++ programs are related to memory allocation and deallocation. The runtime environment provides automatic memory allocation and garbage collection so there's less for the programmer to think about.
Because Java is simple, it is easy to read and write. There aren't a lot of special cases or tricks that will confuse beginners.
2) Object-Oriented:-
Java is a pure Object Oriented language. In object-oriented programs data is represented by objects. Objects have two sections, fields (instance variables) and methods. Fields tell you what an object is. Methods tell you what an object does. These fields and methods are closely tied to the object's real world characteristics and behavior.
Object oriented programming is alleged to have a number of advantages including:
Simpler, easier to read programs
More efficient reuse of code
Faster time to market
More robust, error-free code
3) Platform Independent:-
A program written in any programming language on one platform can be moved on another platform and can be compiled and executed. But it’s very difficult to run the program compiled on another platform.
But java makes it possible by introducing Byte Code. Once you compile a java program, the java compiler gives you a class file which is purely in byte code. The byte code can be executed on Java Virtual Machine installed on any platform.
So java gives the flexibility to the programmers to write platform independent programs.
4) Secured:-
To make the programs more secured, Java avoided so many features of C and C++ to include. Most notably there are no pointers in Java. Java programs cannot access arbitrary addresses in memory. All memory access is handled behind the scenes by the trusted Java Runtime Environment. Furthermore Java has strong typing. Variables must be declared, and variables do not change types when you aren't looking. Casts are strictly limited to casts between types that make sense. Thus you can cast an int to a long or a byte to a short but not a long to a boolean or an int to a String.
5) Exception Handling:-
Java implements a robust exception handling mechanism to help the programmers to deal with both expected and unexpected errors.
6) Robust & Scalable:-
Java byte codes can be compiled on the fly in speed using a "just-in-time compiler." Several companies are also working on native-machine-architecture compilers for Java. These will produce executable code that does not require a separate interpreter.
It is certainly possible to write large programs in Java. The HotJava browser, the Eclipse integrated development environment, the LimeWire file sharing application, the jEdit text editor, the JBoss application server, the Tomcat servlet container, the Xerces XML parser, the Xalan XSLT processor, and the javac compiler are large programs that are written entirely in Java.
7) Multi-Threaded:-
Java is inherently multi-threaded. A single Java program can have many different threads executing independently and continuously. It also helps to contribute to Java's robustness.
8) Garbage Collection:-
You do not need to explicitly allocate or deallocate memory in Java. Memory is allocated as needed, both on the stack and the heap, and reclaimed by the garbage collector when it is no longer needed. There's no malloc(), free(), or destructor methods.
There are constructors and these do allocate memory on the heap, but this is transparent to the programmer.
The exact algorithm used for garbage collection varies from one virtual machine to the next. The most common approach in modern JVMs is generational garbage collection for short-lived objects, followed by mark and sweep for longer lived objects. I have never encountered a Java VM that used reference counting.