Ratish Naroor's Personal Blog

The Life ahead Rss

AJAX (Part1)

Posted by Ratish Naroor | Posted in Others | Posted on 18-11-2005

Whats Ajax???

First of all AJAX is not a single technology…its a combination of many technologies which are working together in their own way to bring out powerful ways of designing web applications.

AJAX mainly includes

– Usage of all web standards using XHTML and CSS.
– Changing data and managing those data using XML and XLST.
– Using the XMLhttpRequest Object for asynchronous data retrieval.
– Bringing dynamic display and interaction using DOM (Document Object Model).
– Using JavaScript to combine all the above components.

How is it different from the Old web model?


Here mainly I have to go for the negative points of our usual web environment and its bad affects. Firstly we are making our clients or users to wait for long at the time loading .The only solution for making our web application fast is to compare our web application with the usual windows based application and compare the form loading speeds. And the best method will be to restrict the HTTP requests to the web server whenever there is a processing. So that will be including processing in client side itself if we can.

What AJAX provides?

Here we have found an end to the up down up down communication to the web server and the client machine when we use a web application. Users don’t have to go to the web server to do some processing every time they do anything on the server.
Here there is an introduction of a “AJAX ENGINE ” which now plays a role in between the user and the web server. The AJAX engine is loaded when the web session starts .It is responsible for rendering the user interface by communicating with the web server on the user’s behalf. The Ajax engine works in a way so that the users interaction with the web server happens asynchronously – independent with the communication with the web server.

The following image will make my points a bit more clear.


So whenever there is any user request, the HTTPrequest takes the form of a JavaScript call to the AJAX engine. And if the user request doesn’t need a round trip to the server like when it’s a validation request or an edit in data in the memory or can be a navigation request, the AJAX engine itself handles it asynchronously. When the AJAX engine needs some thing from the server in order to give a response like submitting data for processing, loading additional interface code etc, the engine does it asynchronously with out disturbing the users interaction with the application .It uses XML for this purpose.

The C# Preprocessor Directives

Posted by Ratish Naroor | Posted in Others | Posted on 07-11-2005

So what are preprocessor Directives?? They are symbols used in C# language to help us to interact with the compilation process. The basic C# preprocessor symbols we use are ::

  • #define,#unDef
  • #if,#elif,#else,#endif
  • #line
  • #error,#warning
  • #region,#endregion

I hope many people are familiar with the #region and #endregion.They are the directive used to make our lengthy codes more manageable .Using this directive we can specify a specific block of code in our .cs file and make that block distinct.

The conditional preprocessor directives #if,#elif,#else,#endif are mainly used to conditionally compile our code .The best example will be if we want to execute a set of code when our code is running under debug mode we make use of the conditional directive .
For Example,
#if(DEBUG)
some C# code
#endif
Here the C# code written inside the directives will be compiling into the assembly only when the code is compiled in the debug mode.

The #define directive is used to define some C# symbol .For example if we want to define the DEBUG symbol in our code we use the code #define DEBUG. The only important thing to note is that we should use the define directive only at the top of the code or before anything we write in the .cs file .

The #warning and #error directives are used for showing some messages after the compilation of the code is being done .Along with other errors or warnings (if any) our directed messages are shown .

The Last directive #line is used to alter the line number sequence in our code. This can be checked only when we use the line numbers our code page. We can use the #line default to make the line numbers back in track at the time of compilation.

Related Posts with Thumbnails
Ratish Naroor Photography blog
Ratish Naroor SEO blog
ads
ads