C# Batch Jobs Architecture

Mar 30 2022 6:11 PM

Hello,
My current company has 70 batch jobs and each batch job is as separate exe and got scheduled in windows scheduler. The problem with this approach is Maintenance . Even though no dependency b/w exe’s, but maintenance is Costly. 

I have another approach which I followed in my previous company like Create one project (one exe) and pass the bath type in command line arguments and based on the argument corresponding business calls to get the logistics executed something like below.

E:\Test\BatchRunner\BatchRunner.exe /Jobs:ProcessEmployee /ProcessMonth 07-01-2014 /CompanyId 1052
E:\Test\BatchRunner\BatchRunner.exe /Jobs:ProcessCompany 
E:\Test\BatchRunner\BatchRunner.exe" /Import:ScrapData

So one exe could be used by multiple process. Please let me know which one is best way and drawbacks? If the second approach is good, Is there a best library to parse the command line arguments for .net core? Please suggest me.


Answers (1)