-
Notifications
You must be signed in to change notification settings - Fork 38
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
Introduce service container #198
Projects
Comments
TODO:
|
Kittyfisto
added a commit
that referenced
this issue
Jun 24, 2019
Plugins don't break yet (will come in a future commit)
Kittyfisto
added a commit
that referenced
this issue
Jun 24, 2019
…ture dependencies #198 Every plugin interface has been changed to accept an IServiceContainer through which a plugin can resolve dependencies which it previously was given directly as a parameter. This way it is possible to NOT break binary backwards compatability with plugin and still inject more parameters into newer plugin which require them. As a result, the plugin interface version of every plugin interface has been increased and ALL existing plugins will no longer load due to this change: They will have to be updated (targeting the newest nuget package). Apart from pending refactorings of IDataSourceAnalyserPlugin and IDataSourceAnalyser (which are due BEFORE the next release), this commit represents the last breaking change made to the plugin system.
Kittyfisto
added a commit
that referenced
this issue
Jun 25, 2019
Kittyfisto
added a commit
that referenced
this issue
Jun 25, 2019
Fixed with Tailviewer v1.0.0-RC1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current behaviour
Currently, plugin interfaces such as
IFileFormatPlugin.Open(string fileName, ITaskScheduler taskScheduler)
are very rigid, yet are expected to call constructors of objects from Tailviewer.Core, such asTextLogFile(ITaskScheduler scheduler, string fileName, ITimestampParser timestampParser = null, ILogLineTranslator translator = null, Encoding encoding = null)
. This is all fine and dandy, however what happens if TextLogFile requires another dependency (for example a custom list of log levels, see #184)? Do we break plugin compatibility for every new dependency?Expected behaviour
Plugins should not break because tailviewer needs to forward more dependencies through a plugin to one its own classes. In other words, if a plugin wants to modify the log line translation aspect of a file, then it should not be expected to care about any other aspect of log files.
Concrete implementation
Introduce a service container interface such as:
and break plugin compability only once by changing the following method signatures:
This change will allow tailviewer to inject any future dependency into plugins without breaking backwards compatibility on plugins: Plugins will not need to be re-compiled in case tailviewer needs to pass yet another dependency to one of its classes (such as TextLogFile). The downside to this is obviously that if a plugin author requires a given dependency, then it will be harder to find out how to obtain it (since it's no longer part of the static singature).
Therefore this change requires better documentation on tailviewer's part.
Constraints
The text was updated successfully, but these errors were encountered: