title: Which is better using Record or Class as a value of TDictionary/TObjectDictionary in Delphi?
body: <p>I'm making my own data structure in Delphi.
  By the way, I'm faced with a problem that using between <code>record</code> and <code>class</code> as a value of dictionary.</p>
  
  <p>Here's my code.</p>
  
  <pre><code>TContinuousItem = Record
      Count: Integer;
      Order: Integer;
      ContractTime: String;
  end;
  
  ...
  
  var 
      FItems: TDictionary&lt;Integer, TContinuousItem&gt;;
  </code></pre>
  
  <p>Below is using class.</p>
  
  <pre><code>TContinuousItem = class(TObject)
  private
      FCount: Integer;
      FOrder: Integer;
      FContractTime: String;
  public
      property Count: String read FCount;
      property Order: String read FOrder;
      property ContractTime: String read FContractTime;
      constructor Create(const count, order: Integer; const contractTime: String);
  end;
  
  ...
  
  var 
      FItems: TObjectDictionary&lt;Integer, TContinuousITem&gt;;
  </code></pre>
  
  <p>Requirements:</p>
  
  <ul>
  <li>Need to sort by <code>order</code> value of <code>record</code>/<code>class</code></li>
  <li>Easy to use.</li>
  <li>Use less memory.</li>
  </ul>
  
  <p>Which way is better to use? And what is more correct?</p>