Hacker News new | ask | show | jobs
by zachallaun 1257 days ago
> Also, why are we using the contexts directly in the controllers and keep the top-level module empty?

Because the context is the “public API” for the rest of your application to use. You can have as many layers below the context as you want, often purely functional, composable, and testable.

1 comments

The contexts are boundaries, places where you use process machinery and might call other subsystems, or services, but they’re not the application’s public API. You might want to check Bruce Tate’s book “ Designing Elixir Systems with OTP”.