Phoenix contexts usage examples and inspiration

Today one of the main “barriers” I’ve seen for beginners (me included) is having to think about the boundaries of the app (contexts) beforehand. The problem is that sometimes we’re not finding ourselves too creative to think about that, and this can be a great setback to quickly get an idea out of paper.
Considering that most of the time we just want to speed things up and adapt as we see fit, I was wondering if we could gather some kinda of “inspiration base” for this. I’ve seen some good examples like: A Reaction context for Likes and Favorites; the traditional Accounts for Users and etc.

What you guys think, would you mind giving your 2 cents on this for future reference?

I start with a Core/Main context. I don’t trust myself to spot the right boundaries and the beginning of a project so no longer try. As I discover my contexts I refactor into them.

3 Likes

This is my approach as well. Context’s come from good knowledge of problem domain. Something you usually don’t know until you have a pretty mature application. Therefore I start simple and refactor when I see where things are heading.

I think this is quite a good idea. When I’m starting out a new project, I spend way too much time thinking about a proper context just to find out later that the proper context would be different.

Next time I’ll try the Main/Core approach. :pray:

1 Like