Generalizable design patterns using actors - help?

While in OOP there are a lot of design patterns, in Erlang/Elixir we have MFA. But Higher order functions replace easily template/strategy patterns because You can pass the implementation. Being functional has also some advantages over OOP.

Otp is the design pattern around processes, a good resource is Designing for scalability with Erlang/OTP. It takes time to select the right behaviour in the right situation.

I always try to avoid the use of if, it can be replaced by pattern matching. It allows You to match something given many conditions. If is also a macro around case statement.

There are patterns around distribution, depending on which sides of the CAP theorem You want to have. But this is high level stuff :slight_smile:

I would advise You to look deep into Otp, It is IMHO the most enjoyable part to learn.

3 Likes