SlideShare a Scribd company logo
1 of 34
Download to read offline
being in a state of REST
             Aslam Khan
              @aslamkhn
            aslamkhan.net
       aslam.khan@factor10.com
What’s not on the agenda

          sniper shots

grenades strapped to chest rants

         mass hypnosis
Let’s take a few steps back
I did do this...create quote

        POST /quoteService
        <QuoteRequestMessage ...


                                    quote
                                   service



             200 OK
             <Quote ...
and this … accept quote
      POST /quoteService
      <AcceptQuoteMessage ...


                                 quote
                                service



       200 OK
       <StatusMessage ...
and this … exceptions
     POST /quoteService
     <AcceptQuoteMessage ...


                                quote
                               service



        200 OK
        <Error ...
REST(0)
POST /quoteService
<QuoteRequestMessage ...




                                       slinging XML
                            quote
                           service



      200 OK
      <Quote ...

POST /quoteService
<AcceptQuoteMessage ...


                            quote
                           service
                                          RPC == true
  200 OK




                                        REST == false
  <StatusMessage ...
POST /quoteService
<AcceptQuoteMessage ...


                            quote
                           service




   200 OK
   <Error ...




            no uniformity => accidental complexity
We should use
standards, right?
enter WS_*



   do contract first
xml schema + wsdl + soap + ...
   ptaaanngg!! ... oops … sniper shot

    feels like static typing in a dynamic world
WS-*
POST /quoteService
<QuoteRequestMessage ...




                                      slinging XML
                            quote
                           service



      200 OK
      <Quote ...

POST /quoteService
<AcceptQuoteMessage ...




                                        with envelopes
                            quote
                           service



  200 OK
  <StatusMessage ...



                                      Complex remote access protocol
POST /quoteService
<AcceptQuoteMessage ...


                            quote
                           service




   200 OK
   <Error ...




     toolsets are symptomatic of the complexity
This is not my idea of software development
Next attempt … many endpoints
       POST /customer/176202?fromDate...

                                /customer

              200 OK
              <Quote id="Q91827"


       POST /quote?ref=Q91827

                                /quote

              200 OK
              <Policy...
same thing … just friendly
     POST <FindQuote fromDate="...

                             /customer/176202

           200 OK
           <Quote id="Q91827"


     POST <AcceptQuote

                             /quote/Q91827

           200 OK
           <Policy...
but I can almost imagine the model
            customer

        findQuote(...)


                         *
                               quote

              policy         accept(...)
REST(1)



resources
addressability


oo-ish but no uniformity
How about this … verb idioms
    GET /customer/176202/quotes?from...

                                 /customer

              200 OK
              <Quote id="Q91827"


        POST /quote/Q91827
        <Acceptance ...

                                /quote

         201 OK
         Location: /policy/PX81730Z9...
         <Policy id="PX81730Z9...
Predictability is more important than
               GET          retrieve
                POST         create

                 PUT         update

          DELETE             delete

          don’t be dogmatic, be pragmatic
       think safe vs unsafe and side-effects
Again, being predictable

         201        created

        409         conflict

         401        unauthorised
         ...        ...

   uniformity is a powerful force
REST(2)



  HTTP Verbs
       +response codes


uniformity + unsafe vs safe operations
    but dumping a ton of URI’s on your friends is not very nice
This is the next step
    GET /customer/176202

                            /customer

200 OK
<Customer id="Q91827" ...
 <links>
   <link rel='find quotes'
         uri='/quotes/176202"/>
   <link rel='policy' uri='/policy/PX81730Z9"/>
and so on ...
    GET /quotes/Q91827




200 OK
<Quotes customer="176202" ...
 <quote id="Q91827"
   <links>
    <link rel='accept quote'
         uri='/blahblah?id="Q91827"/>
    <link rel='cancel quote'
         uri='/ushoqwbyw/198n392/>
state changed?
    GET /quotes/Q91827




200 OK
<Quotes customer="176202" ...
 <quote id="Q91827"
   <links>
    <link rel="self" uri='/quote/Q91827"/>
   </link>
REST(3)



      Hypermedia
           (HATEOS)


HTTP idioms + media-types + hypermedia
REST(0)

REST(1)

REST(2)
          }   vanilla Rails somewhere here




                 Richard
REST(3)
                                     son
                 maturity
                                 model
this is the signal
  in the noise!
  But it is always about design.

  How do you design when REST
  is your architectural style?

  REST is not the end goal, it is
  actually your starting position.

  And it’s not for everything.
