Functional programming at work in object-oriented programming

1Citations
Citations of this article
11Readers
Mendeley users who have this article in their library.

Abstract

This paper is a synthesis about why and how some functional programming (FP) can be helpful from a program design point-of-view within mainstream object-oriented programming (OOP). We first introduce criteria to ensure that FP-oriented features give an effective functional/method granularity design level within OOP. Next, we list up and discuss the general techniques and design consequences of having such FP capabilities in OOP, i.e. code abstraction/factoring at a function level, generic iterator/loop implementations, operation compositions, sequence comprehensions, partial application and currying, reduction of the number of class definitions, name abstractions, and function-based structural compatibilities. We also stress some of the difficulties of blending FP constructs with OOP, by pointing out potential problems related to design granularity mismatch, architecture non-uniformity and datatype incoherences. Several classic OOP design patterns are analyzed, since FP techniques make alternative implementations manageable: basic cases like Strategies, Commands and Observers, but also Proxies (using functional-based evaluation control) and Visitors (using functional data-driven programming). This synthesis is illustrated with C# 3.0 which offers effective FP-oriented features - based on delegates -, but also by using comparisons with other cross-paradigm languages. © JOT, 2009.

Cite

CITATION STYLE

APA

Narbel, P. (2009). Functional programming at work in object-oriented programming. Journal of Object Technology, 8(6), 181–209. https://doi.org/10.5381/jot.2009.8.6.a5

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free