
apoorv-2204
Design patterns for Hexagonal / Clean Architecture in Elixir (beyond Behaviour + Impl)
I’m experimenting with Hexagonal / Clean Architecture in Elixir. The classic Behaviour + Impl split works great for mocking and isolating IO—here’s a trimmed-down example from our SFTP adapter:
elixir
# Port (Behaviour)
defmodule Core.SFTP.Port do
@callback connect(map()) :: {:ok, term()} | {:error, term()}
@callback write(Path.t(), iodata()) :: :ok | {:error, term()}
@callback disconnect(term()) :: :ok | {:error, term()}
end
# Adapter (Impl)
defmodule Core.SFTP.Live do
@behaviour Core.SFTP.Port
@impl true
def connect(conf), do: SFTPClient.connect(conf)
@impl true
def write(path, data), do: SFTPClient.write_file(path, data)
@impl true
def disconnect(conn), do: SFTPClient.disconnect(conn)
end
I wanted to know what are architectural patterns in elixir , apart from behaviour and impl pattern
Popular Backend topics

Serverless has been quite a prevalent topic in our industry in the past few years, and while there are a lot of sceptics, I think it’s sa...
New

AbstractMachinesLab/caramel.
:candy: An Erlang backend to the OCaml compiler. Contribute to AbstractMachinesLab/caramel development by c...
New

The Emerging Architectures for Modern Data Infrastructure.
Five years ago, if you were building a system, it was a result of the code yo...
New

Consider this Erlang code:
Rectangle = {rectangle, 20, 10}.
{rectangle, Width, Height} = Rectangle.
> Width.
20
> Height.
10
When...
New

Multicore OCaml: October 2020.
Welcome to the October 2020 multicore OCaml report, compiled by @shakthimaan, @kayceesrk and of course my...
New
New

https://twitter.com/briandfoy_perl/status/1354535622069919748
This thread was posted by one of our members via one of our news source tr...
New

And the blog:
Rails has been unapologetically full stack since the beginning. We’ve continuously sought to include ever-more default an...
New

Phoenix 1.6.0 got released last week, with built-in authentication and mailer generators, a whole new HEEx (HTML-aware Embedded Elixir) e...
New

December is only a few weeks away. I have been detached from programming puzzles for a while now so thought I would give myself some warm...
New
Other popular topics

Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
New

I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me.
I think the Planck and the Preonic (o...
New

I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New

Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New

Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
New

Hi folks,
I don’t know if I saw this here but, here’s a new programming language, called Roc
Reminds me a bit of Elm and thus Haskell. ...
New

Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New

Author Spotlight:
Peter Ullrich
@PJUllrich
Data is at the core of every business, but it is useless if nobody can access and analyze ...
New

Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /onivim
- /typescript
- /svelte
- /crystal
- /kotlin
- /c-plus-plus
- /tailwind
- /gleam
- /ocaml
- /react
- /flutter
- /elm
- /vscode
- /ash
- /opensuse
- /html
- /centos
- /php
- /deepseek
- /zig
- /scala
- /lisp
- /textmate
- /sublime-text
- /nixos
- /debian
- /react-native
- /agda
- /kubuntu
- /arch-linux
- /revery
- /django
- /ubuntu
- /spring
- /manjaro
- /nodejs
- /diversity
- /lua
- /julia
- /c
- /slackware
- /neovim