Workflow as a system for changing code flow

I need advice on the requirement in one of our projects. We are trying to achieve what we want to control the flow of method calls from a text or XML file.

For instance:

string response = new Assembly1.Class1().DoStuff();
if (response == "OK")
{
  new Assembly1.Class2().DoStuff();
}
else if (response == "NOTOK")
{
  new Assembly2.Class1().DoStuff();
}

As I can present the above code in some format, which can be changed by a non-technical user to change the sequence of function calls.

+3
source share
3 answers

Essentially, you have to decide what you are trying to accomplish.

C # code contains a certain complexity, but all this complexity exists, because C # code is very flexible.

, . ​​ , #, , #.

, , , . , , - , , .

, , , . "". , , . , , XML XML.

+2

, xml. .

0

Factory . factory ...

sayFlowFlow() ( ). , .

At the beginning of the process, you simply read the XML file and create an object for the corresponding class and call the workflow method of this class, which will start the execution of the predefined sequence.

0
source

Source: https://habr.com/ru/post/1779337/


All Articles