<h2 id="Why-do-we-need-them-?">Why do we need them ?<a class="anchor-link" href="#Why-do-we-need-them-?">¶</a></h2><p><a href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">Design Patterns: Elements of Reusable Object-Oriented Software</a> by E. Gamma, R. Helm, R. Johnson and J. Vlissides (<strong>the gang of four</strong>)</p>
<ul>
<li>Designing object oriented code is hard</li>
<li>designing <strong>reusable</strong> object-oriented software <strong>is even harder</strong>!</li>
<h2 id="Design-patterns:-What-they-are">Design patterns: What they are<a class="anchor-link" href="#Design-patterns:-What-they-are">¶</a></h2><p>Design patterns have four essential elements:</p>
<ul>
<li><p><strong>Pattern name</strong>: associates problem with solutions&consequences <br>$\Rightarrow$ Improves communication and documentation</p>
</li>
<li><p><strong>Problem</strong>: Scenario/conditions of when to apply a pattern</p>
</li>
<li><p><strong>Solution</strong>: Description of the arrangement of classes and objects</p>
</li>
<li><p><strong>Consequences</strong>: Results and trade-offs. (allows to know design alternatives)</p>
<li>Apply/recognize these patterns for our particle's code</li>
<li>Description of these examples </li>
<li>a larger catalog of design patterns in <a href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">Design Patterns: Elements of Reusable Object-Oriented Software</a></li>
<span class="n">Singleton</span> <span class="o">&</span><span class="n">get</span><span class="p">()</span> <span class="p">{</span> <span class="c1">// not part of Singleton::</span>
<h2 id="Static-members-and-static-members-(C++)">Static members and static members (C++)<a class="anchor-link" href="#Static-members-and-static-members-(C++)">¶</a></h2><ul>
<li>static variable/member is a unique and permanent variable</li>
<h2 id="Static-members-and-static-members-(python)">Static members and static members (python)<a class="anchor-link" href="#Static-members-and-static-members-(python)">¶</a></h2><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">A</span><span class="p">:</span>
<span class="c1"># in the scope of the class</span>
<h1 id="Interactive-session-on-class-diagram">Interactive session on class diagram<a class="anchor-link" href="#Interactive-session-on-class-diagram">¶</a></h1><p><span style="font-size: 200%"><center> Generating the class diagram of the particle code. <br>Let's do that together ! </center></span></p>