GUI concept - centralized or decentralized

I've been learning Erlang for a few months now, and now it's time to do some basic GUI.

After some quick research, I saw an interesting library called "wxi" (based on Fudgets of Haskell) that takes a different approach to GUI. There is no central loop, each widget handles its own events and handles its own data.

What do you guys think about this? It looks like it might be efficient in languages โ€‹โ€‹like Erlang and it's an interesting approach.

William van Doorne

+2


source to share


1 answer


In normal applications, a process (or a thread, if you want to be legible) owns the state of the UI and handles events through a message loop. Since Erlang's processes are extremely lightweight, wxi's approach is a very logical and natural extension of the traditional model.



This approach has distinctive features for user interface and application design. For example, a comprehensive download dispatcher manager that has animations, I / O, etc., can be bundled as a completely independent process (with sub-processes handling its UI components) that interacts with the parent interface through message passing. Such control may even fail due to a connection issue or internal error, and the parent control acting as a supervisor indicates that an error has occurred and just start a new copy of the control.

+2


source







All Articles