Organize Core Functions by Purpose

Recall our initial data architecture. We have Quizzes made up of Templates and Questions. Users answer questions with Responses. We designed our data by putting structs inside empty modules. That design will serve as a useful foundation of our core, as shown in the figure.

images/Functions/function_layer.png

Now, we’ll slowly start to fill those modules up with functions. It’s time to build out the first few modules for our Quiz component.

Let’s look first at three pieces of our Mastery core: the Response, Question, and Template. Remember, each of these is a module, and also the name of the struct that lives inside the module. We will fill each ...

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.