Try It Out

Let’s take the ideas we’ve learned and put them into practice. Throughout the rest of the book, we’re going to build a project that generates quizzes. As a rough rule of thumb, we’ll start by thinking about the nouns in the system. Those will be data, and many of them will be custom datatypes.

Let’s get started. From a system console, create a new mix project:

 mix new mastery --sup

That command creates a new project. We added the --sup flag because we’ll be building an OTP project and it will need a supervisor. We’ll need to fill the project with a few data structures, but as usual, it pays to think first.

Break Nouns into Data Structures

In our quiz project, we can have templates in various categories that create questions. For ...

Get Designing Elixir Systems With OTP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.