Your SlideShare is downloading. ×
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Of REST and Beans
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Of REST and Beans

3,011

Published on

Mijn presentatie over REST en Beans in een IBM Domino XPages omgeving, van het XPages & Beer evenement op 12 december 2012.

Mijn presentatie over REST en Beans in een IBM Domino XPages omgeving, van het XPages & Beer evenement op 12 december 2012.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,011
On Slideshare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
10
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Of REST and Beans Door Thimo Jansen
  • 2. Introductie* Thimo Jansen* IBM Domino web developer* http://www.thimojansenit.nl
  • 3. Agenda* REST* JSON* Architectuur* Demo* Code
  • 4. REST
  • 5. REST // Definitie Representational State TransferA set of recommended architecturalconstraints in order for a system to bedescribed as RESTfulDoor Roy Fielding, ook HTTP 1.0 en 1.1
  • 6. REST // Constraints * Client - Server * Stateless * Cacheable * Layered system * Code on demand * Uniform interface
  • 7. REST // Communicatie Data uitwisseling Client doet weergave Server doet opslag
  • 8. REST // Communicatie Via HTTP * GET - Ophalen * POST - Aanmaken * PUT - Vervangen * DELETE - Verwijderen Lijkt op CRUD
  • 9. JSON
  • 10. JSON // Definitie JavaScript Object Notation* lightweight text-data interchange* taal onafhankelijk* "self-describing", easy to understand
  • 11. JSON // VoorbeeldObject:{ "firstName":"John", "lastName":"Doe"}
  • 12. JSON // VoorbeeldArray:[ 100, 200, 300]
  • 13. JSON // VoorbeeldArray met twee objecten:[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Hello", "lastName":"World"} ]
  • 14. JSON // VoorbeeldObject met arrays en objecten:{ "event":"XPages & Beer", "location":"Houten", "speakers" : [ {"firstName":"Tom", "lastName":"Steenbergen"}, {"firstName":"Thimo", "lastName":"Jansen"}, {"firstName":"Erik", "lastName":"van der Arend"} ] } (Syntax: http://www.json.org/, JSON Validator: http://jsonlint.com/)
  • 15. JSON // Conversie Javascript -> JSONXPages: toJson(myObject);Browser: JSON.stringify(myObject);
  • 16. JSON // Conversie JSON -> Javascriptvar myJSON = {"firstName":"John", "lastName":"Doe"};XPages: fromJson(myJSON);Browser: JSON.parse(myJSON);
  • 17. JSON // Conversie Test of iets JSON isXPages: isJson({<some JSON string>});
  • 18. JSON vs REST JSON != Hypermedia JSON != REST Ja, en?http://norestforjson.blogspot.nl/2012/08/json-is-not-restful.htmlhttp://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
  • 19. Architectuur
  • 20. Architectuur // HTML Browser Request Response GET/POST HTML Web server Application logic (SSJS, Beans)
  • 21. Architectuur // REST Browser AJAX RequestRequest Response Response GET/POST/PUT/GET/POST HTML JSON DELETE Web server Application logic (SSJS, Beans)
  • 22. Architectuur // REST Browser AJAX Request ResponseRequest Response GET/POST/PUT/ JSONGET/POST HTML DELETE Web server Web server Application logic Application logic
  • 23. Demo
  • 24. Code
  • 25. Contact thimo@jansenit.nl // @thimo http://blog.thimojansenit.nlhttp://linkedin.com/in/thimojansen

×