Revealing the X/O Impedance Mismatch

(Changing Lead into Gold)
  • Ralf Lämmel
  • Erik Meijer
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4719)


We take the term X/O impedance mismatch to describe the difficulty of the OO paradigm to accommodate XML processing by means of recasting it to typed OO programming. In particular, given XML types (say, XML schemas), it is notoriously difficult to map them automatically to object types (say, object models) that (i) reasonably compare to native object types typically devised by OO developers; (ii) fully preserve the intent of the original XML types; (iii) fully support round-tripping of arbitrary, valid XML data; and (iv) provide a general and convenient programming model for XML data hosted by objects.

We reveal the X/O impedance mismatch in particular detail. That is, we survey the relevant differences between XML and objects in terms of their data models and their type systems. In this process, we systematically record and assess X-to-O mapping options. Our illustrations employ XSD (1.0) as the XML-schema language of choice and C# (1.0–3.0) as the bound of OO language expressiveness.


Object Model Mapping Option Content Model Object Graph Impedance Mismatch 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Amer-Yahia, S., Du, F., Freire, J.: A comprehensive solution to the XML-to-relational mapping problem. In: Laender, A.H.F., Lee, D., Ronthaler, M. (eds.) Proceedings of 6th ACM CIKM International Workshop on Web Information and Data Management (WIDM 2004), pp. 31–38. ACM Press, New York (2004)Google Scholar
  2. 2.
    Atanassow, F., Clarke, D., Jeuring, J.: UUXML: A Type-Preserving XML Schema-Haskell Data Binding. In: Jayaraman, B. (ed.) PADL 2004. LNCS, vol. 3057, pp. 71–85. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  3. 3.
    Baars, A.I., Löh, A., Swierstra, S.D.: Parsing permutation phrases. Journal of Functional Programming 14(6), 635–646 (2004)CrossRefzbMATHGoogle Scholar
  4. 4.
    Bancilhon, F., Spyratos, N.: Update semantics of relational views. ACM Transactions on Database Systems 6(4), 557–575 (1981)CrossRefzbMATHGoogle Scholar
  5. 5.
  6. 6.
    Bierman, G., Meijer, E., Schulte, W.: The Essence of Data Access in Cω. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 287–311. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  7. 7.
    Bohannon, P., Freire, J., Haritsa, J.R., Ramanath, M., Roy, P., Siméon, J.: Bridging the XML Relational Divide with LegoDB. In: Dayal, U., Ramamritham, K., Vijayaraman, T.M. (eds.) 19th International Conference on Data Engineering (ICDE 2003), Proceedings, pp. 759–760. IEEE Computer Society Press, Los Alamitos (2003)Google Scholar
  8. 8.
    Bohannon, P., Freire, J., Roy, P., Simeon, J.: From XML Schema to Relations: A Cost-Based Approach to XML Storage. In: Proceedings of 18th International Conference on Data Engineering (ICDE 2002), p. 64. IEEE Computer Society Press, Los Alamitos (2002)CrossRefGoogle Scholar
  9. 9.
    Bordawekar, R., Burke, M.G., Peshansky, I., Raghavachari, M.: XJ: Integration of XML Processing into Java. In: Castagna, Raghavachari Google Scholar
  10. 10.
    Bourret, R.: Mapping W3C Schemas to Object Schemas (March 2001),
  11. 11.
    Bourret, R.: XML Data Binding Resources (2007),
  12. 12.
    Burton, F., Cameron, R.: Pattern Matching with Abstract Data Types. Journal of Functional Programming 3(2), 171–190 (1993)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Cameron, R.D.: Extending context-free grammars with permutation phrases. ACM Letters on Programming Language Systems 2(1-4), 85–94 (1993)CrossRefGoogle Scholar
  14. 14.
    Castagna, G., Raghavachari, M. (eds.) PLAN-X 2006 Informal Proceedings, Charleston, South Carolina, January 14, 2006. BRICS, Department of Computer Science, University of Aarhus (2006)Google Scholar
  15. 15.
    Crocker, R., Stele Jr., G.L.: Proceedings of the 2003 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, OOPSLA 2003. ACM Press, New York (2003)Google Scholar
  16. 16.
    Dijkstra, E.W.: EWD 498: How do we tell truths that might hurt? In: Selected Writings on Computing: A Personal Perspective, pp. 129–131. Springer, Heidelberg (1992)Google Scholar
  17. 17.
    Downey, P.: W3C XML Schema Patterns for Databinding. In: Conference Proceedings XML 2006 (2006)Google Scholar
  18. 18.
    Fähndrich, M., Leino, K.R.M.: Declaring and checking non-null types in an object-oriented language. In: Crocker and Jr. [15], pp. 302–312Google Scholar
  19. 19.
    Fowler, M.: When to Make a Type. IEEE Software, 12–13 (2003) Google Scholar
  20. 20.
    Gapeyev, V., Garillot, F., Pierce, B.C.: Statically Typed Document Transformation: An Xtatic Experience. In: Castagna and Raghavachari [14], pp. 2–13Google Scholar
  21. 21.
    Gapeyev, V., Levin, M.Y., Pierce, B.C., Schmitt, A.: XML Goes Native: Run-Time Representations for Xtatic. In: Bodik, R. (ed.) CC 2005. LNCS, vol. 3443, pp. 43–58. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  22. 22.
    Gapeyev, V., Pierce, B.C.: Regular Object Types. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 151–175. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  23. 23.
    Garcia, R., Jarvi, J., Lumsdaine, A., Siek, J.G., Willcock, J.: A comparative study of language support for generic programming. In: Crocker and Jr. [15], pp. 115–134Google Scholar
  24. 24.
    Gottlob, G., Paolini, P., Zicari, R.: Properties and update semantics of consistent views. ACM Transactions on Database Systems 13(4), 486–524 (1988)MathSciNetCrossRefzbMATHGoogle Scholar
  25. 25.
    Harren, M., Raghavachari, M., Shmueli, O., Burke, M.G., Bordawekar, R., Pechtchanski, I., Sarkar, V.: XJ: facilitating XML processing in Java. In: Ellis, A., Hagino, T. (eds.) WWW 2005, 14th International Conference on World Wide Web, Proceedings, pp. 278–287. ACM Press, New York (2005)Google Scholar
  26. 26.
    Harren, M., Raghavachari, M., Shmueli, O., Burke, M.G., Sarkar, V., Bordawekar, R.: XJ: integration of XML processing into java. In: Feldman, S.I., Uretsky, M., Najork, M., Wills, C.E. (eds.) WWW 2004, 13th International Conference on World Wide Web, Proceedings, pp. 340–341. ACM Press, New York (2004)Google Scholar
  27. 27.
    Hosoya, H., Pierce, B.C.: XDuce: A statically typed XML processing language. ACM Transactions on Internet Technology (TOIT) 3(2), 117–148 (2003)CrossRefGoogle Scholar
  28. 28.
    IBM Research. XJ (2005),
  29. 29.
    json Introducing JSON, 2006. Web site,
  30. 30.
    Kirkegaard, C., Møller, A.: Type Checking with XML Schema in XACT. In: Castagna and Raghavachari [14], pp. 14–23Google Scholar
  31. 31.
    Kostoulas, M.G., Matsa, M., Mendelsohn, N., Perkins, E., Heifets, A., Mercaldi, M.: XML screamer: an integrated approach to high performance XML parsing, validation and deserialization. In: WWW 2006, 15th International Conference on World Wide Web, Proceedings, pp. 93–102. ACM Press, New York (2006)Google Scholar
  32. 32.
    Lämmel, R., Kitsis, S., Remy, D.: Analysis of XML schema usage. In: Conference Proceedings XML 2005 (2005)Google Scholar
  33. 33.
    Lämmel, R., Remy, D.: Functional OO Programming with Triangular Circles. In: Conference Proceedings XML 2006 (2006)Google Scholar
  34. 34.
    Lämmel, R., Visser, E., Visser, J.: Strategic Programming Meets Adaptive Programming. In: AOSD 2003, 2nd International Conference on Aspect-Oriented Software Development, Proceedings, pp. 168–177. ACM Press, New York (2003)Google Scholar
  35. 35.
    Lieberherr, K.: Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns. PWS Publishing Company, Boston (1996)Google Scholar
  36. 36.
    Liskov, B.: Keynote address - data abstraction and hierarchy. In: OOPSLA 1987, Addendum to the Proceedings on Object-Oriented Programming Systems, Languages and Applications, pp. 17–34. ACM Press, New York (1987)Google Scholar
  37. 37.
    Loughran, S., Smith, E.: Rethinking the Java SOAP Stack. Technical Report HPL-2005-83, 20050517, External, HP Labs (2005)Google Scholar
  38. 38.
    McLaughlin, B.: Java and XML data binding. Nutshell handbook. O’Reilly & Associates, Inc., (2002) Google Scholar
  39. 39.
    Meijer, E., Beckman, B.: XLINQ: XML Programming Refactored (The Return Of The Monoids). In: Conference Proceedings XML’05, See [46] for the LINQ portal. XLinq is now called LINQ to XML (November 2005)Google Scholar
  40. 40.
    Meijer, E., Beckman, B.: XML Support in Visual Basic 9. In: Castagna and Raghavachari [14], p. 86Google Scholar
  41. 41.
    Meijer, E., Schulte, W., Bierman, G.: Programming with Circles, Triangles and Rectangles. In: Conference Proceedings XML 2003 (2003)Google Scholar
  42. 42.
    Meijer, E., Schulte, W., Bierman, G.: Unifying Tables, Objects and Documents. In: Proceedings of Declarative Programming in the Context of OO Languages (DP-COOL) (2003)Google Scholar
  43. 43.
    Meyer, B.: Object-Oriented Software Construction, 2nd edn. The Object-Oriented Series. Prentice-Hall, Englewood Cliffs (1997)zbMATHGoogle Scholar
  44. 44.
    Microsoft Corp. LINQ to XML Overview, See [46], for the LINQ portal. LINQ to XML was formerly called XLinq (2005–2007)Google Scholar
  45. 45.
    Microsoft Corp. C# Version 3.0 Specification, See [46] for the LINQ portal (2006-2007)Google Scholar
  46. 46.
    Microsoft Corp. The LINQ Project, (2006-2007),
  47. 47.
    Microsoft Corp. Windows Communication Foundation (2006-2007),
  48. 48.
    Novak Jr, G.S.: Creation of views for reuse of software with different data representations. IEEE Transactions on Software Engineering 21(12), 993–1005 (1995)CrossRefGoogle Scholar
  49. 49.
    OASIS. RELAX NG Specification (December 2001),
  50. 50.
    Onizuka, M., Chan, F.Y., Michigami, R., Honishi, T.: Incremental maintenance for materialized XPath/XSLT views. In: WWW 2005: Proceedings of the 14th International Conference on World Wide Web, pp. 671–681. ACM Press, New York (2005)Google Scholar
  51. 51.
    Perkins, E., Matsa, M., Kostoulas, M.G., Heifets, A., Mendelsohn, N.: Generation of efficient parsers through direct compilation of XML Schema grammars. IBM Systems Journal 45(2), 225–244 (2006)CrossRefGoogle Scholar
  52. 52.
    Pradhan, M.: Default mapping for annotated XML schema. IBM developerWorks (April 2006),
  53. 53.
    Shields, M., Meijer, E.: Type-indexed rows. In: POPL 2001: 28th ACM SIGPLAN-SIGACT Symposium on Principles Of Programming Languages, Proceedings, pp. 261–275. ACM Press, New York (2001)Google Scholar
  54. 54.
    Sun Microsystems. The Java architecture for XML binding (JAXB) (2006),
  55. 55.
    The Apache XML Project. XMLBeans (2006),
  56. 56.
    Thiemann, P.: Modeling HTML in haskell. In: Pontelli, E., Costa, V.S (eds.) PADL 2000. LNCS, vol. 1753, pp. 263–277. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  57. 57.
    Thiemann, P.: A typed representation for HTML and XML documents in Haskell. Journal of Functional Programming 12(4&5), 435–468 (2002)MathSciNetzbMATHGoogle Scholar
  58. 58.
    Thomas, D.: The Impedance Imperative: Tuples + Objects + Infosets = Too Much Stuff! Journal of Object Technology 2(5), 7–12 (2003)CrossRefGoogle Scholar
  59. 59.
    van der Vlist, E.: RELAX NG. O’Reilly (December 2004) Google Scholar
  60. 60.
    van der Vlist, E.: RELAX NG and W3C XML Schema compared (continued) (July 2006),
  61. 61.
    van Engelen, R., Govindaraju, M., Zhang, W.: Exploring Remote Object Coherence in XML Web Services. In: ICWS 2006, International Conference on WebServices, Proceedings, pp. 249–256. IEEE Computer Society, Los Alamitos (2006)Google Scholar
  62. 62.
    Vinoski, S.: RPC Under Fire. IEEE Internet Computing 9(5), 93–95 (2005)CrossRefGoogle Scholar
  63. 63.
    Visser, J.: Visitor combination and traversal control. ACM SIGPLAN Notices 36(11), 270–282 (2001) (OPSLA 2001 Conference Proceedings)CrossRefGoogle Scholar
  64. 64.
    W3C. Document Object Model (DOM) (1997-2003),
  65. 65.
    W3C. XML Path Language (XPath), Version 1.0, W3C Recommendation (November 16, 1999),
  66. 66.
    W3C. XML Information Set, 2nd edn., (1999–2004),
  67. 67.
    W3C. XML Schema, (2000–2003),
  68. 68.
    W3C. Extensible Markup Language (XML) 1.0, 3rd edn., W3C Recommendation, (February 2004),
  69. 69.
    W3C. XQuery 1.0 and XPath 2.0 Formal Semantics, W3C Candidate Recommendation, (June 8, 2006),
  70. 70.
    Wadler, P.: Views: a way for pattern matching to cohabit with data abstraction. In: POPL 1987, 14th ACM SIGACT-SIGPLAN Symposium on Principles Of Programming Languages, Proceedings, pp. 307–313. ACM Press, New York (1987)Google Scholar
  71. 71.
    Wallace, M., Runciman, C.: Haskell and XML: Generic combinators or type-based translation? ACM SIGPLAN Notices 34(9), 148–159 (1999) (Conference Proceedings of International Conference on Functional Programming (ICFP’99))CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Ralf Lämmel
    • 1
  • Erik Meijer
    • 1
  1. 1.Microsoft Corp., Data Programmability Team, RedmondUSA

Personalised recommendations