REST(0)

REST(1)
               This is a
REST(2)     design choice.
          ranges from exploiting HTTP
               to honoring HTTP
REST(3)
Some context first

Design, for me, is just answering two questions.


   1. Does that thing express its intention?

   2. Where should I put that thing?
5 Design things to think about
resource overloading is not reuse
   doubling up a resource to serve more than
   its single purpose is more likely to introduce
   accidental complexity than visible benefit.

                               +

   there is no cost to having lots of resources
            (if there is, you have a bigger problem)




        the set of resources is open ended
Refer to self is important
        POST /customer
        <customer> ... </customer>



        200 OK
        <customer id=194839>
          ...
          <links>
            <link rel=”self” uri=”/customer/194839>
          </links>
        </customer>


no need to expose /customer/{customer_id}


            reduce URI explosions
Jou ma se State!

    customer

findQuote(...)


                 *
                       quote

      policy         accept(...)




  domain state                          resource state         application state




                                   app state can be inferred
Search

     /policy                /claim             /customer




Find all resources where         Find all claims that are
there is an email address        approved but unpaid and
“aslam.khan@factor10.com”       where the policy is paid up

    create another resource for the result … and then?
Domain : Resource Impedance
                                                      GET /lastmovement/CA28382
vehicle
                                                       { registration : Ca28382,
                                                         last_movement: {
                                         ?                 odo: 78282,
           *
                                                           lat: ...
                  movement
                                                          }
position                                                  links { ... }
                                                       }

           aggregates ==
                 resources?
               entities == resources?
                   not necessarily
               it is still a bi-directional mapping
                          no domain model?
                              problem
                             where should we model
                                   behavior?
Thanks, and so long

def valuable?(signal, noise)
  (signal.power/noise.power) > 1
end

valuable?(hype, design).should == false
valuable?(design, hype).should == true




        obligatory ruby code slide

More Related Content

Viewers also liked

Hybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-PaperHybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-Paper
Nguyen Nguyen
 
Special quadrilaterals proofs ans constructions
Special quadrilaterals  proofs ans constructions Special quadrilaterals  proofs ans constructions
Special quadrilaterals proofs ans constructions
cristufer
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kaye
Cee Saliendrez
 
Oracle 10g Reference
Oracle 10g  ReferenceOracle 10g  Reference
Oracle 10g Reference
Edison
 
Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)
Julia vbvvvhgcv
 

Viewers also liked (17)

Hybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-PaperHybrid-Active-Optical-Cable-White-Paper
Hybrid-Active-Optical-Cable-White-Paper
 
Building Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience ManagerBuilding Creative Product Extensions with Experience Manager
Building Creative Product Extensions with Experience Manager
 
Economic environment unit6
Economic environment unit6Economic environment unit6
Economic environment unit6
 
Respeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculumRespeaking as a part of translation and interpreting curriculum
Respeaking as a part of translation and interpreting curriculum
 
Special quadrilaterals proofs ans constructions
Special quadrilaterals  proofs ans constructions Special quadrilaterals  proofs ans constructions
Special quadrilaterals proofs ans constructions
 
Bao cao thuc tap
Bao cao thuc tapBao cao thuc tap
Bao cao thuc tap
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kaye
 
Top 10 Tips from Millionaires
Top 10 Tips from MillionairesTop 10 Tips from Millionaires
Top 10 Tips from Millionaires
 
Oracle 10g Reference
Oracle 10g  ReferenceOracle 10g  Reference
Oracle 10g Reference
 
Thinking Outside the Box that Keeps Moving
Thinking Outside the Box that Keeps MovingThinking Outside the Box that Keeps Moving
Thinking Outside the Box that Keeps Moving
 
Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)
 
Unit 2 Communication
Unit 2 CommunicationUnit 2 Communication
Unit 2 Communication
 
15 mei 2013
15 mei 201315 mei 2013
15 mei 2013
 
Time saver project template
Time saver project templateTime saver project template
Time saver project template
 
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
 
Nce2文本
Nce2文本Nce2文本
Nce2文本
 
Facebook Tackle Box: 10 Apps & Tools Every Brand Should Use
Facebook Tackle Box: 10 Apps & Tools Every Brand Should UseFacebook Tackle Box: 10 Apps & Tools Every Brand Should Use
Facebook Tackle Box: 10 Apps & Tools Every Brand Should Use
 

Similar to Being in a State of REST

Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
deimos
 
The vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQLThe vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQL
Lukas Eder
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
AOE
 
Apache O D E Apache Con E U2008
Apache O D E  Apache Con E U2008Apache O D E  Apache Con E U2008
Apache O D E Apache Con E U2008
elliando dias
 

Similar to Being in a State of REST (20)

SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
 
Service migration
Service migrationService migration
Service migration
 
Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101Geek Sync | Rewriting Bad SQL Code 101
Geek Sync | Rewriting Bad SQL Code 101
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
 
Spa, isomorphic and back to the server our journey with js @ frontend con po...
Spa, isomorphic and back to the server  our journey with js @ frontend con po...Spa, isomorphic and back to the server  our journey with js @ frontend con po...
Spa, isomorphic and back to the server our journey with js @ frontend con po...
 
Man in the Middle Attack on Banks
Man in the Middle Attack on BanksMan in the Middle Attack on Banks
Man in the Middle Attack on Banks
 
Good code
Good codeGood code
Good code
 
Behavioral Driven Development
Behavioral Driven Development Behavioral Driven Development
Behavioral Driven Development
 
The vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQLThe vJUG talk about jOOQ: Get Back in Control of Your SQL
The vJUG talk about jOOQ: Get Back in Control of Your SQL
 
MongoDB Stitch Tutorial
MongoDB Stitch TutorialMongoDB Stitch Tutorial
MongoDB Stitch Tutorial
 
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
ArchSummit Shenzhen - Using sagas to maintain data consistency in a microserv...
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
JCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problemsJCon Live 2023 - Lice coding some integration problems
JCon Live 2023 - Lice coding some integration problems
 
Rails and security
Rails and securityRails and security
Rails and security
 
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
Staying railsy - while scaling complexity or Ruby on Rails in Enterprise Soft...
 
Ws rest
Ws restWs rest
Ws rest
 
Apache O D E Apache Con E U2008
Apache O D E  Apache Con E U2008Apache O D E  Apache Con E U2008
Apache O D E Apache Con E U2008
 
Non Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsNon Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic Conditions
 

More from Aslam Khan

The Humble Programmer
The Humble ProgrammerThe Humble Programmer
The Humble Programmer
Aslam Khan
 
Collaboration: TRC
Collaboration: TRCCollaboration: TRC
Collaboration: TRC
Aslam Khan
 

More from Aslam Khan (12)

The Humble Programmer
The Humble ProgrammerThe Humble Programmer
The Humble Programmer
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in Reasoning
 
Do we care rubyfuza 2019
Do we care   rubyfuza 2019Do we care   rubyfuza 2019
Do we care rubyfuza 2019
 
Agile Rabbit Holes
Agile Rabbit HolesAgile Rabbit Holes
Agile Rabbit Holes
 
How to get open data into the hands of activists
How to get open data into the hands of activistsHow to get open data into the hands of activists
How to get open data into the hands of activists
 
Beyond Apartheid and Democracy
Beyond Apartheid and DemocracyBeyond Apartheid and Democracy
Beyond Apartheid and Democracy
 
Not Quite Object Oriented
Not Quite Object OrientedNot Quite Object Oriented
Not Quite Object Oriented
 
Lean in Software Development
Lean in Software DevelopmentLean in Software Development
Lean in Software Development
 
Product Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile WebinarProduct Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile Webinar
 
Yet another building metaphor
Yet another building metaphorYet another building metaphor
Yet another building metaphor
 
Practical Scrum with Kent Beck (SD Times Webinar)
Practical Scrum with Kent Beck (SD Times Webinar)Practical Scrum with Kent Beck (SD Times Webinar)
Practical Scrum with Kent Beck (SD Times Webinar)
 
Collaboration: TRC
Collaboration: TRCCollaboration: TRC
Collaboration: TRC
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Being in a State of REST

  • 1. being in a state of REST Aslam Khan @aslamkhn aslamkhan.net aslam.khan@factor10.com
  • 2. What’s not on the agenda sniper shots grenades strapped to chest rants mass hypnosis
  • 3. Let’s take a few steps back
  • 4. I did do this...create quote POST /quoteService <QuoteRequestMessage ... quote service 200 OK <Quote ...
  • 5. and this … accept quote POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <StatusMessage ...
  • 6. and this … exceptions POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <Error ...
  • 7. REST(0) POST /quoteService <QuoteRequestMessage ... slinging XML quote service 200 OK <Quote ... POST /quoteService <AcceptQuoteMessage ... quote service RPC == true 200 OK REST == false <StatusMessage ... POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <Error ... no uniformity => accidental complexity
  • 9. enter WS_* do contract first xml schema + wsdl + soap + ... ptaaanngg!! ... oops … sniper shot feels like static typing in a dynamic world
  • 10. WS-* POST /quoteService <QuoteRequestMessage ... slinging XML quote service 200 OK <Quote ... POST /quoteService <AcceptQuoteMessage ... with envelopes quote service 200 OK <StatusMessage ... Complex remote access protocol POST /quoteService <AcceptQuoteMessage ... quote service 200 OK <Error ... toolsets are symptomatic of the complexity
  • 11. This is not my idea of software development
  • 12. Next attempt … many endpoints POST /customer/176202?fromDate... /customer 200 OK <Quote id="Q91827" POST /quote?ref=Q91827 /quote 200 OK <Policy...
  • 13. same thing … just friendly POST <FindQuote fromDate="... /customer/176202 200 OK <Quote id="Q91827" POST <AcceptQuote /quote/Q91827 200 OK <Policy...
  • 14. but I can almost imagine the model customer findQuote(...) * quote policy accept(...)
  • 16. How about this … verb idioms GET /customer/176202/quotes?from... /customer 200 OK <Quote id="Q91827" POST /quote/Q91827 <Acceptance ... /quote 201 OK Location: /policy/PX81730Z9... <Policy id="PX81730Z9...
  • 17. Predictability is more important than GET retrieve POST create PUT update DELETE delete don’t be dogmatic, be pragmatic think safe vs unsafe and side-effects
  • 18. Again, being predictable 201 created 409 conflict 401 unauthorised ... ... uniformity is a powerful force
  • 19. REST(2) HTTP Verbs +response codes uniformity + unsafe vs safe operations but dumping a ton of URI’s on your friends is not very nice
  • 20. This is the next step GET /customer/176202 /customer 200 OK <Customer id="Q91827" ... <links> <link rel='find quotes' uri='/quotes/176202"/> <link rel='policy' uri='/policy/PX81730Z9"/>
  • 21. and so on ... GET /quotes/Q91827 200 OK <Quotes customer="176202" ... <quote id="Q91827" <links> <link rel='accept quote' uri='/blahblah?id="Q91827"/> <link rel='cancel quote' uri='/ushoqwbyw/198n392/>
  • 22. state changed? GET /quotes/Q91827 200 OK <Quotes customer="176202" ... <quote id="Q91827" <links> <link rel="self" uri='/quote/Q91827"/> </link>
  • 23. REST(3) Hypermedia (HATEOS) HTTP idioms + media-types + hypermedia
  • 24. REST(0) REST(1) REST(2) } vanilla Rails somewhere here Richard REST(3) son maturity model
  • 25. this is the signal in the noise! But it is always about design. How do you design when REST is your architectural style? REST is not the end goal, it is actually your starting position. And it’s not for everything.
  • 26. REST(0) REST(1) This is a REST(2) design choice. ranges from exploiting HTTP to honoring HTTP REST(3)
  • 27. Some context first Design, for me, is just answering two questions. 1. Does that thing express its intention? 2. Where should I put that thing?
  • 28. 5 Design things to think about
  • 29. resource overloading is not reuse doubling up a resource to serve more than its single purpose is more likely to introduce accidental complexity than visible benefit. + there is no cost to having lots of resources (if there is, you have a bigger problem) the set of resources is open ended
  • 30. Refer to self is important POST /customer <customer> ... </customer> 200 OK <customer id=194839> ... <links> <link rel=”self” uri=”/customer/194839> </links> </customer> no need to expose /customer/{customer_id} reduce URI explosions
  • 31. Jou ma se State! customer findQuote(...) * quote policy accept(...) domain state resource state application state app state can be inferred
  • 32. Search /policy /claim /customer Find all resources where Find all claims that are there is an email address approved but unpaid and “aslam.khan@factor10.com” where the policy is paid up create another resource for the result … and then?
  • 33. Domain : Resource Impedance GET /lastmovement/CA28382 vehicle { registration : Ca28382, last_movement: { ? odo: 78282, * lat: ... movement } position links { ... } } aggregates == resources? entities == resources? not necessarily it is still a bi-directional mapping no domain model? problem where should we model behavior?
  • 34. Thanks, and so long def valuable?(signal, noise) (signal.power/noise.power) > 1 end valuable?(hype, design).should == false valuable?(design, hype).should == true obligatory ruby code slide