I'm working with application development frameworks like Tauri and Wails, which handle state by creating a struct named `App`. This struct stores all kinds of relevant context data, but it's different from how Go's contexts function. I'm curious if this approach has a specific name, and if so, are there better alternatives? It can be a bit cumbersome to pass this state down through nested function calls. For comparison, Elixir uses processes with ETS tables for handling state. Any insights on this pattern or suggestions for better methods?
1 Answer
This sounds like a context object to me! It's a common pattern, but since you're using structs, it could have some different implications compared to traditional OOP context objects. You might want to check out more on the concept, but it's essentially about managing and passing around application context information.
Yeah, like the one discussed in the context object article! But just remember, since we're dealing with structs and not full blown objects, the mechanics might differ a bit.