
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
New
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

What's so exciting about Postgres? with Craig Kerstiens (The Changelog #417).
PostgreSQL aficionado Craig Kerstiens joins Jerod to talk ...
New

I’ve never really felt 100% comfortable using the enum type because of my lack of understanding how it is constructed . . .
. . . until ...
New
New

Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New

Sorry for the very vague noob question, I really want to ask this:
When do we use async or sync code in the context of Elixir? AFAIK gen...
New

Hello guys! Perhaps some of you have already seen this invitation on other channels in the Elixir community or even responded to our surv...
New
Other popular topics

Any thoughts on Svelte?
Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New

SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
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

Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New

Think Again 50% Off Sale »
The theme of this sale is new perspectives on familiar topics.
Enter coupon code ThinkAgain2021 at checkout t...
New

API 4
Path:
/user/following/
Method:
GET
Description:
Returns the list of all names of people whom the user follows
Response
[
{ ...
New

I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New

A Brief Review of the Minisforum V3 AMD Tablet.
Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New

Hello,
I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New

This is cool!
DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON
We just witnessed something incredible: the largest open-s...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /java
- /haskell
- /onivim
- /svelte
- /typescript
- /crystal
- /c-plus-plus
- /kotlin
- /tailwind
- /gleam
- /react
- /ocaml
- /elm
- /flutter
- /vscode
- /ash
- /opensuse
- /centos
- /php
- /deepseek
- /html
- /zig
- /scala
- /sublime-text
- /textmate
- /debian
- /nixos
- /lisp
- /agda
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /django
- /manjaro
- /spring
- /diversity
- /lua
- /nodejs
- /slackware
- /c
- /julia
- /neovim