AJAX Made Easy - Learn AJAX

AJAX Categories

 
AJAX Home AJAX-Tips

Debugging Server Side Functions

Author: admin    |    Published: 21st Mar 2008     |    Read: 187 times    |  Add Comment
Filed in: AJAX-Tips





Checking your application is always a standard procedure in any language. In the case of Ajax, the importance is even greater considering the complexity of the development technique.


When debugging the application, Ajax developers knows that they have to go for the Server-side functions as well as the client side. Fortunately, client side debugging tools are common. Firefox even has a small add-on that has the ability to debug Client-Side functions of Ajax. Just one run with the application, developers will know if there are bugs found in the system.


The Server-side however, is not so lucky. Debugging the Server-side function on JavaScript is ok but when you are running on a framework, you are in a little bit of a trouble. Frameworks in the Server-side translate Java into JavaScript. Since it is not on JavaScript, debugging tools for Ajax is never possible. Developers might just have to let go of debugging Server-side functions.


Actually, there is a simple trick on how can you debug Server-side functionality. When building the Server-side functions, also build another function that actually debugs the function. That function writes the variables of the application into a file. Since it was built on a file, you can fire up a simple debugging tool.


That function will technically start by determining which variable to debug. When it does it uses a function from PHP called the OutPut buffering. This simple function from PHP loads the variable to the file so that it could be tested. From this point, the debugging functionality will be used. A simple debugassistant command in different lines will be useful. In fact, the debugassistant might be the only thing that you need to ensure that the debugging works.


Lastly, the function should access the file called debug to transfer the data extracted from the debugging tool. Simple as that.


The best part of this debugging tool is that it has the ability to be used in certain stages of the application development. You do not need to wait until the finished product and run it through the debugging tool. With this simple functionality, you should be able to test the application by stages. Every time an update comes up, the functionality could be kicked in so that it could easily identify the latest variables and run it through the debugging application.


Of course, the other good thing about this is that you do not need to use a JavaScript debugging tool. Not that we do not like them but when you are running the Server-side practically end with nothing.


Remember, this function could be easily integrated into the script. It might not be even noticed when the application starts to kick in. As a developer in your end, you will have the ability to trigger it when you need it. Unfortunately, you will not be able to automatically configure it to work but that is just fine as this could even be at your advantage.


Using this simple debugging function to ensure your Server-side functions work. It is simple but a very effective tool for Server-side frameworks.





Post Comment


You need to Login to post your comment...

Click here to login

Title:

 
Comment:




Site Login

 

Sponsored Links

 

Related AJAX Articles

 » Returns From the Server
 » The Gloomy Side of Ajax
 » Dark Side of UpdatePanel on Web Navigation
 » Optimizing the Server Side of Ajax
 » Aptana Jaxer for a better Ajax Web Server
 » IE Debugging Tools
 » A Better DWR by Tuning Server Performance
 » Enabling Client-Side Cache
 » Client Side vs. Server Side Frameworks
 » AJAX Debugging with Firebug
 

Latest AJAX Articles

 

Popular AJAX Articles