Commentaires récents

In Working with a company that embraces open source
Guy Steels wrote: And a big thank you for open sourcing your plugins. When we look if certain functionality is...
In Marius Wilms - The CakePHP Media Plugin
Sotir wrote: Some practice use examples will be nice to have around...
In Felix Geisendörfer - Recipies for successful CakePHP projects
Felix Geisendörfer wrote: http://felixge.s3.amazonaws.com/09/cakephp-receipes.pdf (sorry, 8mb download)
In Joël Perras - Demystifying Webservices in CakePHP
Neil Crookes wrote: I have an upcoming project that could use the Google Chart / Visualisation API so would be...

Catégories

Flux RSS pour les commentaires

Joël Perras - Demystifying Webservices in CakePHP

Ecrit le Mon, Jul 13th 2009, 14:06 dans

Joël's presentation on Web Services and CakePHP identifies important and interesting points that really demystify both implementation of datasources, and what web services mean for developers trying to take advantages of their offerings.

A Web Service is a defined interface. The interface is made known and public, however the implementation may not be known (and its not really important). The developer should be interested in the data supply and the data returned from the web service.

Various mechanisms are available for communicating with a web service. Such as: RPC, SOA, REST and more.

Much of this presentation covered best practices, better practices, and why people tend to make decisions like implementing components when they really want datasources, as well as implementing datasources, and going about the implementation the wrong way. In the case of web services datasources implementation, curl is presented as a good example of something that works, but a better solution is available through the use of HttpSocket. HttpSocket being one of the CakePHP core libraries provided, allowing a complete implementation of Http communication, extending the CakeSocket class.

Authentication and Authorization options were presented, with specific reference to OpenID and OAuth. Authentication and Authorzation are part of the application flow graph. This means implementation should be at the controller level, and in terms of implementing easily managed pluggable sections of code in cakephp converntions, this means a component.

Data Sources are the closest layer to the actual data. Correct implementation of a data source will allow models to connect and communicate in a transparent fashion, meaning easy access to data in a standard way.

The basics of a datasource should implement the following: __construct, listSources, describe, create, read, update, delete as well as defining $_schema. Some great datasource examples can be seen in the core. When implementing a datasource, to ensure maximum use and compatibility, try to make use of CakePHP libraries such as HttpSocket in the place of curl.

Google Charts was presented as a good example of what should not be implemented as a datasource. The data in this instance is handed by some other data source, and the formatted chart request is sent with an image response supplied. This is more appropriate for a helper than a datasource. Joël mentioned that he has a partial google charts helper that he would be willing to share if someone asked.

Retour aux articles de Graham's

Commentaires:

Add comment
  • I have an upcoming project that could use the Google Chart / Visualisation API so would be interested in using Joel's helper, and would of course share any additional functionality I implement back with him and the community.

    Reply | Neil Crookes | posted on 14/7/09

openID

Qu'est-ce que OpenID ?

OpenID est un nouveau standard ouvert qui permet de se connecter à des sites web grâce à une simple URL vous appartenant. Cette URL peut être votre page personnelle ou blog, ou peut vous être fournie par un site web que vous utilisez. Dans tous les cas, vous n'avez qu'à vous connecter une seule fois auprès de votre fournisseur OpenID, vous permettant ainsi de n'avoir qu'un seul mot de passe à maintenir.Learn more.

Comment est-ce que CakeDC utilise OpenID ?

Vous pouvez utiliser votre identité OpenID lorsque vous postez des commentaires sur le site. Lorsque vous voyez un champ de formulaire avecle logo OpenID il suffit de renseigner votre identité OpenID pour vous permettre de poster. Nous acceptons également les identités Google et Yahoo!. Utilisez simplement soit "google.com" soit "yahoo.com" et notre librairie OpenID ira chercher vos informations au bon endroit.