title: Quartz .NET job execution to call existing class method
body: <p>I have an existing C# ASP.NET application with a user interface and various buttons to initiate actions.  The actions make synchronous method calls on a class which is a singleton and I'll call this class ServiceLayer.  This layer also initializes a data model.</p>
  
  <p>I want to schedule some of the actions from the UI to occur at certain times of day.  I believe Quartz.NET provides all the necessary features I need to do this. I can successfully call methods on the singleton class ServiceLayer from the Execute(IJobExecutionContext context) of each Job class (i.e. classes which implement the IJob interface). However, I don't like using this approach for a few reasons:</p>
  
  <ul>
  <li>Difficult to unit-test (e.g. I have to ensure the singleton is initialized before I can do anything)</li>
  <li>Scaling up if many jobs are called </li>
  <li>Thread safety issues associated with calling multiple methods on the singleton class at the same time.</li>
  </ul>
  
  <p>My question is what is the best design pattern to handle this case instead of calling methods on a singleton directly?  I believe I need to make use of the JobDataMap somehow but I'm not sure how.  Should I be looking at a producer-consumer or a queuing approach?    </p>