- Web Services are a way for disparate applications to work with each other over the web;
- In order for different applications to communicate with each other they need to agree on a protocol, webservices have three common protocols, JavaScript throws a fourth into the mix;
- REST - Simple request protocol, looks identical to a form being filled out, response is a basic XML document;
- XML-RPC - XML request-response protocol, format chosen is sub-optimal for parsing with DOM tools;
- SOAP - Heavy but well defined XML based request-response protocol;
- JSON - JavaScript Object Notation - information is passed back and forth in the JavaScript notation;
- Ditch SOAP & XML-RPC, (SOAP is too heavy for frequent small requests, XML-RPC is just ugly);
- REST - Light weight requests, some basic frameworks are available. Define your own response XML format;
- JSON - The JSON format is relatively lightweight but still ‘new’ enough that it’s not too widely supported (JSON support was added in PHP 5.2.0);
- It’s critical to remember that HTTP is a stateless protocol, every request must stand alone, independent of each other request. While technologies like sessions help can help when dealing with end users, they are inappropriate when using web services;
- When developing web services leverage and re-factor existing code, rather than duplicating;
- Objects are rather... different compared to other languages. Rather than defining a specific
class, than instantiating instances of it, objects are created from functions that pull in their own required methods. This can be done on the fly, or by defining functions inside other functions.
Wednesday, 5 September 2007
AJAX & Web 2.0 Tutorial (Section 2) - Web Services
Posted by
Alex Zang
at
6:18 pm
Labels: AJAX, Javascript, Tutorial
Sunday, 2 September 2007
MagicJavascript - Flying Images
Open a website and paste the following code into the URL on your browser, and then hit Enter ... ...
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.right=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0);
I tried on google.com, and here is the screenshot:
Posted by
Alex Zang
at
5:37 pm
Labels: Javascript, Joke
Saturday, 18 August 2007
Learn from yahoo.com
Every developer dreams to have a website whose pagerank is 10 or daily reach percentage is 20+, but are you sure your sites wouldn't breakdown when facing with millions of clicks on a daily basis? Let's open the box of yahoo.com and have a look whats inside, shall we? :-)
Total Requests: 37
Page Size: 208K
Loading time: 1.68s
If we are not so sure how brilliant yahoo.com is, I am not being cruel, but lets have a look at sugarcrm.com:
Total Requests: 85
Page Size: 419K
Loading time: 8.68s
A Brief Conclusion:
[1] If an image/javascript is not really necessary, REMOVE it.
[2] If an image/javascript is considerably big, REPLACE it.
[3] Every little help :-)
Posted by
Alex Zang
at
5:09 pm
Labels: CSS, Javascript, Site Perfermance
Thursday, 16 August 2007
Web 2.0 is a feature
Too many people are doing too many different and irreconcilable things all at once on the web, should we say that web 2.0 (Web 2.0 is a phrase coined by O'Reilly Media in 2003 (and later popularized by the first Web 2.0 conference in 2004) in reference to a perceived second generation of web-based communities and hosted services) is the future capabilities of the internet? No, it is just a feature, same as speed, security, compatibility. You don't have to participate as long as you are satisfied with your current approach on site exposure and application handling.
But most of the early Web 2.0 successes are consumer-focused, with many dedicated to social networking. Like AdSense, which has given Madison Avenue executives the collective jitters, the Open Architecture Network suggests that 2.0's cocktail of collaborative technologies can have an equally radical influence on business and industry practices. In the case of the OAN, the industry in question is architecture.
Posted by
Alex Zang
at
9:27 pm
Labels: Javascript, Luxplus, Web2.0
Thursday, 2 August 2007
Tips to make your site faster
- Compress the JavaScript files: http://alex.dojotoolkit.org/shrinksafe/
- Compress the CSS files: http://iceyboard.no-ip.org/projects/css_compressor
- Use Firebug (Firefox Add-on): http://addons.mozilla.org/en-US/firefox/addon/1843
Posted by
Alex Zang
at
2:28 pm
Labels: CSS, Javascript, PHP, Site Perfermance