Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25436
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jeff Higgins <jeff@invalid.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: OO Design Patterns vs FP |
| Date | Wed, 02 Oct 2013 15:55:13 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 46 |
| Message-ID | <l2htmi$tc3$1@dont-email.me> (permalink) |
| References | <l2gi7f$3gc$1@news.albasani.net> <l2he49$rka$1@dont-email.me> <l2hh3u$be$1@news.albasani.net> <l2hl8f$7p4$1@dont-email.me> <l2hs8j$mg2$1@news.albasani.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Wed, 2 Oct 2013 19:54:58 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="6b9e92482af47766954d85fb77d372f5"; logging-data="30083"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kayPhfTjmCNoZOgrKs3KLmfiroXFz3Dg=" |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
| In-Reply-To | <l2hs8j$mg2$1@news.albasani.net> |
| Cancel-Lock | sha1:YyYSSK3+HZh0QqErAPb+cM0l3mg= |
| Xref | csiph.com comp.lang.java.programmer:25436 |
Show key headers only | View raw
On 10/02/2013 03:31 PM, Sebastian wrote: > Here's a useful quote from Neal Ford's article series on IBM > developerworks: > > <quote> > In the functional-programming world, traditional design patterns > generally manifest in one of three ways: > 1. The pattern is absorbed by the language. > 2. The pattern solution still exists in the functional paradigm, but the > implementation details differ. > 3. The solution is implemented using capabilities other languages or > paradigms lack. (For example, many solutions that use metaprogramming > are clean and elegant — and they're not possible in Java.) > </quote> > > My reading so far could be summarized like this: > > - Strategy > -- take functions (Java 8 lambdas) that implement a strategy > -- provide functions to choose from > > - Template and Factory Method > -- these patterns also relate to supplying concrete behavior > -- abstract template methods may become simple members (lambdas), > concrete subclasses disappear > > - Command > -- disappears, because object wrapper not needed for portable > functionality in Java 8 > > - Chain of Responsibility and Decorator > -- composition of (partial) functions > > - Adaptor > -- adaptor classes can be conveniently replaced by (composable) lambdas > > - Visitor > - more complex, no direct correspondence > - special case for streams: reduce (decouple traversal of stream from > operation on stream elements) > > > I’d welcome any comments, additional examples of correspondences etc. > A bit more useful as a starting point for discussion. Thanks. :)
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
OO Design Patterns vs FP Sebastian <news@seyweiler.dyndns.org> - 2013-10-02 09:33 +0200
Re: OO Design Patterns vs FP Jeff Higgins <jeff@invalid.invalid> - 2013-10-02 11:29 -0400
Re: OO Design Patterns vs FP Sebastian <news@seyweiler.dyndns.org> - 2013-10-02 18:21 +0200
Re: OO Design Patterns vs FP Jeff Higgins <jeff@invalid.invalid> - 2013-10-02 13:31 -0400
Re: OO Design Patterns vs FP Jeff Higgins <jeff@invalid.invalid> - 2013-10-02 15:16 -0400
Re: OO Design Patterns vs FP Sebastian <news@seyweiler.dyndns.org> - 2013-10-02 21:31 +0200
Re: OO Design Patterns vs FP Jeff Higgins <jeff@invalid.invalid> - 2013-10-02 15:55 -0400
csiph-web