SlideShare una empresa de Scribd logo
1 de 81
REST
+JS
the future for
highly interactive
web apps?
The case for

a new          (ish)


Web App
style
The Evolution
 of WebApps
static
html
dynamically
generated
 static html pages
generated
bits of html

         with some
javascript for "moving
         things around"
What do those
have in common?
Most of the work
  is done on the
           server
Does this
make
sense?
State of the art MVC
                  frameworks

  where the M
         the C
and even the V

    are server side concepts?
Maybe it did
    before
But now...
HTML+CSS gives us a very
capable presentation
technology
and it gets more powerful
everyday
Javascript, well...everybody
      loves it now
The browsers
even those from Redmond
 are fast enough for most
                    things
...I think now there's a better
                           way
Let's
**really**
embrace the
  medium
Let's implement
 the GUI of our
webapps on the
    browser
Let's implement
  the GUI of our
 webapps on the
     browser


all of it
And we'll use the server
for the business logic.
And we'll use the server
for the business logic.

  For a services
      layer
And we'll use the server
for the business logic.

  For a services
      layer
  (and services are also cool now)
But why should we?
Because apps get
easier to develop
when we don't have to fight
   against the platform
Because we can
   make better,
   faster, more
 responsive apps
that take advantage of all of
 the mediums's possibilities
Because at the end
 you'll get an API
   thrown in for free
Are you convinced?
So,

Why REST?
Because it’s not
     SOAP
       :)
First,
a short primer on
REST
REST: REpresentational State
        Transfer
Cool acronym, but terrible
          name
Central to REST is
 the concept of
   Resources
Resources are referenced
    by a global identifier
e.g., an URI
Resources can have
different representations
text/html, application/json, application/vnd.ms-
                      excel
Communication is done
via a standard interface
 HTTP, with all it's methods (GET, PUT, POST,
                                 DELETE, etc.)
You do things in REST by
       transferring
 representations of the
   state of a resource
the
Richardson
Maturity
Model
Level 0
One URI, one HTTP method
Level 1
Many URIs, one HTTP
method
Level 2
Many URIs,
each supporting many HTTP
methods
Level 3
HATEOAS   (Hypertext As The Engine Of Application State)


using links for state
transitions
And we come to
the advantages of
REST
Its Simple
Its Proven
It scales **really**
        well
There’s great
language support
      for it
in all the languages that you’ll want
                to use
But, most importantly,

that's what the
browsers speak
And,

on the
Browser
side?
We’re building a
      GUI
Let’s turn to GUI patterns
MVC
An old favorite,
lots of documentation,
lots of experience
MVP
Very similar to MVC,
with some differences which
I think make it better.
M for Model
M for Model

communicates with
   the server
M for Model
 encapsulates the
    logic of the
 resources being
   manipulated.
M for Model

gives access to the
       data
M for Model
raises events when
    something
    interesting
     happens
most often when the data changes in some way
V for View
V for View
    notifies the
  Presenter of the
   user's actions
V for View
abstracts the DOM
  manipulation
      details
P for Presenter
P for Presenter
 tells the model to
read data from the
        server
P for Presenter

 receives events
 from the model
P for Presenter

 reads data from
    the model
P for Presenter

 instructs the view
to present the data
P for Presenter
      receives
 notifications from
   the view of the
    user's actions
P for Presenter

updates the model
P for Presenter
instructs the model
to send the data to
     the server
There's
  **absolutely no
 communication**
between the Model
   and the View
A Presenter may
subscribe to events
  from multiple
     Models
A Presenter may
command multiple
      Views
Presenters can
communicate with
 each other, but
     one-way
communication is
     preferred
Advantages?
Strict separation of
      the DOM
manipulation code
Easier Testing
one place to look
to understand the
    GUI logic
one place to look
    for data
  manipulation
DEMO
TIME
Lets

wrap up
Thank you!


 @jnelas

Más contenido relacionado

Destacado

Knowledge sharing in coopetitive alliances
Knowledge sharing in coopetitive alliancesKnowledge sharing in coopetitive alliances
Knowledge sharing in coopetitive alliances
Miia Kosonen
 
Ley pesca extremadura 2011
Ley pesca extremadura 2011Ley pesca extremadura 2011
Ley pesca extremadura 2011
muchapesca
 
Valle romano kutxa
Valle romano kutxaValle romano kutxa
Valle romano kutxa
guest7439ecf
 
China antimony industry report, 2010
China antimony industry report, 2010China antimony industry report, 2010
China antimony industry report, 2010
ResearchInChina
 
Realismo Magico En La Literatura De Moni K
Realismo Magico En La Literatura De Moni KRealismo Magico En La Literatura De Moni K
Realismo Magico En La Literatura De Moni K
monica andrea
 
TP2 PROCOM ROTARY INTERNATIONAL
TP2 PROCOM ROTARY INTERNATIONALTP2 PROCOM ROTARY INTERNATIONAL
TP2 PROCOM ROTARY INTERNATIONAL
mafe07
 

Destacado (20)

Knowledge sharing in coopetitive alliances
Knowledge sharing in coopetitive alliancesKnowledge sharing in coopetitive alliances
Knowledge sharing in coopetitive alliances
 
