[erlang-questions] Beginner trying to figure out idiomatic OTP architecture

zxq9 zxq9@REDACTED
Fri Mar 25 02:24:15 CET 2016


On 2016年3月25日 金曜日 00:07:35 Jesper Louis Andersen wrote:
> On Thu, Mar 24, 2016 at 4:44 PM, Matthew Shapiro <me@REDACTED> wrote:
> 
> > I actually think I"m going to forego ranch, Syn, and E2 for the first
> > iteration and implement them by hand (since this is a learning exercise
> > more than anything) and there are plenty of guides around to accomplish
> > each of those individually.
> 
> 
> This is a really good idea from a learning point of view, since relying on
> baked solutions here reaps you of the knowledge at the lower levels, which
> is important to have. What I would steal though, is the notion that the
> libraries can be separate applications in the same Erlang VM. This allows
> you to evolve them independently of each other. And if you keep a module in
> each application which is the interface, you can make it way easier for
> yourself in the long run.

+1

This reminds me...

One really nice thing about having a flat namespace for modules is that if
you start writing a module directly into your current project, and then
later realize it (and some others) should be split out into a separate, more
generic, library or application, none of the calling sites elsewhere have
to change and you don't have a minefield of "from foo.bar import biz.baz"
locations to update (or pray that a tool or script fixes correctly).

-Craig



More information about the erlang-questions mailing list