I'm working on a flexible GUI application that can have ~12 varied layouts. These layouts are all well-defined and won't change. Each layout consists of multiple widgets that interface with a DLL using bit patterns. While the majority of the widgets are the same, the bit patterns used vary depending on the interface type being presented.
My gut instinct is to use inheritance: define a generic 'Panel' and have subclasses for the different configurations. However, there are parts of the interface that are user-defined and are spec'd to be specified in an XML file.
Should the entire panel be defined in XML, or just the user configured sections?
YAGNI: Design your screens for the current requirements, which you specifically state aren't going to change. If a year down the line more customization is needed, make it more customizable then, not now.
KISS: If using XML results in less overall code and is simpler than subclassing, use XML. If subclassing results in less code, use subclassing. Experience tells me subclassing is simpler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With