title: MessageFormat vs StringBuffer
body: <p>I see, that in Java you can build strings with </p>
  
  <ul>
  <li><code>MessageFormat</code> and a string like <code>"You said {0} just now"</code></li>
  <li><p><code>StringBuffer</code> and a construct like</p>
  
  <pre><code>StringBuffer mail = new StringBuffer("Dear ");
  mail.append(user.name);
  mail.append(",\nCongratulations!");
  ....
  </code></pre></li>
  <li><p>there may be other good options, string concatenation is not one of them</p></li>
  </ul>
  
  <p>So, which method should I use? My thoughts are: I have 5-6 standard texts where I have to replace some of the contents dynamically. I think it will be better to have the texts as constants somewhere (class with constants or properties file) and just make the quick replacement when I need it. Otherwise I will have strings in the middle of my source code that may be changed one day, like <code>StringBuffer("Dear ")</code>. </p>
  
  <p>Do I have an even better option?</p>