I have implemented GUIs using Swing and always tried to follow the MVC pattern as much as I could.
I was wondering though, if MVC is not the only part of the puzzle.
Are FSMs used in GUI's design as well?
I have never used an FSM in a GUI and my approach was: on action, the corresponding method of the controller was called, to endup updating the model, finishing with updating the view.
Usually upon a request triggered by a user's action I used some simple checks to make sure that the user should be able to do the action of the kind:is a specific component enabled? or is the label visible of this kind? etc.
This seems to work so far, but I have to admit that I was "lucky" and did not have to build too complicated-sophisticated or elaborate GUIs.
I have build FSMs before (in different kind off applications -mainly in C++) and I started to wonder if FSMs in GUIs is actually used as a pattern and my approach i.e. to make checks on ActionListeners code, on what the user sees plus what components are enabled or disabled etc. to determine if the user should see some error message instead of being able to do the specific action that e.g. the button promises is actually a bad idea for full-fledged GUI apps.
So when starting to design a GUI besides how to implement the MVC do you fit/associate an FSM in your design?
UPDATE:
After reviewing Dhruv Gairola article in his comment, I am still puzzled on this.
The article mentions building an FSM which is though actually bind to the calculator implementation, meaning that even if the calculator was implemented getting user input without a GUI but via the command line, the FSM would still be needed.
I am still not sure if FSMs to validate user's action on each point in time, is a popular or valid design.
It seems that it could be too much effort and requires that the GUI has been designed completely in advance and all the possible user's action have been mapped to specific results depending on specific states.
Given the fact that there has no been any comments just a one reply, I am tending to think that may be FSM's (to validate a user's actions on controls) are actually not used.
Any input on this is highly welcome.
Thank you.