ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
RESTx: Rest for the rest of us


                  Ken Yagen
    Silicon Valley Code Camp, October, 2010
Agenda


• The Programmable Web
• What is RESTx?
• Demo
• Building a simple component
• Roadmap
• Questions / More information
The Programmable Web


• Resources
   •   Must have a URI
• Addressability
   –   Name them using URIs
   –   Give them structure - http://www.restxdemo.org/resource/sales/2004/Q4
• Representations
   –   Resources support different representations (XML, JSON, HTML, SVG, …)
• Uniform Interface
   –   HTTP (GET, HEAD, PUT, DELETE, POST)
• Statelessness, Connectedness
• Building Blocks (HTTP, URI, XML, JSON)
Examples of RESTful services


http://www.foo.com/sales/2010
http://www.foo.com/sales/2010/q3
http://www.foo.com/weather/sanfrancisco/current
http://www.foo.com/weather/sanfrancisco/tomorrow
http://www.foo.com/rankings/college/football/bcs
http://www.foo.com/rankings/college/football/bcs?school=stanford
 http://www.foo.com/search?query=restx




All contents Copyright © 2009, MuleSoft Inc.
What is RESTx?


• The simplest way to create RESTful web services
   •   Encourages and enables RESTful concepts
   •   Hides underlying implementation details
   •   RESTx resources are self documenting and discoverable
• RESTx is a server, not a framework
• Use Cases
   •   Create rich data services by integrating different data sources
   •   Customized resources from cloud services and internal databases
   •   Data Layer for JavaScript application
   •   Wrap legacy scripts into reusable components
What is RESTx?




All contents Copyright © 2009, MuleSoft Inc.   6
First a Demo




All contents Copyright © 2009, MuleSoft Inc.
Building a simple component


• Create Component
        ./restxctl component create MyTestComponent [ java | python | javascript ]

• Annotate It
        @ComponentInfo(name = "SomeSampleComponent",
                       description = "One line description of the component",
                       doc               = "Longer description text, possibly multi-line, goes here“)
• Implement service method
• Compile it (Java only)
        ./restxctl component compile

• Start Server
        ./restxctl start




All contents Copyright © 2009, MuleSoft Inc.
Roadmap


• http://www.restx.org/restx-roadmap.html
• Highlights
        •    Pipelines
        •    Ruby, Groovy, PHP Support
        •    iBeans Support
        •    Version Control, Caching




All contents Copyright © 2009, MuleSoft Inc.
Why RESTx?


• Publishing Data as RESTful resources
        •    Any piece of interesting data can be a resource

        •    Users can construct their own resources

        •    Resources are accessible from an web URL

• Self-documenting and browse-able APIs are powerful

• Accessible for less-skilled developers, different language skills
        •    Java, Python, JavaScript

• Makes it easier to develop web 2.0 and mobile apps that require
  access to external resources



All contents Copyright © 2009, MuleSoft Inc.                          10
More Information


Website: http://www.restx.org
Download: http://www.restx.org/quick-start-guide.html
Source Code: git clone git://github.com/mulesoft/RESTx.git
Online Demo: http://restxdemo.mulesoft.org/static/demo/start.html
Blog: http://blogs.mulesoft.org
Forums: http://www.restx.org/community.html
My Email: ken.yagen@mulesoft.com


                                               Questions?



All contents Copyright © 2009, MuleSoft Inc.

More Related Content

2010 code camp rest for the rest of us

  • 1. RESTx: Rest for the rest of us Ken Yagen Silicon Valley Code Camp, October, 2010
  • 2. Agenda • The Programmable Web • What is RESTx? • Demo • Building a simple component • Roadmap • Questions / More information
  • 3. The Programmable Web • Resources • Must have a URI • Addressability – Name them using URIs – Give them structure - http://www.restxdemo.org/resource/sales/2004/Q4 • Representations – Resources support different representations (XML, JSON, HTML, SVG, …) • Uniform Interface – HTTP (GET, HEAD, PUT, DELETE, POST) • Statelessness, Connectedness • Building Blocks (HTTP, URI, XML, JSON)
  • 4. Examples of RESTful services http://www.foo.com/sales/2010 http://www.foo.com/sales/2010/q3 http://www.foo.com/weather/sanfrancisco/current http://www.foo.com/weather/sanfrancisco/tomorrow http://www.foo.com/rankings/college/football/bcs http://www.foo.com/rankings/college/football/bcs?school=stanford http://www.foo.com/search?query=restx All contents Copyright © 2009, MuleSoft Inc.
  • 5. What is RESTx? • The simplest way to create RESTful web services • Encourages and enables RESTful concepts • Hides underlying implementation details • RESTx resources are self documenting and discoverable • RESTx is a server, not a framework • Use Cases • Create rich data services by integrating different data sources • Customized resources from cloud services and internal databases • Data Layer for JavaScript application • Wrap legacy scripts into reusable components
  • 6. What is RESTx? All contents Copyright © 2009, MuleSoft Inc. 6
  • 7. First a Demo All contents Copyright © 2009, MuleSoft Inc.
  • 8. Building a simple component • Create Component ./restxctl component create MyTestComponent [ java | python | javascript ] • Annotate It @ComponentInfo(name = "SomeSampleComponent", description = "One line description of the component", doc = "Longer description text, possibly multi-line, goes here“) • Implement service method • Compile it (Java only) ./restxctl component compile • Start Server ./restxctl start All contents Copyright © 2009, MuleSoft Inc.
  • 9. Roadmap • http://www.restx.org/restx-roadmap.html • Highlights • Pipelines • Ruby, Groovy, PHP Support • iBeans Support • Version Control, Caching All contents Copyright © 2009, MuleSoft Inc.
  • 10. Why RESTx? • Publishing Data as RESTful resources • Any piece of interesting data can be a resource • Users can construct their own resources • Resources are accessible from an web URL • Self-documenting and browse-able APIs are powerful • Accessible for less-skilled developers, different language skills • Java, Python, JavaScript • Makes it easier to develop web 2.0 and mobile apps that require access to external resources All contents Copyright © 2009, MuleSoft Inc. 10
  • 11. More Information Website: http://www.restx.org Download: http://www.restx.org/quick-start-guide.html Source Code: git clone git://github.com/mulesoft/RESTx.git Online Demo: http://restxdemo.mulesoft.org/static/demo/start.html Blog: http://blogs.mulesoft.org Forums: http://www.restx.org/community.html My Email: ken.yagen@mulesoft.com Questions? All contents Copyright © 2009, MuleSoft Inc.