In the dynamic model, the model can run because the model can be transformed into action, which are equivalent to functions and methods, and can be executed.
The class corresponding to the action is org.xmeta.Action。
ActionContext is the environment in which actions are executed. Variables and thread states are stored in ActionContext. Global variables, local variables, parameter transfer, and the implementation of various control models (while, for, try/catch, if, etc.) are all need ActionContext.
The Java class corresponding to the ActionContext is org.xmeta.ActionContext。
The behavior of model objects is implemented by actions, and any model can be transformed into actions in the dynamic model. Therefore, the model engine used by XWorker specifies that the model under the sub-nodes of the model named actions is the definition of model behavior.
import org.xmeta.Thing; import org.xmeta.Action; import org.xmeta.ActionContext; //Transfer model into action Action action = thing.getAction(); //Execute an action action.run(new ActionContext()); //Execute a behavior of model through doAction method thing.doAction("run", new ActionContext());
Actually, the principle of action is also the execution principle of dynamic model.
XWorker's model engine is implemented in Java, and the model class named JavaAction is interpreted and executed directly by the engine.
Copyright © 2007-2019 XWorker.org 版权所有 沪ICP备08000575号