Recording not yet published
Casting against type(s)
Coercing and validating user input can lead to painful code. Casting language primitives is done by Ecto, and storage problems that once required thought are solved by convention—time is stored in UTC, money without floating points. Managing our own types often gets ugly, though: standard vs metric; currency conversion; jsonb.
Extending Ecto is simple. With custom types, we can separate casting from formatting and dramatically improve the readability and maintainability of applications.
OBJECTIVES
The audience will come away with concrete examples of how to improve their applications. Specifically, this talk will help people in making their applications less complicated, easier to understand, and easier to test.
Beginners to Elixir, Phoenix, and Ecto will come away more able to dive into Ecto internals, thinking about principles of code isolation and separation of view concerns from data persistence concerns.
TARGET AUDIENCE
This would be best suited to people who already have experience with both Phoenix and Ecto. It may also appeal to developers experienced with other web frameworks and languages, who are evaluating Phoenix.