Standard object out: streaming objects with polymorphic write streams

Marcel Weiher, R. Hirschfeld
{"title":"Standard object out: streaming objects with polymorphic write streams","authors":"Marcel Weiher, R. Hirschfeld","doi":"10.1145/3359619.3359748","DOIUrl":null,"url":null,"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.","PeriodicalId":191261,"journal":{"name":"Proceedings of the 15th ACM SIGPLAN International Symposium on Dynamic Languages","volume":"132 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-10-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 15th ACM SIGPLAN International Symposium on Dynamic Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3359619.3359748","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

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.
标准对象输出:具有多态写流的流对象
我们提出了标准对象输出,它是Unix标准输入输出库的一个面向对象的输出部分。多态写流(PWS)充当面向对象体系结构风格与管道和过滤器体系结构风格之间的体系结构适配器,就像studio充当调用/返回体系结构风格与管道和过滤器体系结构风格之间的体系结构适配器一样。当前Unix I/O系统的面向对象接口非常接近地模仿了它们的过程对应物,以至于它们既不是多态的,也不是流的,至少对于对象来说不是。具体来说,首先通过向对象发送特定消息将其转换为固定的字节表示,然后将结果输出到底层字节流上。使用这种方法,这些api不允许流行为:整个结果必须在内存中构造,然后才能输出。此外,与最终输出大小相比,嵌套结构的输出可能需要大倍数的时间和空间,如果对象图中存在循环,则完全失败。它也不允许多态行为。为了解决这些问题,我们提出了多态写流(PWS)。pws表示将编码与特定流目的地解耦的类的层次结构。使用三重调度,它们提供流行为,并允许每个流对每种对象做出特定的反应,反之亦然:通过沿着流的继承链链接消息来实现公共功能的共享。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信