title: How should the invisble objects of my code relate to their visible widget counterparts?
body: <p>When programming a GUI (usually with Python and PyQt4), I try to organise my code neatly and I often face the same question:</p>
  
  <p><strong>How should the invisible objects (data) of my code relate to their visible widget counterparts (graphic representation)?</strong></p>
  
  <p>For instance, suppose I have a list of entries from a linguistic dictionary. Each entry is an abstract data object with various attributes and functions. Each entry also is represented graphically as a widget the user can interact with.</p>
  
  <p>I believe there are four possible ways of organising them:</p>
  
  <ol>
  <li>the widget object is a child of the data object;</li>
  <li>the data object is a child of the widget object;</li>
  <li>the widget object and the data item are merged into one object (data are attributes of the widget);</li>
  <li>the widget object and the data object exist separately and the latter is fed into the former (e.g. as *args)</li>
  </ol>
  
  <p>Now I am not sure whether or not there is some conventional agreement regarding this and I am not certain either whether these possible arrangements really make a difference.</p>
  
  <p>What is the best practice?</p>