Today I have read an article “Kill Your Phoenix Context” by Peter Ullrich and here are some thought about the ideas in it.
The article resonates really well with what I think about Phoenix contexts. In general, I really like that Phoenix team decided to include them as a default code organization utility of the framework. It’s a great step forward from the traditional way of trying to fit everything in framework’s machinery, such as models or controllers.
However, on the other hand, what Phoenix proposes by default is really simple. It works for simple CRUD apps, but I have similar experience as Peter: when the app and the complexity grows, most context become a dumpster for resource-related code, with no internal organization.
I emphasized “resource-related” because it’s the second part of what I don’t like. Context as Phoenix promotes them are resource oriented and I believe it not a great way to structure the project in a scalable way.
continue reading on katafrakt.me
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.