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

jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 14362 124
New
opsb
We’re considering our architecture from a viewpoint of scaling our traffic heavily over the next 6 months. Our current deployment is runn...
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 130579 1222
New
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
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
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement