Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Functional Design and Architecture - Existing architecture patterns

 
Greenhorn
Posts: 29
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good day!

How hard is it to adapt existing architecture patterns such as, Layers Pattern, Ports and Adapters, Pipe-and-Filter,  Publish-Subscribe, etc, to a functional design/approach?

Regards,
Joey

 
Author
Posts: 27
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jose Samonte wrote:Good day!

How hard is it to adapt existing architecture patterns such as, Layers Pattern, Ports and Adapters, Pipe-and-Filter,  Publish-Subscribe, etc, to a functional design/approach?

Regards,
Joey



Hi Joey,

Layering is very natural to all the (good) application architectures, so FP isn't an exclusion here. Haskell programs tend to have the 3-layer architecture (interfaces/eDSLs ; business logic ; implementation), although I'm introducing more layers when it's needed.

The approaches I'm describing in the book, commit into 3-layer architecture. There are different ways to achieve it, but I mostly prefer Free monads.

I would say, many high-level patterns can be ported to some degree but implementation may be quite different. For example, the EulerHS framework (https://github.com/graninas/euler-hs) that is built by me and my team has a Pub-Sub mechanism based on Free monads.

On the higher level of Software Design, FP doesn't differ from OOP that much but when it comes to implementation, FP may use something FP-specific. Or, there is always an escape hatch with imperative programming within an FP program.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic