Decomposition Without Regret

04/21/2022
by   Weixin Zhang, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/26/2021

EOLANG and phi-calculus

Object-oriented programming (OOP) is one of the most popular paradigms u...
research
07/11/2023

Simple Reference Immutability for System F-sub

Reference immutability is a type based technique for taming mutation tha...
research
07/26/2022

Design of Classes I

The use of functional programming languages in the first programming cou...
research
04/15/2022

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

Many calculi exist for modelling various features of object-oriented lan...
research
11/11/2019

Existential Types for Relaxed Noninterference

Information-flow security type systems ensure confidentiality by enforci...
research
11/23/2020

Simulating an Object-Oriented Financial System in a Functional Language

This paper summarises a successful application of functional programming...
research
05/15/2019

Towards Comparing Programming Paradigms

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

Please sign up or login with your details

Forgot password? Click here to reset