-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion for dependency injection #100
Comments
Hi there, There's basically two ways to design an API. One is the opinative way, where the API demands interfaces to be implemented and very specific calls for initialization and such. The other is focusing on doing only its job and messing as little as possible with the application design. The former is what we refer as 'framework' while the latter is what 'library' was supposed to be. I'm pointing FluentScheduler in the opposite direction of what you pictured. While frameworks aren't inherently bad in my book, I found libraries to be much more useful overall. I'm planning to simplify even further the API. As for the DI part, I think hooking up just an I'm closing the issue but feel free to comment further on it. |
What i think it boils down to, with or without an interface for JobManager is that the method intialize() or future versions of the framework doesn't auto start all jobs until start() has been called. e.g. when registering everything through a di container today it'd force the jobs to start running right away when initializing the registry. Thanks. |
Huh? |
Hi,
Thought about some minor feedback regarding DI, instead of doing this on the fly to a static JobManager.
JobManager.JobFactory = new StructureMapJobFactory();
JobManager.Initialize(new MyRegistry());
Couldn't the dependency injector handle how the JobManager is instanced and from a ctor one would then just have a param of IJobManager.
I've also got a suggestion for the .Start() and .Stop(), as of now it seems as Start() is actually triggered when you call Initialize(). I'd be good if start wasn't triggered in initialize when doing DI as there might be cases where you explicitly want to start it at a certain time other then when creating the instance.
An idea could be to add a "autoStart = true" default parameter for backward compatibility.
Hope any ideas could be of interest.
The text was updated successfully, but these errors were encountered: