My understanding of contexts (from the docs) is that they are intended to "...encapsulate data access and data validation." They're intended to be the layer of your application that talks to the database. Do you have a different approach?
My understanding of contexts (from the docs) is that they are intended to "...encapsulate data access and data validation." They're intended to be the layer of your application that talks to the database. Do you have a different approach?
I don't think this is a terrible idea but I like to draw boundaries and say "It's ok to reach one level deep from any point in the context tree".
ie App.Chat.send_message/2 is cool, but MyApp.Chat.Messages.send_message/2.
Re: the sibling comment referring to queries, nothing you’re doing in the article prevents that.
Ecto’s changesets are often an unfamiliar concept, so I wonder if that’s where some confusion is coming from.
However, what you say about having different changesets for validation seems to make a ton of sense to me and has given me some ideas. Thanks.