Wrapping Up
Application design is a big topic, and we’ve really just scratched the surface here. But we hope we’ve given you some ideas that will help inform the choices you make as your projects evolve over time.
We recommend following the functional programming principle of separating pure code from impure; for Ecto, that means keeping code that touches Repo separate from code that doesn’t. Working with contexts can help, as you can put the code that uses Repo into the context module, and put the schema definitions into separate modules in the same namespace. If you’re using umbrellas, we recommend putting your Repo module into a separate child application that can be shared by its siblings.
If you’d like to learn more about contexts, the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access