Dependency injection for reporting user control(solved)
-
I am writing an application(C# winforms) that counts calories. One aspect the the application I would appreciate some ideas or suggestions on is the reporting aspect(a user control within the application). The reporting control has a graph and a selection of reports that one can run for selected dates or all of the data. What I am looking to do is to be able to have the report definitions sit outside of the application so that on startup the application fetches the available reports. This will allow me to distribute the application and reports separately - allowing me to release new reports in the future without releasing a new version of the application. The report definitions need to contain the logic for how the data is fetched as well as the definition of the chart. The class holding the data is serialised and loaded on startup and saved to at various points. So I am open to ideas and suggestions on what I could do. In essence I am looking for dependency injection with regards to the reporting user control. Thanks in advance for your ideas [Edit] Having thought this through a bit more, maybe linking to a DLL dynamically at runtime may be a solution clickety[^] - anyone have any experience of this and/or opinions on it? Solution [Edit number 2]I have decided to use a DLL and by making use of reflection query the DLL on the charts available. The DLL will be dynamically loaded at runtime. The sources of my decision were these two excellent codeproject articles: Article 1[^] Article 2[^] The only issue being that I cannot get generic lists of objects from the assembly due to using .Net 4 so I am using arraylists - heck there may even be a tip(article) in this.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens