3 ms·
Yes! Contexts are the equivalent of building a greenfield rails app with a bunch of properly namespaced and isolated Rails engines. You end up with some really
by bradgessler 9y ago
Yes! Contexts are the equivalent of building a greenfield rails app with a bunch of properly namespaced and isolated Rails engines. You end up with some really awkward names and boilerplate code that just doesn’t feel right. You can get that sense while reading the Phoenix context documentation.
The Phoenix story should include an area where the app can evolve, and as it matures and becomes more well understood, pieces of it could be moved into contexts.
- bwilliams 9y ago100% agreed. I see what the Phoenix team was trying to accomplish, but I don't think it will pan out in projects how they expect. It reminds me a lot of fat model and skinny controller when that was popular. I think the underlying issue I have with contexts is that it's forcing us to predict the future. We have always had to predict/plan but I think contexts push it a bit further that we can reliably predict/plan. This is especially true for new apps which tend to change rapidly. Like I said before I think it's a great pattern to extract existing code into but it's feels too heavy to start with.