GUI as a finite state machine

前端 未结 3 1108
独厮守ぢ
独厮守ぢ 2021-02-05 19:50

To implement application\'s GUI I would like to have all the logic to go from one form to another centralized. This GUI manager will behave as a finite state machine. Although I

3条回答
  •  难免孤独
    2021-02-05 20:26

    In the Java world you can think of a Struts or JSF application as an FSM (this event on this page/state takes us to that page/state.

    When modelling the flows in a traditional web-based UI I did find using FSMs to be an extremely useful analysis tool. You can very quickly capture the essence of the application's behaviour. There was pretty much a one-to-one correspondance between page and state. I would have a state model and associated data models.

    Now we have richer UIs exploiting AJAX the correspondance between application states and "pages" is less obvious. However you can still reason about the application's behaviour: here the user is doing this, when they have finished thay can take actions X or Y and then they are able to do that. So the states, events and transitions do still exist it's just that their representaiton is a little more "virtual".

提交回复
热议问题