分解无悔
Decomposition Without Regret
摘要:
程序设计语言包含函数式和面向对象的范例。这两种范式之间的一个关键区别是实现数据抽象的方式。也就是说,如何组织具有关联操作的数据。在可扩展性和表达性方面,函数式分解和面向对象分解之间存在重要的权衡。不幸的是,程序员通常被迫在编程的早期阶段选择特定的分解风格。一旦做出了错误的设计决策,切换到另一种分解风格的代价可能会相当高,因为通常需要普遍的手动重构。为了解决这个问题,本文提出了一个双向转换系统之间的功能和面向对象的分解。我们正式的核心系统的食物演算,它抓住了功能和面向对象的分解的本质。我们证明了转换保持了原始程序的类型和语义。我们进一步在Scala中实现了一个名为Cook的翻译工具FOOD,并进行了几个案例研究来证明Cook的适用性和有效性。
英文摘要:
Programming languages are embracing both functional and object-oriented paradigms. A key difference between the two paradigms is the way of achieving data abstraction. That is, how to organize data with associated operations. There are important tradeoffs between functional and object-oriented decomposition in terms of extensibility and expressiveness. Unfortunately, programmers are usually forced to select a particular decomposition style in the early stage of programming. Once the wrong design decision has been made, the price for switching to the other decomposition style could be rather high since pervasive manual refactoring is often needed. To address this issue, this paper presents a bidirectional transformation system between functional and object-oriented decomposition. We formalize the core of the system in the FOOD calculus, which captures the essence of functional and object-oriented decomposition. We prove that the transformation preserves the type and semantics of the original program. We further implement FOOD in Scala as a translation tool called Cook and conduct several case studies to demonstrate the applicability and effectiveness of Cook.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。