My Authors
Read all threads
Long @elixirlang / @elixirphoenix tweet... beware.

1- Layers

In the Workerbee book, we recommend layers for do-fun-things with big-loud-workerbees (boundary).

The data-functions-tests in the core are often wrapped in a boundary.
2- Mappings of services

In a typical @elixirphoenix app, the layers are:

Services separate a functional core (schema(s) and pure-ish module(s) in a context directory)

boundary is in a *context*.

Changesets get created in an ecto *schema* and applied in a *context*.
3- Mappings of layers in a live view

- The *render*, either in templates or a render function, is in the *core* layer

- Handlers are boundary concerns... all data must go through a boundary layer, often a context.
4- An exception to the above

Sometimes I have core features that I want to use within a LiveView, but I want to validate data that goes into them.

Schemaless changesets hexdocs.pm/ecto/Ecto.Chan… are ideal for this purpose.

Here's where the exception comes in.
5- I will put the schemaless changeset in my xxx_web/live/xxx_live directory as a *form_data.ex* module. The concerns are purely *LiveView boundary* concerns.

We did this in my LiveView class, and I'll likely do a form of it in my OTP class July 22-24.

Great technique.
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Bruce Tate

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!