Note that there are some explanatory texts on larger screens.

plurals
  1. POScheduler tasks registration design
    primarykey
    data
    text
    <p>I have an architectural question.</p> <p>Let's say we have a scheduler and a number of subsystems. Some of these subsystems can have actions, that should be able to be executed by scheduler.</p> <p>We have two ways to implement this registration of scheduler tasks.</p> <p>One way is to have a method in each subsystem, called like <code>RegisterSchedulerTasks</code>, that will be called by bootstrapper in application during application start. In this method we will call something like static <code>Scheduler</code> class like this:</p> <pre><code>void Handler1(){ } void Handler2(){ } void RegisterSchedulerTasks() { Scheduler.RegisterHandler( "E1", Handler1 ); Scheduler.RegisterHandler( "E2", Handler2 ); } </code></pre> <p><code>"E1"</code> and <code>"E2"</code> are names of tasks, that will have corresponding settings in scheduler config.</p> <p>Another approach is to use, for example, MEF. Each subsystem will export a set of <code>ISchedulerTask</code>s, and it will not register these tasks imperatively. And on the other side of application we will have <code>SchedulerTasksRegistry</code>, that will import a set of these <code>ISchedulerTask</code>s.</p> <p>In all approaches we will have a map in config, that will contain scheduling timeline for each task, identified in both approaches by its name.</p> <p>I am inclining to the second approach, but do not have enough arguments for it. Probably the only argument is that the first approach means higher static coupling of subsystems.</p> <p>Am I right, is the second approach better? What are arguments for any of these approaches?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload