Skip to main content

Introduction

  • Chapter
  • First Online:
Serialization and Persistent Objects

Abstract

We start with the definition of persistent objects and, as an example, we show how they relate to data structures, class libraries, allocation and UML class diagrams. Everything revolves around pointers or references, depending on which language you use. After this, we discuss the flaws of serializations built into different languages.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Transparently implemented as a member of class Book: Publisher *publisher.

  2. 2.

    On the 4th line of main(), note the different order of the parameters compared to the usual containers where you would have lib->books.add(bk); Reflecting the importance of the data structures which we place at the same visibility level as classes, our notation starts with the ID of the data structure.

  3. 3.

    We had an opportunity to review a recognized business management system with a million lines of C++ code, which was impossible to maintain. Serialization and deserialization functions represented one-third of the entire code.

  4. 4.

    Depending on which language you use.

  5. 5.

    Accepting STL as a standard without making a provision for persistency was a mistake. In 1993, persistency was a known concept, and early versions of Code Farms DOL library and of what is now called ObjectStore © PSE Pro for C++ were commercially available.

  6. 6.

    When working on Chap. 7 we explored the possibility of making the Objective-C Foundation classes persistent. For a person not familiar with the library it would be an extremely difficult task. It is a big and complex library, pointers are often disguised through typedef, and all allocation calls should be located, analyzed and possibly replaced.

  7. 7.

    This applies even to Java which claims to be “pointerless” but really isn’t, because its references are only more intelligent pointers. In Java, this means no references are explicitly used as members of application classes.

  8. 8.

    This may be considered a heresy, but this book takes a non-orthodox view on many subjects.

  9. 9.

    As with most listings in the book, the full source is available under directory bk, in this case as bk/chap1/list1_2.cpp.

  10. 10.

    http://www.codefarms.com/dolclasses

  11. 11.

    In other words, only pointers from the heap must be converted, not pointers from the stack.

  12. 12.

    Since the mid-1980s, Mikael Palczewski convinced Jiri about this (he had a hard time), Jiri is using rings and not NULL-ending lists.

  13. 13.

    You will have to wait until Chap. 2 to see how this really works.

  14. 14.

    This is only a hypothetical implementation. The listing is on the website, but it would not run without converting it to a specific collection library.

    Because the collection library does not have bi-directional associations, adding Course crs to Lecturer lect requires two steps:

    courses.add(lect,crs);

    crs->taughtBy=lect;

    Leaving them like that would be error prone; they should be encapsulated under a single function which we may call addCourseToLecturer(), but where would you place it and other similar functions? It would spread the association to even more places.

  15. 15.

    Boost library is an extension of the STL library, and will soon become the C++ standard. It supports graphs and has tuplets which are the heart of many-to-many associations, but the interface is less elegant and less user friendly than the intrusive implementation; there is also a performance hit both in speed and required space. This will be discussed in Chap. 3.

  16. 16.

    In those days computers were much slower than today.

  17. 17.

    With the permission of the authors, most of this chapter is based on examples from Cornell & Horstmann (2011), pp 39–51.

  18. 18.

    For full running example, see bk\chap1\javaSerialization\readme.txt.

  19. 19.

    Look at custom coded linked list of Books in bk/chap1/javaSerialization/stackOverflow1, where build.bat compiles it, and run.bat runs it. In order to run it for 2000 books, type: run 2000.

  20. 20.

    If you want to experiment with this example, go to bk/chap1/javaSerialization/stackOverflow2, where build.bat compiles it, and run.bat runs it. In order to run it for 2000 books, type: run 2000.

  21. 21.

    We had to re-type the original in order to make it readable here.

  22. 22.

    For the description of these codes, look at pp 39–59, Vol. II of Cornell & Horstmann (2011).

  23. 23.

    http://jaxb.java.net

  24. 24.

    Full code which also generates Figs. 1.10 and 1.11 is in bk/chap1/CSharpSerialization/SerializeToBin/Program.cs bk/chap1/CSharpSerialization/SerializeToXml/Program.cs.

  25. 25.

    For more information on .NET Remoting, see MSDN.

  26. 26.

    For experimental results, see the benchmark in Chap. 8.

  27. 27.

    http:// msdn.microsoft.com / en - us / library / cc 236866(v = prot.10).aspx

  28. 28.

    See (Core Data 2013).

  29. 29.

    All this for two simple objects is ridiculous. The file has about five times as many lines as XML files produced by C# serializer.

  30. 30.

    http://www.boost.org/doc/libs/1_52_0/libs/serialization/doc/index.html (BOOST library serialization 2013).

  31. 31.

    Code in bk/chap1/boostSerialize also has options for other styles of archiving.

References

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jiri Soukup .

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Soukup, J., Lokanath, R., Soukup, M. (2014). Introduction. In: Serialization and Persistent Objects. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-39323-5_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-39323-5_1

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-39322-8

  • Online ISBN: 978-3-642-39323-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics