Example & Tutorial understanding programming in easy ways.

What is DispatchAction?

The DispatchAction class is used to group related actions into one class. We can group the different methods in one class which have similarities in their functions. 

DispatchAction is an abstract class, so you must override it to use it. It extends the Action class. It should be noted that you don`t have to use the DispatchAction to group multiple actions into one Action class. You could just use a hidden field that you inspect to delegate to member() methods inside of your action.

The DispatchAction enable the programmer to combine together related function or class.

  1. Using Dispatch Action programmer can combine the user related action into a single UserAction. like add user, delete user and update user.

  2. DispatchAction execute the action based on the parameter value it receives from the user.

Read More →