• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Agile RESTful Web Development
 

Agile RESTful Web Development

on

  • 5,359 views

 

Statistics

Views

Total Views
5,359
Views on SlideShare
5,313
Embed Views
46

Actions

Likes
10
Downloads
0
Comments
0

9 Embeds 46

http://michaelmarth.blogspot.com 28
http://www.slideshare.net 9
http://michaelmarth.blogspot.ch 3
http://www.blogger.com 1
http://feeds.feedburner.com 1
http://www.techgig.com 1
http://michaelmarth.blogspot.ro 1
http://www.linkedin.com 1
https://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Agile RESTful Web Development Agile RESTful Web Development Presentation Transcript

    • Agile RESTful Web Development Michael Marth Technology Evangelist Michael Dürig Senior Developer michael.marth@day.com michael.duerig@day.com
    • Jugs - Agenda REST in 15 minutes Meet Apache Sling demo & code
    • What is REST? A API B Technology C SOAP’s arch enemy D Architectural Style
    • REST: An Architectural Style One of many Architectural Styles Architectural principles of the web, defined a posteriori Defined through architectural g constraints Roy T. Fieldin Chief Scien at Da tist Soft y ware
    • Styles and implementation examples REST style peer to peer style the we b imp re le i s t h e le m v a n t o n l y ent Napster Tat io W R ES he n eb T of
    • REST ingredients ly the Resources rough aints constr s thesis from Roy’ Representations of resources Uniform interface Hypertext and links Stateless communication
    • Resources give all relevant things an ID don’t http://example.com/cars/models/320 have prett to be y 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
    • in a llows s to diarie hes, terme d (cac Uniform interface rstan es) unde roxi p retrieve information, possibly GET cached PUT Update or create with known ID POST Create or append sub-resource DELETE Logically remove
    • in a llows s to diarie hes, terme d (cac Uniform interface rstan es) unde roxi p check out the URL retrieve/www.youtube.com/watch? http:/ 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
    • Hypertext Link the “things” / the resources How? <link rel="some-concept" ref="/some-uri"> h a rdc o de d i n c l ie n t NOT h a rdc o de d i n c l ie n t Why?
    • 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 gma browser browser browser browser browser browser browser browser browser brows
    • 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.
    • If you need this it’s (probably) not REST
    • Stateless communication state is kept on the client, no ser ver-side application state s c a la bil it y requests are self-contained r ie s i n te r me di a client server GET /customer/1234/orders <link rel=”...” ref=” /orders/123456789”></link> update soft ware reboot POST /orders/123456789
    • RPC-style modelling vs. REST-style modelling /orders GET - list all orders m a ny ope rat io n s PUT - unused POST - add new order DELETE - unused fe w i ns t ance s at io n s /orders/{id} ope r GET - get order details fe w PUT - update order ance s OrderManagementService POST - add item ins t DELETE - cancel order m a ny + getOrders() + submitOrder() /orders/{id}/submit + getOrderDetails() GET - unused + getOrdersForCustomers() <<interface>> PUT - unused + updateOrder() Resource POST - submit order + addOrderItem() GET DELETE - unused + cancelOrder() PUT POST /customers DELETE GET - list all customers 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
    • Why again? proven scalability proven to evolve proven cross-platform The Web Relevant for me?
    • REST for the Enterprise?
    • 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
    • Jugs - Agenda REST in 15 minutes Meet Apache Sling demo & code
    • What’s Sling? “Apache Sling is a RESTful web framework that uses a Java Content Repository to store and manage content.”just g radu ate d in Apache incubator
    • 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.” ?
    • Best of both worlds. data base f il es ys te m hier- archi integ rity re es structu read streams tx write access query locking control multi- value ning obser- versio un-structured “full-text” sort vation order content repo sit or y
    • “Data First!” “s ch e m a le s s” ak a JCR s “stru upports cturef irst” a (but t ha well. s t’s m issing the p oint)
    • Known compliant Repositories * using third party connector * * Exo Microsoft Apache Jackrabbit Oracle XML DB ECMS Platform Sharepoint OpenText Livelink * Day CRX IBM FileNet P8 Xythos Repository Alfresco ECM Vignette V7 * * any ors ow mvend ? H S ed Interwoven +hund DBMou ne R do y r s Repository IBM CM EMC Documentum regiede of TCKs st
    • Some known JCR Applications Fast BEA Portal Sun Oracle Portal Enterprise Search JBoss Portal Interface 21 OpenPortal Day Communique Spring Framework magnolia WCMS DAM Apache Sling Day Communique Alfresco ECMS Mindquarry Collab Collaboration Apache Tapestry QSLabs Apache Compliance Day Communiqué Cocoon WCMS IBM FileNet Artifactory medic-2-medic WebSiteManager Apache James Maven Proxy mapofmedicine Exo ECMS Platform TYPO3 GX WebManager v5.0 WCM InfoQ Hippo Liferay Nuxeo ECM Online Community CMS Enterprise Portal Jahia Sakai Percussion Framework E-learning Rhythmix QuickWCM Sourcemix WCMS Lutece Sourcemix
    • Some known JCR Applications Fast BEA Portal Sun Oracle Portal Enterprise Search JBoss Portal Interface 21 OpenPortal Day Communique Spring Framework magnolia WCMS DAM Apache Sling Day Communique Alfresco ECMS Mindquarry Collab Collaboration Apache Tapestry QSLabs Apache Compliance Day Communiqué Cocoon WCMS IBM FileNet Artifactory medic-2-medic WebSiteManager Apache James Maven Proxy mapofmedicine Exo ECMS Platform TYPO3 GX WebManager v5.0 WCM InfoQ Hippo Liferay Nuxeo ECM Online Community CMS Enterprise Portal Jahia Sakai Percussion Framework E-learning Rhythmix QuickWCM Sourcemix WCMS Lutece Sourcemix
    • JCR - Weatherforecast 2009 -5° 2010 -8° 2011 -12°
    • JCR 2.0 http://www.day.com/jsr283
    • A node is a resource GET /cars/audi/s4.txt User-agent Repository
    • A node is a resource POST /cars/audi/s48 write User-agent Your content Repository is your web server
    • Web apps and Sling scripting /cars/audi/s4.details.html User-agent Repository
    • Web apps and Sling scripting /cars/audi/s4.details.html User-agent Repository d 1 file neede Convention ove configuration r
    • Web apps and Sling scripting /cars/audi/s4.details.html User-agent Repository .esp .erb .scala
    • Web apps and Sling scripting URLsdo matter! /cars/audi/s4.details.html vs. /product.jsp?id=/audi/s4 Passing in “this” Addressing the (the resource) “ cript” s
    • Bonus
    • Sling is OSGi-based e (not just “ nabled”) Apache Felix OSGi container extensible my my my bundles bundles scripts Sling Sling Sling JCR
    • Sling is OSGi-based e (not just “ nabled”) Apache Felix OSGi container extensible my my my bundles bundles scripts modular Sling Sling Sling JCR hot deploy
    • S EE
    • DEMO