XML interface and Hardcoded?

I am working on a flexible graphical interface that can have ~ 12 different layouts. These layouts are all clearly defined and will not change. Each layout consists of several widgets that interact with DLLs using bit patterns. Although most widgets are the same, the bit patterns used vary depending on the type of interface.

My gut instinct is to use inheritance: define a common “panel” and have subclasses for different configurations. However, there are parts of the interface that are user defined and specified in the XML file.

Should the entire panel be defined in XML or only user sections?

+5
source share
2 answers

YAGNI : Design your screens for current requirements that you specifically state are not going to change. If a line requires more tuning over the course of a year, make it more customizable, not now.

KISS . If using XML reduces the overall code and is easier than a subclass, use XML. If subclassing leads to less code, use a subclass. Experience tells me that subclasses are easier.

+10
source

I feel that you have to do something that will give you more flexibility to change your mind, add new features or customize the layout in the future.

+1
source

All Articles