Data Intechange at Work: XML and JSON

3,118 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,118
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Data Intechange at Work: XML and JSON

  1. 1. Data Interchange Formats at Work XML and JSON Tom Marrs Architect
  2. 2. Your Profile Is XML dead? XML and JSON – together? What? Why? Not? How?
  3. 3. What’s The Point? XML for Integration JSON for speed
  4. 4. Data Interchange Context
  5. 5. Today’s Agenda Older Formats XML JSON Wrap Up
  6. 6. We’re Not Covering SOA REST vs SOAP Web 2.0 XML Schema Design
  7. 7. Older Formats Delimited Positional
  8. 8. Delimited Data John|Smith|2008-12-06|To improve my public speaking skills. To get promoted. To take over the world (or a small portion thereof).|555 Main St.|Bailey|CO|80909|USA|john.smith @acme.com|303-555-1212|720-555- 1212|970-555-1212|677476|Simply Speaking|Aurora|26
  9. 9. Positional Data John Smith 2008-12-06… First Name: 0 - 20 Last Name: 21 – 50 Date Joined: 51 - 60 …
  10. 10. Older Formats Are Dead – Right? NO! EDI/X12 ANSI
  11. 11. Older Formats No meta-data Proprietary parsing/formatting Programmatic validation
  12. 12. XML Overview W3C Standard - 1996 Publishing  Messaging XML-based Languages
  13. 13. XML •Valid - XSDSemantics •Well-FormedStructure
  14. 14. ToastML – Iteration 1
  15. 15. ToastML – Iteration 2
  16. 16. ToastML – Iteration 2 - Schema
  17. 17. ToastML – Iteration 2 - Schema
  18. 18. ToastML – Iteration 3
  19. 19. ToastML – Iteration 3 - Schema
  20. 20. XML Elements vs. Attributes It’s an Element When … First Class Data – <Member> Hierarchical / Whole-To-Part Order Matters Multiple Values Long Data / Whitespace - <Reason> It’s an Attribute When … Dependent Data / Meta-Data No further structuring firstName lastName
  21. 21. ToastML – Iteration 4
  22. 22. ToastML – Iteration 4 - Schema
  23. 23. XML Patterns http://www.xmlpatterns.com Domain Element Extensible Content Model Russian Doll / Venetian Blind / Salami Slice Canonical Schema – SOA Design Patterns
  24. 24. XML Surround Sound XPath XSLT
  25. 25. My Journey in Java XML Binding SAX DOM Castor JAXB XML Beans
  26. 26. JAXB Annotations
  27. 27. JAXB Marshalling/Unmarshalling
  28. 28. My JAXBUtil
  29. 29. XML Beans Marshalling/Unmarshalling
  30. 30. Apache CXF
  31. 31. XML in Ruby - REXML
  32. 32. XML in Ruby on Rails
  33. 33. XML in JavaScript (jQuery)
  34. 34. !XML Web 2.0 / AJAX Slick User Experience
  35. 35. XML Wrap Up Semantics / Meaning Interoperability
  36. 36. JSON Overview JavaScript www.json.org 2006 - IETF - RFC 4627 The “x” in AJAX Lightweight / simple structures
  37. 37. JSON •Valid – Not YetSemantics •Well-FormedStructure
  38. 38. JSON Structures Object Array List of ValuesName / Value Pairs
  39. 39. Toast.JSON – Iteration 1
  40. 40. Recall - ToastML – Iteration 1
  41. 41. Toast.JSON – Iteration 4
  42. 42. Recall - ToastML – Iteration 4
  43. 43. Toast.JSON – Iteration 4 – Multiple Members
  44. 44. JSON Schema? http://json-schema.org March 2010 – IETF – RFC ? Not Quite Ready
  45. 45. JSON in Java - SOJO
  46. 46. JSON in Java - GSON
  47. 47. JSON in Java – Apache CXF
  48. 48. JSON in Ruby on Rails
  49. 49. JSON in JavaScript (jQuery)
  50. 50. Cross-Domain JSON - The Problem Same-origin policy AJAX XmlHttpRequest Browser Security Constraint
  51. 51. JSONP (JSON with Padding) and jQuery – The Solution
  52. 52. !JSON Enterprise-class Integration Waiting for JSON Schema
  53. 53. JSON Wrap Up Concise Fast
  54. 54. What’s The Point? XML for Integration JSON for speed
  55. 55. Questions? Tom Marrs Architect thomasamarrs@comcast.net www.slideshare.net/tmarrs

×