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-PaperNguyen Nguyen
 
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 Managerconnectwebex
 
Economic environment unit6
Economic environment unit6Economic environment unit6
Economic environment unit6UNBFS
 
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 curriculumUniversity of Warsaw
 
Special quadrilaterals proofs ans constructions
Special quadrilaterals  proofs ans constructions Special quadrilaterals  proofs ans constructions
Special quadrilaterals proofs ans constructions cristufer
 
Bao cao thuc tap
Bao cao thuc tapBao cao thuc tap
Bao cao thuc tapmrcuong1389
 
Answers in environmental education @kaye
Answers in environmental education @kayeAnswers in environmental education @kaye
Answers in environmental education @kayeCee Saliendrez
 
Top 10 Tips from Millionaires
Top 10 Tips from MillionairesTop 10 Tips from Millionaires
Top 10 Tips from Millionairesmaemis
 
Oracle 10g Reference
Oracle 10g  ReferenceOracle 10g  Reference
Oracle 10g ReferenceEdison
 
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 MovingLuke Brooker
 
Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)Ch099 a finalexam-pretest(1)
Ch099 a finalexam-pretest(1)Julia vbvvvhgcv
 
Unit 2 Communication
Unit 2 CommunicationUnit 2 Communication
Unit 2 Communicationnigelcollege
 
Time saver project template
Time saver project templateTime saver project template
Time saver project templateKim Cao
 
Nce2文本
Nce2文本Nce2文本
Nce2文本Qu Yi
 
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 UseFirebelly Marketing
 

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

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...Alessandro Nadalin
 
Service migration
Service migrationService migration
Service migrationBipin
 
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 101IDERA Software
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfacesdeimos
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
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 SymfonyIgnacio Martín
 
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...Alessandro Nadalin
 
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 BanksMarko Elezović
 
Behavioral Driven Development
Behavioral Driven Development Behavioral Driven Development
Behavioral Driven Development Cprime
 
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 SQLLukas Eder
 
MongoDB Stitch Tutorial
MongoDB Stitch TutorialMongoDB Stitch Tutorial
MongoDB Stitch TutorialMongoDB
 
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...Chris Richardson
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuningAOE
 
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 problemsBernd Ruecker
 
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...Coupa Software
 
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 U2008elliando dias
 
Non Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsNon Blocking Algorithms at Traffic Conditions
Non Blocking Algorithms at Traffic ConditionsReturn on Intelligence
 

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 ProgrammerAslam Khan
 
Experiments in Reasoning
Experiments in ReasoningExperiments in Reasoning
Experiments in ReasoningAslam Khan
 
Do we care rubyfuza 2019
Do we care   rubyfuza 2019Do we care   rubyfuza 2019
Do we care rubyfuza 2019Aslam Khan
 
Agile Rabbit Holes
Agile Rabbit HolesAgile Rabbit Holes
Agile Rabbit HolesAslam Khan
 
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 activistsAslam Khan
 
Beyond Apartheid and Democracy
Beyond Apartheid and DemocracyBeyond Apartheid and Democracy
Beyond Apartheid and DemocracyAslam Khan
 
Not Quite Object Oriented
Not Quite Object OrientedNot Quite Object Oriented
Not Quite Object OrientedAslam Khan
 
Lean in Software Development
Lean in Software DevelopmentLean in Software Development
Lean in Software DevelopmentAslam Khan
 
Product Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile WebinarProduct Ownership - Leaders of Agile Webinar
Product Ownership - Leaders of Agile WebinarAslam Khan
 
Yet another building metaphor
Yet another building metaphorYet another building metaphor
Yet another building metaphorAslam Khan
 
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)Aslam Khan
 
Collaboration: TRC
Collaboration: TRCCollaboration: TRC
Collaboration: TRCAslam 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

UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 

Recently uploaded (20)

201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 

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