DeepAI AI Chat
Log In Sign Up

Decomposition Without Regret

by   Weixin Zhang, et al.

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.


page 1

page 2

page 3

page 4


EOLANG and phi-calculus

Object-oriented programming (OOP) is one of the most popular paradigms u...

Simple Reference Immutability for System F-sub

Reference immutability is a type based technique for taming mutation tha...

Design of Classes I

The use of functional programming languages in the first programming cou...

Formalizing φ-calculus: a purely object-oriented calculus of decorated objects

Many calculi exist for modelling various features of object-oriented lan...

Existential Types for Relaxed Noninterference

Information-flow security type systems ensure confidentiality by enforci...

Simulating an Object-Oriented Financial System in a Functional Language

This paper summarises a successful application of functional programming...

Towards Comparing Programming Paradigms

Rapid technological progress in computer sciences finds solutions and at...