SlideShare a Scribd company logo
Of REST and Beans
  Door Thimo Jansen
Introductie
* Thimo Jansen
* IBM Domino web developer
* http://www.thimojansenit.nl
Agenda
* REST
* JSON
* Architectuur
* Demo
* Code
REST
REST // Definitie
    Representational State Transfer


A set of recommended architectural
constraints in order for a system to be
described as RESTful


Door Roy Fielding, ook HTTP 1.0 en 1.1
REST // Constraints
 * Client - Server
 * Stateless
 * Cacheable
 * Layered system
 * Code on demand
 * Uniform interface
REST // Communicatie
 Data uitwisseling
 Client doet weergave
 Server doet opslag
REST // Communicatie
  Via HTTP
  * GET - Ophalen
  * POST - Aanmaken
  * PUT - Vervangen
  * DELETE - Verwijderen
  Lijkt op CRUD
JSON
JSON // Definitie
       JavaScript Object Notation


* lightweight text-data interchange
* taal onafhankelijk
* "self-describing", easy to understand
JSON // Voorbeeld
Object:
{
    "firstName":"John",
    "lastName":"Doe"
}
JSON // Voorbeeld
Array:
[
    100, 200, 300
]
JSON // Voorbeeld
Array met twee objecten:
[

        {"firstName":"John", "lastName":"Doe"},

        {"firstName":"Hello", "lastName":"World"}

    ]
JSON // Voorbeeld
Object 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/)
JSON // Conversie
           Javascript -> JSON


XPages:   toJson(myObject);
Browser: JSON.stringify(myObject);
JSON // Conversie
               JSON -> Javascript
var myJSON = '{"firstName":"John", "lastName":"Doe"}';



XPages:     fromJson(myJSON);
Browser: JSON.parse(myJSON);
JSON // Conversie
         Test of iets JSON is


XPages: isJson('{<some JSON string>}');
JSON vs REST
                   JSON != Hypermedia
                   JSON != REST
                   Ja, en?




http://norestforjson.blogspot.nl/2012/08/json-is-not-restful.html
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
Architectuur
Architectuur // HTML

             Browser
  Request              Response
  GET/POST             HTML

          Web server


 Application logic (SSJS, Beans)
Architectuur // REST

                      Browser
                            AJAX Request
Request       Response                       Response
                            GET/POST/PUT/
GET/POST      HTML                           JSON
                            DELETE

                    Web server


           Application logic (SSJS, Beans)
Architectuur // REST

                     Browser
                         AJAX Request       Response
Request     Response
                         GET/POST/PUT/      JSON
GET/POST    HTML
                         DELETE

   Web server                    Web server


 Application logic             Application logic
Demo
Code
Contact
   thimo@jansenit.nl // @thimo
   http://blog.thimojansenit.nl
http://linkedin.com/in/thimojansen

More Related Content

PDF
Corporate class explained
PPTX
PDF
Ci federal budget commentary 2012
PPTX
Alikh boygioyklakh (1)
PDF
Make your music go viral using TuneClout
PPTX
Van EVI naar IRIS, mijn eerste XPages applicatie
PDF
Silverside CCTY Developers Update
PDF
Godunov-SPH
Corporate class explained
Ci federal budget commentary 2012
Alikh boygioyklakh (1)
Make your music go viral using TuneClout
Van EVI naar IRIS, mijn eerste XPages applicatie
Silverside CCTY Developers Update
Godunov-SPH

Similar to Of REST and Beans (20)

