I’m going through Dave Thomas’s video course, “Elixir For Programmers”. In the course he talks about decoupling & maintaining that decoupling.
He recommends seperate apps over an umbrella project.
What he says makes a lot of sense, but I believe there must have been a lot of thought going into the umbrella project design.
I don’t have enough programming experience to comment & would like to hear the counter arguments.
(For more context, a “rant” quote from Dave:)
A Personal Rant About Kitchen Sink Web Apps
When you create a new Phoenix application, you end up with over 7,000 files spread over more than 1,000 directories—a total of about 45Mb.
Now most of these are not part of Phoenix itself—they are third party dependencies. In fact, over 90% of this is JavaScript.
But, ignoring all this, we’re still faced with the potential for another kind of bloat. Although Phoenix 1.3 is better in this regard than its predecessors, it still tempts developers to include their application code alongside the Phoenix code, either directly or as a so-called umbrella app.
Part of this temptation is the directory structure itself. Why is there a separate web subdirectory under gallows if we aren’t supposed to put non-web code somewhere?
Part of the temptation is also the fact that the ecto database interface code is included by default in every new Phoenix app. A pure web interface has no need of a database—all persistence work should be performed in services.
I strongly suggest you fight the temptation to stick everything in the Phoenix app. As we’ve been building our hangman game, we’ve been working hard to build code into separate, well defined applications. We’ll continue to do this as we add Phoenix integration.
If, in some future app, you fall victim to the pressure to put all your code into a single Phoenix basket, then it isn’t a disaster. But, when you finish, look at the result and ask yourself if it might be better structured as a set of isolated components.