title: Presenting fields in class diagram
body: <pre><code>class A
  {};
  
  class B
  {
      A a;
  };
  </code></pre>
  
  <p>When I want to present the above classes in class diagram I can do it like this:</p>
  
  <p><img src="https://i.stack.imgur.com/wD8A2.png" alt="enter image description here"></p>
  
  <p>Where I can present that class <code>B</code> has a field of class <code>A</code> either by marking it with a line ended with a rhombus (<strong><code>1</code></strong> in the picture) or by specifying class's field (<strong><code>2</code></strong> in the picture). However, using both seems redundant. When should I use the former, when the latter? Is there any case when I should use both?</p>
  
  <p>Edit: Actually  <strong><code>1</code></strong> could either be aggregation or composition. Although, the concrete line type isn't important to my question, IMO.</p>
  
  <p>Edit2: I've found a more or less real-life example of diagram where this situation occurs: <a href="http://en.wikipedia.org/wiki/Decorator_pattern#mediaviewer/File:Decorator_UML_class_diagram.svg" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Decorator_pattern#mediaviewer/File:Decorator_UML_class_diagram.svg</a> Class <code>Decorator</code> contains a field of type <code>Component</code>.</p>