Integrating Our OTP Dependencies into Phoenix
Let’s learn how to integrate our project into Phoenix to make web applications, starting with the git/hex dependencies.
We'll cover the following...
Phoenix is a web framework. Once any web project grows beyond the most rudimentary level of complexity, we’re going to need to deal with complexity. We’ve been clear so far with the layers that make up any internal component. This section will discuss how to think about our code organization when we need to plug into someone else’s organization.
By now, we are familiar with the coding guidelines for layers that this course promotes. You might be wondering how to integrate OTP code into Phoenix. Here’s the good news—like all Elixir projects built with Mix, OTP is already built-in. If we want to integrate a complete and separate OTP project, we have a couple of options at our disposal:
-
Dependencies
-
Umbrellas
-
Contexts
Using external git or hex dependencies
The first approach is to build a fully isolated mix
project and use mix dependencies to deal with them. It’s a strategy that we’ve ...