amacgregor

amacgregor

Software design patterns and reference architectures

I’m doing a bit of research and writing on software design patterns and reference architectures relevant to Elixir applications.

Often it seems the discussion around architecture and design patterns seems to be dominated by the idea that they are irrelevant in the context of functional programming, and while this might be true for the original GoF patterns; I feel there is still a few useful patterns yet to be fully explored in the realm of Elixir.

Top of mind, and highly colored by my background:

  • Flow-Based programming to build robust and scalable data pipelines
  • Event Sourcing for use cases where traceability is highly important

What other patterns could be useful or are you currently using? Would love to hear from other developers what is currently being used in production and with that amount of success.

Most Liked

dimitarvp

dimitarvp

Now that I completely agree with. I was there when the infamous “Java enterprise architects” ran rampant and ripped companies off of millions of dollars so I definitely have some PTSD about it. :smiley:

Yes and no. If you use some well-known Elixir flavour of doing things (like configuring implementations and using dynamic dispatch) from the get go then this allows you to juggle a lot of complexity in the future. All that’s necessary is being a little clever at the start – but not too clever so as to lock yourself into a certain paradigm that might indeed turn out to be ill-advised 300k coding lines later.

I am not disagreeing with you – I am simply adding the nuance that we have it easier in FP. I’ve had to refactor and re-adapt huge Java and Ruby codebases in the past and that’s basically a perfect way to want to commit suicide.

amacgregor

amacgregor

That’s an excellent point.

Agreed, and I can relate, and that is the thing I found when looking into Desing patterns in FP or elixir; GoF is pretty redundant and not neat because as you say we have it easier with FP.

ericsteen

ericsteen

Indeed. Helps to go back to first principles. Thanks for pointing this out, since a behavior is just dynamic dispatch polymorphism, as “strategies” can be combined, mixed, and matched. Eureka!

Where Next?

Popular in Discussions Top

mbenatti
Following https://github.com/tbrand/which_is_the_fastest |> https://raw.githubusercontent.com/tbrand/which_is_the_fastest/master/imgs...
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44167 214
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement