"A Functional Pattern System For Object-Oriented Design" by Thomas Kuehne. Published by Verlag Dr. Kovac, Hamburg, Germany, in 1999. 328 pages.
homepages.mcs.vuw.ac.nz
ISBN 3-86064-770-9 (Please note that although the ISBN link does work, the book is not available through amazon.com.)
Describes how functional and object-oriented programming can be used together by giving some patterns for doing functional programming with an OO language.
Example implementations are in Eiffel Language.
(While the commercial version of the book is Out of Print, a pdf version can be had from the author's home page)
If interested it can be ordered, or read online, see www.mm.informatik.tu-darmstadt.de .
Design patterns inspired by Functional Programming concepts can advance object-oriented design.
This thesis promotes the idea that concepts from the world of Functional Programming can be captured with design pattern descriptions. These can then be used to benefit from functional programming concepts with ordinary object-oriented languages. The functional patterns are evaluated for their impact on language design and a new approach to a dual-paradigm language is presented.
Check www.mm.informatik.tu-darmstadt.de for Contents, Abstract, and How to Order.
The patterns are:
Functor Object (called Function Object in Thomas Kuehnes thesis but different from the Function Object described on this wiki):
Black-box behavior parameterization
Lazy Object:
Evaluation-by-need semantics (Lazy Evaluation) and Call By Need Semantics
Transfold Pattern:
Combining Internal Iteration and External Iteration
Null Object:
Abandoning null references
Translator Pattern:
Homomorphic Mapping with multi-dispatch functions (External Polymorphism)
Very Cool!!!
I am fascinated by the efficiency, elegance and beauty of functional programs -- my favorite language are Lisp and Haskell, although most systems I am involved with are Java architectures.
I'll have to take your patterns out for a spin before I can comment more but I am definitely interested,
--- Mike Beedle
Some People prefer the term Do Nothing or Empty Behavior Object to Null Object as it eliminates the usual arguments over void, nil, or null.
I wonder what Thomas would think of the Python Language. It seems to support most of this stuff pretty directly. -- Phil Goodwin
Python's support is nice, but it is a long stretch to a full blown multi-paradigm language. Still, that guy is right (see below). -- Thomas Kuehne
Python supports some functional programming concepts. See "Lambda forms" in the Python tutorial [1]. -- A guy
Good old Smalltalk supports many more functional programming concepts than Python, including full closures and continuations. -- Markus Kohler
There are also examples of OO-FP languages. See OHaskell on page Fp Vs Oo -- Gunnar Andersson
There are several examples of OO-FP languages. See Nice Language (multi methods) and Scala Language (Traits).
For some attempts to implement the patterns in Cee Plus Plus and also implement Eiffel Language examples using Smart Eiffel see Object Functional Implementation.
And here I thought this was the exact opposite, a guide on implementing objects in functional languages. But then again, that's so simple, one could hardly write a paper, let alone a book about that.
Please read Parking Ticket.
See also Pattern Implementation Discussion, Functoids In Cpp, Software Design Pattern Critique, Patterns In Functional Programming.
See original on c2.com