Archives
Recent posts
Recent comments
- In Mariano Iglesias - Internationalization with CakePHP
- hey's blog wrote: Not enought information
- In MartÃn Sarsale - Death of Apache Long Live Lighttpd
- Martin Sarsale wrote: Mark, I've just found blog post and I have to say I'm very happy to see all the concepts you got ...
- In Nate Abele - PHP is dying
- carlo wrote: it should be "cake[language_here]" , your comment system trims that part.
- In Nate Abele - PHP is dying
- carlo wrote: hello, if php is dying, so you will have cake in the future?
- In Ryan Petersen - Collective Intelligence
- Geoffrey Bonnycastle wrote: Toby Segaran, Programming Collective Intelligence: Building Smart Web 2.0 Applications (Sebastopo...
Categories
Blogroll
Nate Abele - RESTFUL CakePHP
Written on Tue, Dec 2nd 2008, 12:28 in CakeFest
Viewed 473 times, 0 Comments
Why would you want to create RESTful application interface? A webservice/RESTFUL interface will allow you to create a public interface that allows 3rd party sites to integrate with your applications. RESTful API's allow you to provide open services for your customers. This helps customers by giving them choice in what service they use, and reduces a customer's feeling of being locked into one service. By providing open access to data through webservices you not only benefits your customers, it also benefits you company as well. An open webservice can help attract developers to implement and use your webservice with their application.
Webservices are important to developers as it helps reduce the effort and time needed to make applications work, and makes code easier to maintain. Nate compared different RESTful/webservices solutions, covering SOAP and some of the troubles created by its implementation. SOAP's problems stemmed from its heavy XML payload and single point of access. REST was covered next, and Nate extolled the advantages of REST and how it provides more useful information in the headers. This decreases request size and increases the clarity of what is actually being requested. REST also makes it easier to create CRUD api's. REST favours using the existing HTTP methods over creating method calls in your request bodies. And uses all of the HTTP methods to implement a CRUD interface.
You can easily add REST funtionality to your application with only a few changes. You need to add Router::parseExtension() and add the RequestHandler to your components. This will enable requests like posts/view/1.xml. You then need to add additional view paths for any other extensions you may need. To allow for alternate views you simply need to add an views/posts/xml directory would enable xml views tied to your xml requests. Using Router::mapResources('posts'); will allow you to make GET/POST/PUT/DELETE requests to posts/1.xml and the appropriate action will be triggered. Issues with scaling were raised in regards to REST api's. CakePHP REST implementation scale very well in a horizontal fashion thanks to the way PHP works. Nate stated that the biggest challenge to scaling are still going to be on the Database and latency side, unlike other platforms.

What is OpenID?
OpenID is a new open standard that lets you sign in to web sites with a single URL that you own. This URL can be your homepage or blog, or it can be provided to you by a web site you use. In either case, you only have to sign in once to your OpenID provider and so you only need to maintain a single password.Learn more.
How is CakeDC using OpenID?
You can use your OpenID identity when posting comments on the site. When you see a form field with
entering your OpenID identity is sufficient to allow your post. We also accept Google or Yahoo! identities. Simply use either "google.com" or "yahoo.com" and our OpenID library will locate your information from the appropriate source.

Comments:
Add comment