Architecture Q-GUI Specific Implementations Commonality #2043
-
I've been using OxyPlot.WindowsForms professionally for about 12 years. Recently, I'm interested in a personal project that would be cross platform; hence, I'm looking at OxyPlot.Avalonia. First, I'm not that terribly familiar with the dev process in the projects involved; so, I could easily be missing something. I've never looked into the class hierarchy and relationships between the separate GUI/Framework specific implementations before, but I'm a little confused why there isn't more derivation between the different implementations. As a simple example, PngExporter in the WindowsForms and Avalonia implementations are 90% identical, yet are not derived from a common base class for code re-use. Instead, each is completely separate. This seems to require improvements and bug-fixes be duplicated across each GUI/Framework implementation. I realize both implementations of PngExporter are derived from IExporter, but that only demands a common interface. It doesn't reduce duplicate code. Am I missing something? Be well, and thanks for everyone's hard work on a fabulous graphing/charting library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I suspect these sorts of discussions just haven't happened, because the history of the platform specific code-bases is so fragmented. Probably not very useful, but here's a rambly discussion anyway: Re.
Better consistency between exporters would be desirable, and I'm somewhat regretting removing the In general, the most duplication of actual logic is probably with the text layout code: #1556 is an old and ongoing (when I can find the time) effort to address (behavioural) inconsistencies between the providers. Otherwise, there isn't all that much I can see that could be reasonably pulled out of the WinForms implementation: basically every line of code is talking about some WinForms types, and is handling them in a way that e.g. isn't applicable to WPF. The XAML stuff is a maintenance nightmare (hence why it's no longer maintained), but other than that, there isn't all that much platform specific code, and it doesn't change a lot, so I suspect the added complexity of trying to share code wouldn't be helpful in the end; but I could well be missing some components that would be good candidates for such a treatment. |
Beta Was this translation helpful? Give feedback.
I suspect these sorts of discussions just haven't happened, because the history of the platform specific code-bases is so fragmented. Probably not very useful, but here's a rambly discussion anyway:
Re.
PndExporter
specifically, I don't think you're missing anything; I suspect this just hasn't really been considered. As I see it, there isn't all that much duplication of logic, because the types involved (i.e. bitmaps and render contexts) are all differentWidth
,Height
,Resolution
etc. into a super type would make sense