SI TU CORAZÓN TE FALLA
SI TU CORAZÓN TE FALLASI TU CORAZÓN TE FALLA
SI TU CORAZÓN TE FALLA
 
20151105_Infoday RS1_Juan Riese
20151105_Infoday RS1_Juan Riese20151105_Infoday RS1_Juan Riese
20151105_Infoday RS1_Juan Riese
 
Ley pesca extremadura 2011
Ley pesca extremadura 2011Ley pesca extremadura 2011
Ley pesca extremadura 2011
 
Valle romano kutxa
Valle romano kutxaValle romano kutxa
Valle romano kutxa
 
Nuestra Feliz Infancia
Nuestra Feliz InfanciaNuestra Feliz Infancia
Nuestra Feliz Infancia
 
Verbatim Gateway Alarm Autodialer Training
Verbatim Gateway Alarm Autodialer TrainingVerbatim Gateway Alarm Autodialer Training
Verbatim Gateway Alarm Autodialer Training
 
China antimony industry report, 2010
China antimony industry report, 2010China antimony industry report, 2010
China antimony industry report, 2010
 
Mappe 5 B 2012 2013
Mappe 5 B 2012 2013Mappe 5 B 2012 2013
Mappe 5 B 2012 2013
 
RANCHO DE GANGA
RANCHO DE GANGARANCHO DE GANGA
RANCHO DE GANGA
 
Realismo Magico En La Literatura De Moni K
Realismo Magico En La Literatura De Moni KRealismo Magico En La Literatura De Moni K
Realismo Magico En La Literatura De Moni K
 
Saga la guarida del escriba
Saga la guarida del escribaSaga la guarida del escriba
Saga la guarida del escriba
 
Los secrfetos de la excelencia
Los secrfetos de la excelenciaLos secrfetos de la excelencia
Los secrfetos de la excelencia
 
Pueblos con encanto
Pueblos con encantoPueblos con encanto
Pueblos con encanto
 
TP2 PROCOM ROTARY INTERNATIONAL
TP2 PROCOM ROTARY INTERNATIONALTP2 PROCOM ROTARY INTERNATIONAL
TP2 PROCOM ROTARY INTERNATIONAL
 
La tutoria virtual: técnicas, herramientas y estrategias
La tutoria virtual: técnicas, herramientas y estrategiasLa tutoria virtual: técnicas, herramientas y estrategias
La tutoria virtual: técnicas, herramientas y estrategias
 
Virgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
Virgo 3.0, OSGi middleware server from EclipseRT – Christopher FrostVirgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
Virgo 3.0, OSGi middleware server from EclipseRT – Christopher Frost
 
El origen de las computadoras
El origen de las computadorasEl origen de las computadoras
El origen de las computadoras
 
February 2015 Monthly Flash Report
February 2015 Monthly Flash ReportFebruary 2015 Monthly Flash Report
February 2015 Monthly Flash Report
 
Strengthen Your Brand - 7 Effective Ways
Strengthen Your Brand  - 7 Effective WaysStrengthen Your Brand  - 7 Effective Ways
Strengthen Your Brand - 7 Effective Ways
 

Similar a REST+JS - Codebits 2011

Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Chris Love
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
webhostingguy
 
Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...
Christina Berger
 
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Axway Appcelerator
 

Similar a REST+JS - Codebits 2011 (20)

REST full API Design
REST full API DesignREST full API Design
REST full API Design
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-Developers
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Spring diy projects
Spring diy projectsSpring diy projects
Spring diy projects
 
Spring interview questions
Spring interview questionsSpring interview questions
Spring interview questions
 
Spring learning path
Spring learning pathSpring learning path
Spring learning path
 
Day03 api
Day03   apiDay03   api
Day03 api
 
REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)REST: So What's It All About? (SAP TechEd 2011, MOB107)
REST: So What's It All About? (SAP TechEd 2011, MOB107)
 
REST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and LiesREST vs WS-*: Myths Facts and Lies
REST vs WS-*: Myths Facts and Lies
 
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
REST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnapREST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnap
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
What are restful web services?
What are restful web services?What are restful web services?
What are restful web services?
 
Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...Data As A Service Composition Of Daas And Negotiation...
Data As A Service Composition Of Daas And Negotiation...
 
Build APIs With Kapow Mashup Server
Build APIs With Kapow Mashup ServerBuild APIs With Kapow Mashup Server
Build APIs With Kapow Mashup Server
 
Web Applications Are Technically Awesome!
Web Applications Are Technically Awesome!Web Applications Are Technically Awesome!
Web Applications Are Technically Awesome!
 
SD Forum Java SIG - Service Oriented UI Architecture
SD Forum Java SIG - Service Oriented UI ArchitectureSD Forum Java SIG - Service Oriented UI Architecture
SD Forum Java SIG - Service Oriented UI Architecture
 
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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)
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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...
 
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...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

REST+JS - Codebits 2011

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. CGIs -> PHP, ASPs, Java Servlets, JSPs, etc...\n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. The difficulties with the browsers (slowness, incompatibility, tables)\nLack of good practices, libs and tools for JS\n
  12. \n
  13. \n
  14. and its fast\n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. XML-RPC, SOAP\n
  38. /post/1/delete\n/basket/add/\n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. it's the brains of the GUI\n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. it's the brains of the GUI\n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n