top | item 34338454

(no title)

zachallaun | 3 years 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.

discuss

order

nesarkvechnep|3 years ago

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”.