I have a problem with my Software design. I want to generate UI controls from XML messages over the network. The XML messages contain simple information about a component and its properties for example:<? version=1.0 encoding=utf-8 ?><components>    <component name=Car>        <property name=length type=double value=4.1/>        <property name=numSeatbelts type=int value=5/>        ...        ...    </component>    ...    ...</components>The goal is to create UI elements dynamically that represent these properties and enable modification.The properties are loaded into instances of the Property class that resides in my backend:public class Property<T> {    String getName();    T getValue();    void setValue(T value);}The problem now is when I get a List of Properties for panel generation I have no information about the panel type.My current approach is:void generatePanels(List<Property> properties) {    for(Property property : properties) {        if(property.getValue() instanceof Double) {            add(new DoublePropertyPanel(property));        } else if(property.getValue() instanceof Integer) {            add(new IntegerPropertyPanel(property));        } else if(...) {            ...        }    }}Which I find really ugly. Is there a way to replace the type checking by a OOP pattern, while preserving layer separation (Properties should not know of the existence of the UI)?Here is a extremely simplified diagram of my program:
JavaFX generating UI controlls from backend classes
java;design patterns;architecture;layers