title: What is best way to update domain class object with large number of variables
body: <p>Suppose I have Employee domain class, I want to create object of domain class from params map coming from UI side. </p>
  
  <p>I can create object in two ways as follows</p>
  
  <ol>
  <li>Normal way</li>
  </ol>
  
  <blockquote>
    <p>Employee employee = new Employee(name: params.name, rollNo:
    params.rollNo)</p>
  </blockquote>
  
  <p>and so on. If domain class has 20 variables, then we need to write all variables in above constructor.</p>
  
  <ol start="2">
  <li>Following is best way to create object</li>
  </ol>
  
  <blockquote>
    <p>Employee employee = new Employee(params)</p>
  </blockquote>
  
  <p>Above constructor will populate object with matching params. Right.</p>
  
  <p>Now my question comes here.</p>
  
  <p>If suppose I have existing domain class object fetched from DB, Now I want to update this object from params map coming from UI.
  What is best way to do this (like we do in above second option).</p>