title: How can I prevent violating the open closed principle when using data from a database
body: <p>I am fetching json data from a database formatted in the following way</p>
  <pre><code>{
      name:{
          type:string,
          value:'test',
      },
      age:{
          type:number,
          value:6,
      },
      hairColor:{
          type:color,
          value:'255,255,255',
      },
      font:{
          type:fontFamily,
          value:'Arial',
      }
  }
  </code></pre>
  <p>So in my front-end I would have to check what the type is in some sort of switch statement in order to know what UI element I should render. This violates the open-closed principle becuase when I add a new type to my database I would have to go and modify the switch statement.</p>
  <p>How could I deal with this?</p>