DEV Community

Discussion on: Protocols vs. Behaviours in Elixir: Additional Thoughts

Collapse
 
dsdshcym profile image
Yiming Chen • Edited

Thank you! I'm glad to see my blog post to be inspiring!

I think maybe handle_continue callback can be useful here 🤔
pass/intialize a pure data structure in the init callback, then call start_timer in the handle_continue callback?

Collapse
 
savonarola profile image
Ilya Averyanov

Thanks for the feedback!

That should work, but does not completely resolves the thing that bothers me the most: that we still have two places where initialization happens: when creating a data structure and then some "additional" initialization in handle_continue. Maybe I am too spoiled with traditional OOP languages, and this is OK :)