10.1145/3359619.3359748acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedings
ARTICLE

Standard object out: streaming objects with polymorphic write streams

ABSTRACT

We propose standard object out, an object-oriented analog to the output part of the Unix standard input output library.

Polymorphic Write Streams (PWS) act as architectural adapters between the object-oriented architectural style and the pipes and filters architectural style in the same way that stdio acts as an architectural adapter between the call/return architectural style and the pipes and filters architectural style.

Current object-oriented interfaces to the Unix I/O system mimic their procedural counterparts so closely that they manage to be neither polymorphic nor streaming, at least not for objects. Specifically the object is first converted to a fixed byte-representation by sending it a specific message and the result is then output on the underlying byte stream.

With this approach, these APIs do not allow for streaming behaviour: the entire result has to be constructed in-memory before it can be output. In addition, output of nested structures can require large multiples of time and space compared to the final output size, and fails completely if there are cycles in the object graph. It also does not allow for polymorphic behaviour.

To solve these problems, we propose Polymorphic Write-Streams (PWS). PWSs represent a hierarchy of classes that decouple encoding from specific streaming destinations. Using triple dispatch they provide streaming behaviour and allow each stream to react specifically to each kind of object and vice versa: sharing of common functionality is enabled by chaining messages along the streams’ inheritance chain.

References

  1. 1994. fwrite(3) BSD Library Functions Manual.Google ScholarGoogle Scholar
  2. 2001. PDF Reference: Adobe Portable Document Format Version 1.4 with Cdrom (3rd ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 2009. printf(3) BSD Library Functions Manual.Google ScholarGoogle Scholar
  4. 2012. NeXT Property Lists. https://en.wikipedia.org/wiki/Property_list.Google ScholarGoogle Scholar
  5. 2013. Standard for Information Technology--Portable Operating System Interface (POSIX(R)) Base Specifications, Issue 7. IEEE Std 1003.1, 2013 Edition (incorporates IEEE Std 1003.1-2008, and IEEE Std 1003.1- 2008/Cor 1-2013) (April 2013), 1-3906.Google ScholarGoogle Scholar
  6. Apple Inc. 2009. Cocoa Reference. http://developer.apple.com/docs/Cocoa/.Google ScholarGoogle Scholar
  7. Hans-J. Boehm, Russ Atkinson, and Michael Plass. 1995. Ropes: An Alternative to Strings. Softw. Pract. Exper. 25, 12 (Dec. 1995), 1315-1330. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. R. Bourne. 1978. UNIX Time-Sharing System: The UNIX Shell. Bell System Technical Journal 57, 6 (1978), 1971- 1990. arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1002/j.1538-7305.1978.tb02139.x.Google ScholarGoogle ScholarCross RefCross Ref
  9. Hristo Deshev. 2008. Pro Windows PowerShell (Pro). APress. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Richard P. Gabriel, Jon L. White, and Daniel G. Bobrow. 1991. CLOS: Integrating Object-oriented and Functional Programming. Commun. ACM 34, 9 (Sept. 1991), 29-38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. James Gosling, Bill Joy, and Guy L. Steele. 1996. The Java Language Specification (1st ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay. 1997. Back to the Future: The Story of Squeak, a Practical Smalltalk Written in Itself. SIGPLAN Not. 32, 10 (Oct. 1997), 318-326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Daniel H. H. Ingalls. 1986. A Simple Technique for Handling Multiple Polymorphism. SIGPLAN Not. 21, 11 (June 1986), 347-349. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. David Korn and Kiem phong Vo. 1991. SFIO: Safe/Fast String/File IO. In In Proc. of the Summer '91 Usenix Conference. 235-256.Google ScholarGoogle Scholar
  15. Angelika Langer and Klaus Kreft. 2008. Standard C++ IOStreams and Locales: Advanced Programmer's Guide and Reference (1st ed.). Addison-Wesley Professional. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Doug McIlroy. 1964. Pipes Proposal. http://doc.cat-v.org/unix/pipes/.Google ScholarGoogle Scholar
  17. Scott McKay. 1991. CLIM: The Common Lisp Interface Manager. Commun. ACM 34, 9 (Sept. 1991), 58-59. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Adobe Press. 1985. PostScript Language Reference Manual (1st ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Mary Shaw and David Garlan. 1996. Software Architecture: Perspectives on an Emerging Discipline. Prentice-Hall, Inc., Upper Saddle River, NJ, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Bjarne Stroustrup. 2000. The C++ Programming Language (3rd ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. N. Taylor, N. Medvidovic, and E. M. Dashofy. 2009. Software Architecture: Foundations, Theory, and Practice. Wiley Publishing. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Guido van Rossum and Fred L. Drake. 2011. The Python Language Reference Manual. Network Theory Ltd. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Marcel Weiher. 1998. MPWFoundation Framework. https://github.com/mpw/MPWFoundation.Google ScholarGoogle Scholar
  24. Marcel Weiher. 2003. Objective-Smalltalk. http://objective.st.Google ScholarGoogle Scholar
  25. Marcel Weiher. 2003. stsh. http://objective.st/Scripting.Google ScholarGoogle Scholar
  26. Marcel Weiher. 2017. iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift. Addison-Wesley Professional. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Nobuyoshi Nakada et al. Yukihiro Matsumoto, Koichi Sasada. [n. d.]. MRI - Matz's Ruby Interpreter - The Ruby Programming Language. https://www.ruby-lang.org/en/.Google ScholarGoogle Scholar

Index Terms

  1. Standard object out: streaming objects with polymorphic write streams

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in
            • Published in

              ACM Conferences cover image
              DLS 2019: Proceedings of the 15th ACM SIGPLAN International Symposium on Dynamic Languages
              October 2019
              116 pages
              ISBN:9781450369961
              DOI:10.1145/3359619

              Copyright © 2019 ACM

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 20 October 2019

              Permissions

              Request permissions about this article.

              Request Permissions

              Qualifiers

              • ARTICLE

              Acceptance Rates

              Overall Acceptance Rate 79 of 205 submissions, 39%

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader
            About Cookies On This Site

            We use cookies to ensure that we give you the best experience on our website.

            Learn more

            Got it!