Open stevegrossi opened 5 years ago
I'm very curious about the "In-Context associations?" option, which seems to fulfill the promise of bounded contexts (though I know Phoenix contexts aren't explicitly an implementation of DDD's bounded context pattern). In that direction, it would be interesting to have a rule that no context may reference modules within another context. I like that idea in theory, I'm just curious how it would play out in practice.
This post details an interesting approach similar to "In-Context associations", but instead of only passing IDs between contexts, you can also pass _map_s (but not structs, which are domain-specific) between contexts.
assoc
import Ecto, only: [assoc: 2]
Accounts.Account
ids
import Ecto.Query
In-Context associations?
Inspired by this forum post.
Habits.Account
could be anything, potentially more context-specific likeHabits.Owner