PDF
07-IM-REST-json.pdf slide for restapi explaination
PPTX
80068
PPT
CTS Conference Web 2.0 Tutorial Part 2
PDF
Android App Development 06 : Network &amp; Web Services
PPT
Java Script Based Client Server Webapps 2
PPT
Json-based Service Oriented Architecture for the web
PPT
RESTFul Web Services - Intro
PDF
13 web service integration
PDF
PPTX
RESTful Web Services
PPTX
rest-api-basics.pptx
PPT
Introduction to Google APIs
PDF
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
PPTX
rest-api-basics.pptx
PDF
Web architecturesWeb architecturesWeb architectures
PDF
feb19-webservices3
PDF
feb19-webservices3
PPTX
Introduction to Web Architecture
PDF
May 2010 - RestEasy
07-IM-REST-json.pdf slide for restapi explaination
80068
CTS Conference Web 2.0 Tutorial Part 2
Android App Development 06 : Network &amp; Web Services
Java Script Based Client Server Webapps 2
Json-based Service Oriented Architecture for the web
RESTFul Web Services - Intro
13 web service integration
RESTful Web Services
rest-api-basics.pptx
Introduction to Google APIs
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
rest-api-basics.pptx
Web architecturesWeb architecturesWeb architectures
feb19-webservices3
feb19-webservices3
Introduction to Web Architecture
May 2010 - RestEasy
Ad

More from Thimo Jansen (7)

PDF
TeamPlan brochure
PDF
AuditCase & XPages
PDF
XPages & Beer - Behind the scenes
PPTX
XPages * XDocReport = X3
PPTX
Een XPages implementatie van het Ogone betaalplatform
PDF
Engage - XPages & Beer
PDF
xe:objectData
TeamPlan brochure
AuditCase & XPages
XPages & Beer - Behind the scenes
XPages * XDocReport = X3
Een XPages implementatie van het Ogone betaalplatform
Engage - XPages & Beer
xe:objectData
Ad

Recently uploaded (20)

PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
A Presentation on Touch Screen Technology
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
cloud_computing_Infrastucture_as_cloud_p
OMC Textile Division Presentation 2021.pptx
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A comparative analysis of optical character recognition models for extracting...
Group 1 Presentation -Planning and Decision Making .pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
TLE Review Electricity (Electricity).pptx
Building Integrated photovoltaic BIPV_UPV.pdf
A Presentation on Artificial Intelligence
A Presentation on Touch Screen Technology
SOPHOS-XG Firewall Administrator PPT.pptx
Hindi spoken digit analysis for native and non-native speakers
1 - Historical Antecedents, Social Consideration.pdf
Hybrid model detection and classification of lung cancer
Getting Started with Data Integration: FME Form 101
Chapter 5: Probability Theory and Statistics
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...

Of REST and Beans

  • 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
  • 5. REST // Definitie Representational State Transfer A set of recommended architectural constraints in order for a system to be described as RESTful Door 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
  • 10. JSON // Definitie JavaScript Object Notation * lightweight text-data interchange * taal onafhankelijk * "self-describing", easy to understand
  • 11. JSON // Voorbeeld Object: { "firstName":"John", "lastName":"Doe" }
  • 12. JSON // Voorbeeld Array: [ 100, 200, 300 ]
  • 13. JSON // Voorbeeld Array met twee objecten: [ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Hello", "lastName":"World"} ]
  • 14. JSON // Voorbeeld Object 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 -> JSON XPages: toJson(myObject); Browser: JSON.stringify(myObject);
  • 16. JSON // Conversie JSON -> Javascript var myJSON = '{"firstName":"John", "lastName":"Doe"}'; XPages: fromJson(myJSON); Browser: JSON.parse(myJSON);
  • 17. JSON // Conversie Test of iets JSON is XPages: isJson('{<some JSON string>}');
  • 18. JSON vs REST JSON != Hypermedia JSON != REST Ja, en? http://norestforjson.blogspot.nl/2012/08/json-is-not-restful.html http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
  • 20. Architectuur // HTML Browser Request Response GET/POST HTML Web server Application logic (SSJS, Beans)
  • 21. Architectuur // REST Browser AJAX Request Request Response Response GET/POST/PUT/ GET/POST HTML JSON DELETE Web server Application logic (SSJS, Beans)
  • 22. Architectuur // REST Browser AJAX Request Response Request Response GET/POST/PUT/ JSON GET/POST HTML DELETE Web server Web server Application logic Application logic
  • 23. Demo
  • 24. Code
  • 25. Contact thimo@jansenit.nl // @thimo http://blog.thimojansenit.nl http://linkedin.com/in/thimojansen