agile restful web development
play

Agile RESTful Web Development Michael Marth Michael Drig v e l - PowerPoint PPT Presentation

Agile RESTful Web Development Michael Marth Michael Drig v e l o p e r n i o r D e S e T e c h n o l o g y E v a n g e l i s t m i c h a e c o m l . m a r t h @ i g @ d a y . d a y .


  1. Agile RESTful Web Development Michael Marth Michael Dürig v e l o p e r n i o r D e S e T e c h n o l o g y E v a n g e l i s t m i c h a e c o m l . m a r t h @ i g @ d a y . d a y . c o m a e l . d u e r m i c h

  2. Jugs - Agenda REST in 15 minutes Meet Apache Sling demo & code

  3. What is REST? B Technology A API D Architectural Style C SOAP’s arch enemy

  4. REST: An Architectural Style One of many Architectural Styles Architectural principles of the web, defined a posteriori Defined through architectural g n constraints i d l e i F T . y o R Chief Scientist at Day Software

  5. Styles and implementation examples REST style peer to peer style the web is the only relevant implementation of The Web Napster REST

  6. REST ingredients Resources roughly the constraints s thesis Representations of resources from Roy’ Uniform interface Hypertext and links Stateless communication

  7. Resources give all relevant things an ID http:/ / example.com/cars/models/320 don’ t have to be pretty Representations http:/ / example.com/cars/models/320.html http:/ / example.com/cars/models/320.json http:/ / example.com/cars/models/320.xml http:/ / example.com/cars/models/320.jsp

  8. Uniform interface allows intermediaries to understand (caches, proxies) retrieve information, possibly GET cached PUT Update or create with known ID POST Create or append sub-resource DELETE Logically remove

  9. Uniform interface allows intermediaries to understand (caches, proxies) check out the URL http:/ /www.youtube.com/watch? retrieve information, possibly GET v=oHg5SJYRHA0 cached PUT Update or create with known ID with method “WATCH” POST Create or append sub-resource DELETE Logically remove

  10. Hypertext Link the “things” / the resources How? <link rel="some-concept" ref="/some-uri"> t n e i h l a c r n d c i o d d e e d d i o n c c d l r i e a n h t T O N Why?

  11. A special browser for each web site? e.g. a Wikipedia browser that hardcodes http:/ / en.wikipedia.org/wiki/{concept} wikipedia amazon jugs.ch blogs nzz admin.ch search.ch infoq facebook gmail browser browser browser browser browser browser browser browser browser browser

  12. A REST API must not define fixed resource names or hierarchies (an obvious coupling of client and server). Servers must have the freedom to control their own namespace.

  13. If you need this it’s (probably) not REST

  14. Stateless communication state is kept on the client, no server-side application state scalability requests are self-contained intermediaries client server GET / customer/1234/orders <link rel=” ...” ref=” /orders/123456789”></link> update software reboot POST /orders/123456789

  15. RPC-style modelling vs. REST-style modelling /orders GET - list all orders m a n y o p e r PUT - unused a t i o n s POST - add new order DELETE - unused f e w i n s t a n c e s few operations /orders/{id} GET - get order details many instances PUT - update order OrderManagementService POST - add item DELETE - cancel order + getOrders() + submitOrder() /orders/{id}/submit + getOrderDetails() GET - unused + getOrdersForCustomers() PUT - unused <<interface>> + updateOrder() POST - submit order Resource + addOrderItem() DELETE - unused GET + cancelOrder() PUT /customers POST GET - list all customers DELETE CustomerManagementService PUT - unused POST - add new customer + getCustomers() DELETE - unused + addCustomer() + getCustomerDetails() /customers/{id} + updateCustomer() GET - get customer details + deleteCustomer() PUT - update customer POST - unused DELETE - delete customer /customers/{id}/orders GET - get all orders for customer PUT - unused POST - add order DELETE - cancel all customer orders

  16. Why again? proven scalability proven to evolve proven cross-platform The Web Relevant for me?

  17. REST for the Enterprise?

  18. The Internet vs. The Enterprise One is a gigantic, uncontrollable anarchy of heterogeneous systems with varying quality that evolve independently and constantly get connected in new and unexpected ways. The other is a worldwide, publicly accessible series of interconnected computer networks that transmit data by packet switching using the standard Internet Protocol (IP). Stefan Tilkov - Pragmatic Introduction to REST

  19. Jugs - Agenda REST in 15 minutes Meet Apache Sling demo & code

  20. What’s Sling? “ Apache Sling is a RESTful web framework that uses a Java Content Repository to store and manage content.” just graduated in Apache incubator

  21. What’s JCR ? “The API should be a standard, implementation independent, way to access content bi-directionally on a granular level within a ? content repository .”

  22. Best of both worlds. sys tem file a base t d a h i e r - a r c h i e i n s t e e g r u r t c i t u r y t s read streams x t write a c c e s s locking query c o n t r o l multi- value versioning obser - un-structured full-text” sort “ vation order ory sit con p o e r tent

  23. “Data First!” schemaless” aka “ JCR supports “ structure first ” as well. (but that’ s missing the point)

  24. Known compliant Repositories * using third party connector * * Exo Microsoft Apache Jackrabbit Oracle XML DB OpenText Livelink ECMS Platform Sharepoint * Day CRX IBM FileNet P8 Xythos Repository Alfresco ECM Vignette V7 * * How many RDBMS vendors do you need? +hundreds of TCKs Interwoven registered IBM CM EMC Documentum Repository

  25. Some known JCR Applications Fast BEA Portal Oracle Portal Enterprise Search Sun JBoss Portal Interface 21 OpenPortal Spring Framework Day Communique DAM magnolia WCMS Day Communique Apache Sling Collab Mindquarry Alfresco ECMS Collaboration Apache Tapestry QSLabs Apache Day Communiqué Compliance Cocoon WCMS IBM FileNet medic-2-medic WebSiteManager Artifactory Apache James mapofmedicine Maven Proxy Exo TYPO3 ECMS Platform GX WebManager v5.0 WCM InfoQ Hippo Liferay Nuxeo ECM Online Community CMS Enterprise Portal Jahia Sakai Framework E-learning Percussion QuickWCM Rhythmix Sourcemix WCMS Lutece Sourcemix Portal

  26. Some known JCR Applications Fast BEA Portal Oracle Portal Enterprise Search Sun JBoss Portal Interface 21 OpenPortal Spring Framework Day Communique DAM magnolia WCMS Day Communique Apache Sling Collab Mindquarry Alfresco ECMS Collaboration Apache Tapestry QSLabs Apache Day Communiqué Compliance Cocoon WCMS IBM FileNet medic-2-medic WebSiteManager Artifactory Apache James mapofmedicine Maven Proxy Exo TYPO3 ECMS Platform GX WebManager v5.0 WCM InfoQ Hippo Liferay Nuxeo ECM Online Community CMS Enterprise Portal Jahia Sakai Framework E-learning Percussion QuickWCM Rhythmix Sourcemix WCMS Lutece Sourcemix Portal

  27. JCR - Weatherforecast -5° -8° 2011 -12° 2010 2009

  28. JCR 2.0 http://www.day.com/jsr283

  29. A node is a resource GET /cars/audi/s4.txt User -agent Repository

  30. A node is a resource POST /cars/audi/s48 write User -agent Y our content is your web Repository server

  31. Web apps and Sling scripting /cars/audi/s4.details.html User -agent Repository

  32. Web apps and Sling scripting /cars/audi/s4.details.html User -agent Repository 1 file needed Convention over configuration

  33. Web apps and Sling scripting /cars/audi/s4.details.html User -agent Repository .esp .erb .scala

  34. Web apps and Sling scripting URLs do matter! /cars/audi/s4.details.html vs. /product.jsp?id=/audi/s4 Passing in “ this” Addressing the “ (the resource) script”

  35. Bonus

  36. Sling is OSGi-based ) ” d e l b a n e “ t s u j t o n ( Apache Felix OSGi container extensible my my my scripts bundles bundles Sling Sling Sling JCR

  37. Sling is OSGi-based ) ” d e l b a n e “ t s u j t o n ( Apache Felix OSGi container extensible my my my scripts bundles bundles modular Sling Sling Sling JCR hot deploy

  38. SEE

  39. DEMO

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend