SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à Of REST and Beans

Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2kriszyp
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webkriszyp
 
JavaScript Security: Mastering Cross Domain Communications in complex JS appl...
JavaScript Security: Mastering Cross Domain Communications in complex JS appl...JavaScript Security: Mastering Cross Domain Communications in complex JS appl...
JavaScript Security: Mastering Cross Domain Communications in complex JS appl...Thomas Witt
 
JSON Fuzzing: New approach to old problems
JSON Fuzzing: New  approach to old problemsJSON Fuzzing: New  approach to old problems
JSON Fuzzing: New approach to old problemstitanlambda
 
RESTful JSON web databases
RESTful JSON web databasesRESTful JSON web databases
RESTful JSON web databaseskriszyp
 
Android App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web ServicesAndroid App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web ServicesAnuchit Chalothorn
 
DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5Eyal Vardi
 
RESTful services
RESTful servicesRESTful services
RESTful servicesgouthamrv
 
01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27Eoin Keary
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jerseyb_kathir
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 

Similaire à Of REST and Beans (20)

Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
 
JavaScript Security: Mastering Cross Domain Communications in complex JS appl...
JavaScript Security: Mastering Cross Domain Communications in complex JS appl...JavaScript Security: Mastering Cross Domain Communications in complex JS appl...
JavaScript Security: Mastering Cross Domain Communications in complex JS appl...
 
JSON Fuzzing: New approach to old problems
JSON Fuzzing: New  approach to old problemsJSON Fuzzing: New  approach to old problems
JSON Fuzzing: New approach to old problems
 
RESTful JSON web databases
RESTful JSON web databasesRESTful JSON web databases
RESTful JSON web databases
 
Android App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web ServicesAndroid App Development 06 : Network &amp; Web Services
Android App Development 06 : Network &amp; Web Services
 
08 ajax
08 ajax08 ajax
08 ajax
 
DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5DEV301- Web Service Programming with WCF 3.5
DEV301- Web Service Programming with WCF 3.5
 
RESTful services
RESTful servicesRESTful services
RESTful services
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
JSON and REST
JSON and RESTJSON and REST
JSON and REST
 
01. http basics v27
01. http basics v2701. http basics v27
01. http basics v27
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
REST
RESTREST
REST
 
JSON
JSONJSON
JSON
 
Advanced I/O in browser
Advanced I/O in browserAdvanced I/O in browser
Advanced I/O in browser
 
Android and REST
Android and RESTAndroid and REST
Android and REST
 
Intro to Sail.js
Intro to Sail.jsIntro to Sail.js
Intro to Sail.js
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
 

Plus de Thimo Jansen

AuditCase & XPages
AuditCase & XPagesAuditCase & XPages
AuditCase & XPagesThimo Jansen
 
XPages & Beer - Behind the scenes
XPages & Beer - Behind the scenesXPages & Beer - Behind the scenes
XPages & Beer - Behind the scenesThimo Jansen
 
XPages * XDocReport = X3
XPages * XDocReport = X3XPages * XDocReport = X3
XPages * XDocReport = X3Thimo Jansen
 
Een XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatformEen XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatformThimo Jansen
 
Engage - XPages & Beer
Engage - XPages & BeerEngage - XPages & Beer
Engage - XPages & BeerThimo Jansen
 

Plus de Thimo Jansen (7)

TeamPlan brochure
TeamPlan brochureTeamPlan brochure
TeamPlan brochure
 
AuditCase & XPages
AuditCase & XPagesAuditCase & XPages
AuditCase & XPages
 
XPages & Beer - Behind the scenes
XPages & Beer - Behind the scenesXPages & Beer - Behind the scenes
XPages & Beer - Behind the scenes
 
XPages * XDocReport = X3
XPages * XDocReport = X3XPages * XDocReport = X3
XPages * XDocReport = X3
 
Een XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatformEen XPages implementatie van het Ogone betaalplatform
Een XPages implementatie van het Ogone betaalplatform
 
Engage - XPages & Beer
Engage - XPages & BeerEngage - XPages & Beer
Engage - XPages & Beer
 
xe:objectData
xe:objectDataxe:objectData
xe:objectData
 

Dernier

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

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