I have developed a Windows application where a button is there on a form and when button is clicked then few series of functions will run one after one like below one
Button_Click()
{
function1();
function2();
function3();
function4();
function5();
function6();
function7();
function8();
function9();
function101();
function1();
function12();
function13();
}
Each function does some jobs. so my apps is working fine but i need to know how to design this sort of job in more structure way. so please guide me how structure way i can call all function one after one. how a experienced & expert developer will handle this jobs or how they call function one after one. thanks
It all depends on if the functions need to be invoked in a specific order or not.
If not: Use a pub/sub pattern.
If a specific order is required:
Do not use functions, add the functions to classes and use a pipeline like below.
In the pipeline implementation, invoke each handler with the same context: