官术网_书友最值得收藏!

  • Mastering Elixir
  • André Albuquerque Daniel Caixinha
  • 308字
  • 2021-08-05 10:42:52

Innards of an Elixir Project

After looking at the building blocks in the past chapter, we will now explore the fundamental aspects of any Elixir project. There are a few rules that need to be followed, but fortunately every one of them is simple to adopt and contributes to an understandable project structure. An application that doesn't get in the way of the evolution and maintenance tasks during all its years in production is a joy for the people who work with it, and this is exactly what we aim for.

We will start by learning what an Elixir application is and how we can structure an Elixir project, along with some of the existing good practices that you can leverage. We will introduce Umbrella applications and how they can help you to define more rigid boundaries between your project's components. When creating our umbrella project, we will use some common scaffolding mix tasks, which let you quickly create an Elixir project from scratch. Afterward, we'll talk about ElixirDrip, a polished web file server that we'll be developing along this journey. Since we are setting the foundations of our application, we will also establish some rules and best practices regarding code style, using Credo, and the new Elixir 1.6 code formatter.

In this chapter, you will learn the following topics:

  • What an Elixir application is
  • How to structure an Elixir project
  • Different ways of specifying project dependencies
  • What an umbrella project is and how it can help to structure your projects
  • Using mix new to quickly get new projects up to speed
  • Laying the foundations of ElixirDrip, the project we'll develop throughout this book
  • Defining behaviours, to allow different behaviour implementations
  • Using xref to understand the dependencies between your project files
  • Establishing a consistent code style with Credo and the Elixir formatter
主站蜘蛛池模板: 稻城县| 美姑县| 塔河县| 安宁市| 安吉县| 镇雄县| 武宁县| 调兵山市| 新丰县| 封开县| 澎湖县| 东城区| 大邑县| 福贡县| 西峡县| 井陉县| 南靖县| 浪卡子县| 汝阳县| 鄢陵县| 原平市| 杂多县| 瑞金市| 台东县| 大宁县| 运城市| 新郑市| 铁力市| 墨江| 通化市| 华宁县| 扶绥县| 霍州市| 讷河市| 会同县| 威宁| 介休市| 义乌市| 宁河县| 麻江县| 大新县|