• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Functional Design and Architecture - Existing architecture patterns

 
Ranch Hand
Posts: 32
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic