<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Wisdom + Knowledge</title><subtitle type="html">Keep things as simple as possible but not simpler</subtitle><id>http://blogs.msdn.com/hulot/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/hulot/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-11-13T15:53:00Z</updated><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 2 - Parte 4</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/10/30/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-2-parte-4.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/10/30/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-2-parte-4.aspx</id><published>2008-10-30T19:19:11Z</published><updated>2008-10-30T19:19:11Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Nesta parte vamos ver como fazer para que IssueStates n&amp;#227;o sejam criados vazios, portanto sem nomes.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Laboratorio_2-Parte_4/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Neste caso vamos usar uma restri&amp;#231;&amp;#227;o r&amp;#237;gida, e no exemplo vamos extender uma classe parcial dando um override. Veja isto no c&amp;#243;digo abaixo&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling.Diagrams;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling.Validation;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Globalization;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Como requisito da nossa maquina de estado que representa os nossos &amp;quot;Issues&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #008000"&gt;// ela nao pode ter estados cuja a propriedade Name e' vazio&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; &lt;span style="color: #008000"&gt;// O metod abaixo verifica se nao estamos tentando criar uma classe ou estado &lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; &lt;span style="color: #008000"&gt;// cujo nome e' vazio, caso isto occora um erro deve ser gerado imediatamente&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Ou seja um hard Validation&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Microsoft.IssueStateModels&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Add a hard constraint to StateElement to prevent its &amp;quot;Name&amp;quot; property from being empty.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; StateElement&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// Value handler for the NamedElement.Name domain property.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;         &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; NamePropertyHandler : DomainPropertyValueHandler&amp;lt;StateElement, global::System.String&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnValueChanging(StateElement element, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; oldValue, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; newValue)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;             {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!element.Store.InUndoRedoOrRollback)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;                 {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;                     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(newValue))&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;                     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span style="color: #006080"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Name cannot be empty or null.&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;                     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;                 }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.OnValueChanging(element, oldValue, newValue);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;             }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9025067" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="Tecnologias" scheme="http://blogs.msdn.com/hulot/archive/tags/Tecnologias/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Application Lifecycle Management - VSTS2010</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/10/22/application-lifecycle-management-vsts2010.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/10/22/application-lifecycle-management-vsts2010.aspx</id><published>2008-10-22T19:30:52Z</published><updated>2008-10-22T19:30:52Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Acabei de fazer uma palestra sobre ALM ou Application Lifecycle Management e sobre a próxima versão do Visual Studio Team System.&lt;/p&gt; &lt;p&gt;Quem quiser baixar a apresentação por favro vá a &lt;iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-db1d3095f5632fdd.skydrive.live.com/embedrowdetail.aspx/Encontro%20de%20Arquitetos/Encontro%20de%20Arquitetos%20%2022-10-2008%20ALM.pdf" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;Mais da métade da apresentação foi gasto mostrando o conceito de ALM, seus principais pilares e quais problemas ele ajuda a resolver.&lt;/p&gt; &lt;p&gt;Durante a apresentação eu tentei mostrar o que o novo CTP do VSTS2010 irá fazer. Como são 21 "walkthroughs" (exercícios dirigidos) no correr da próximas semanas eu irei postando um a um para que vcs possam entender alguns das funcionalidades que eventualmente estarão disponíveis na próxima versão do VSTS.&lt;/p&gt; &lt;p&gt;Para aqueles que não quiserem esperar e querm ver algumas das novas funcionalidades do VSTS2010, seguem abaixo alguns links para os vídeos com demos:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Visual Studio Team System 2010 Channel 9 Videos&lt;/p&gt; &lt;p&gt;&lt;a href="http://channel9.msdn.com/posts/Dan/Norman-Guadagno-Announcing-Visual-Studio-Team-System-2010/"&gt;Announcing Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;&amp;nbsp; &lt;p&gt;Architecture  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Cameron-Skinner-Visual-Studio-Team-System-2010-Architecture/"&gt;Overview from Cameron Skinner&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Top-down-design-with-Visual-Studio-Team-System-2010/"&gt;"Top-down design"&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Bottom-up-Design-with-Visual-Studio-Team-System-2010-Architect/"&gt;"Bottom-up design"&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/shows/ARCast.TV/ARCastTV-Peter-Provost-on-whats-coming-for-Architects-in-Visual-Studio-Team-System/"&gt;ARCast.TV - Peter Provost on what’s coming for Architects in Visual Studio Team System&lt;/a&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Business Alignment  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Achieving-Business-Alignment-with-Visual-Studio-Team-System-2010/"&gt;Achieving Business Alignment with Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Agile-Planning-Templates-in-Visual-Studio-Team-System-2010/"&gt;Agile Planning Templates in Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Enterprise-Project-Management-with-Visual-Studio-Team-System-2010/"&gt;Enterprise Project Management with Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Requirements-Management-and-Traceability-with-Visual-Studio-Team-System-2010/"&gt;Requirements Management and Traceability with Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;&amp;nbsp; &lt;p&gt;Software Quality  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Better-Software-Quality-with-Visual-Studio-Team-System-2010/"&gt;Better Software Quality with Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Manual-Testing-with-Visual-Studio-Team-System-2010/"&gt;Manual Testing with Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Historical-Debugger-and-Test-Impact-Analysis-in-Visual-Studio-Team-System-2010/"&gt;Historical Debugger and Test Impact Analysis in Visual Studio Team System 2010&lt;/a&gt;  &lt;p&gt;&amp;nbsp; &lt;p&gt;Team Foundation Server  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Brian-Harry-Team-Foundation-Server-2010/"&gt;Brian Harry: Team Foundation Server 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Branching-and-Merging-Visualization-with-Team-Foundation-Server-2010/"&gt;Branching and Merging Visualization with Team Foundation Server 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Enterprise-Team-Foundation-Server-Management-with-Mario-Rodriguez/"&gt;Enterprise Team Foundation Server Management with Mario Rodriguez&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Team-Foundation-Server-2010-Setup-and-Administration/"&gt;Team Foundation Server 2010 Setup and Administration&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/An-early-look-at-Team-Foundation-Build-2010-with-Jim-Lamb/"&gt;An early look at Team Foundation Build 2010 with Jim Lamb&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/A-first-look-at-Visual-Studio-Team-System-Web-Access-2010/"&gt;A first look at Visual Studio Team System Web Access 2010&lt;/a&gt;  &lt;p&gt;· &lt;a href="http://channel9.msdn.com/posts/VisualStudio/Update-on-Team-Foundation-Server-Migration-and-Synchronization/"&gt;Update on Team Foundation Server Migration and Synchronization&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9011571" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 2 - Parte 3</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/09/24/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-2-parte-2.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/09/24/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-2-parte-2.aspx</id><published>2008-09-24T03:20:16Z</published><updated>2008-09-24T03:20:16Z</updated><content type="html">&lt;p&gt;&amp;#160; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d12a3c16-d8dc-4ebb-813f-1d6f6ca11d4b" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Nesta demo vamos tratar a restri&amp;#231;&amp;#227;o relativa a &amp;quot;StartElements&amp;quot; que n&amp;#227;o podem ter mais do que um &amp;#233; desconectados. Na figura abaixo mostramos exemplos de tal situa&amp;#231;&amp;#227;o;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13C8D/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="406" alt="image" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13C8D/image_thumb.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13C8D/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="409" alt="image" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13C8D/image_thumb_1.png" width="510" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;O v&amp;#237;deo a seguir mostra como fazer isto.&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Laborat%c3%b3rio%202%20-%20Parte%203/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;Abaixo o c&amp;#243;digo que implementa esta valida&amp;#231;&amp;#227;o&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 66.8%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; height: 286px; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling.Diagrams;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling.Validation;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Globalization;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Como requisito da nossa maquina de estado que representa os nossos &amp;quot;Issues&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #008000"&gt;// ela nao pode ter myultiplos pontos de entrada ou seja start elements&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; &lt;span style="color: #008000"&gt;// assumimos como premissa que apenas um ponto de entrada seria possivel&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Logo o metodo abaixo impede que um novo ponto de incio seja introduzido no modelo&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Caso haja uma tentativa de inserir um outro ponto de inicion do desenho um erro sea&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &lt;span style="color: #008000"&gt;// gerado imediatamente, impedindo que hajam 2 ponto de incio do diagram de estado.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Ou seja um hard constraint&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Microsoft.IssueStateModels&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;     [RuleOn(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(StartElement), FireTime = TimeToFire.TopLevelCommit, InitiallyDisabled = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; UniqueStartElementAddRule : AddRule&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ElementAdded(ElementAddedEventArgs e)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message = &lt;span style="color: #006080"&gt;&amp;quot;Impossible to have 2 StartElements state&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;             StartElement g = e.ModelElement &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; StartElement;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; name = g.Name;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (name == &lt;span style="color: #006080"&gt;&amp;quot;StartElement2&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;             {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; InvalidOperationException(message);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;             }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.ElementAdded(e);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// Domain model class allows extra reflective elements such as rules to be added&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;     &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; IssueStateModelsDomainModel&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; Type[] GetCustomDomainModelTypes ()&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  44:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  45:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.Type[] { &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(UniqueStartElementAddRule) };&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  46:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  47:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  48:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  49:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;E o resultado da sua implementa&amp;#231;&amp;#227;o e implanta&amp;#231;&amp;#227;o na nossa DSL&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13C8D/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="410" alt="image" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13C8D/image_thumb_2.png" width="511" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8914891" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="Tecnologias" scheme="http://blogs.msdn.com/hulot/archive/tags/Tecnologias/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Computação de Alto Desempenho (HPC) e Paralelismo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/09/02/computa-o-de-alto-desempenho-hpc-e-paralelismo.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/09/02/computa-o-de-alto-desempenho-hpc-e-paralelismo.aspx</id><published>2008-09-03T01:19:43Z</published><updated>2008-09-03T01:19:43Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Vamos mudar um pouco de assunto, faz muito tempo que eu só falo de DSL. Vamos falar de HPC e Paralelismo em Aplicações.&lt;/p&gt; &lt;p&gt;Fazem algumas semanas (18 de Junho), nós tivemos um "Encontro de Arquitetos" aonde o Gebara falou sobre Virtualização e eu falei sobre o tema acima (HPC - High Performance Computing). Parte destes slides foram os mesmo usados num webcast que fiz recentemente sobre o mesmo título em 13 de Agosto de 2008.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Na chamada dos trabalhos tinhamos como descrição de cada uma dos temas&lt;/p&gt; &lt;p&gt;&lt;b&gt;14h30 – 16h00: Virtualização&lt;/b&gt;  &lt;p&gt;&lt;b&gt;Virtualização é, hoje em dia, um dos temas mais discutidos em tecnologia da informação. Desde a questão de consolidação e otimização de recursos até a nova onda de “Green IT”, o tema virtualização tem se mantido em destaque. Nesta palestra abordaremos as tecnologias de virtualização da plataforma Microsoft (estação, servidores, aplicações e apresentação). Estabelecer as razões para as quais a virtualização é desejada auxiIia no processo de tomada de decisão sobre qual tecnologia pode ou deve ser utilizada.&lt;/b&gt;  &lt;p&gt;&lt;b&gt;Palestrante: Fernando Gebara&lt;/b&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt; &lt;p&gt;&lt;b&gt;16h00-16h30: Coffee-break&lt;/b&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt; &lt;p&gt;&lt;b&gt;16h30-18h00: HPC&lt;/b&gt;  &lt;p&gt;&lt;b&gt;HPC foi tema de grandes discussões em tecnologia na decado de 80 quando os processadores estavam próximos do seu limite relativo ao processo de fabricação. Na epóca alguns autores e especialistas da área profetizavam que a atual tecnologia não iria durar até o final do século passado ou inicio deste. A evidência de que isto está ocrrendo vem de números da Intel: para um aumento de 20% de clock fornece um aumento de apenas 13% em desempenho mas com um aumento de 73% em consumo de energia.&amp;nbsp; Ao que tudo indica o caminho do multicore é uma realidade, hoje temos processadores com 4 cores e em breve teremos processadores com até 80 processadores numa única pastilha. Nem todos os problemas podem ser resolvidos via virtualização, alguns problemas necessitam fazer uso destes "cores" de forma otimizada ou em paralelo, é aqui que a computação de alto desempenho (HPC) entra. O objetivo desta palestra é resgatar alguns deste princípios e demonstrar o que tem sido feito nos últimos anos para possibilitar o uso desta alta capacidade de processamento para resolver problemas cada vez mais complexos em todos os ramos de atividades e por que o caminho do HPC é inevitável. &lt;/b&gt; &lt;p&gt;&lt;b&gt;Palestrante: Carlos Hulot&lt;/b&gt;  &lt;p&gt;Se alguém quiser saber mais sobre o tema de virtualização recomendo visitar o blog do Gebara. &lt;/p&gt; &lt;p&gt;Neste "post"vou comentar e deixar disponível para download os slides e links que utilizei na palestra.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Meu enfoque para a discussão de alto desempenho foi tentar mostrar porque HPC e Parelelismo podem ser uma das próximas ondas de TI para um futuro não muitos distante.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Quem quiser ter acesso aos slides da minha apresentação eles estão disponíveis no SkyDrive no Live em &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-db1d3095f5632fdd.skydrive.live.com/embedrowdetail.aspx/Encontro%20de%20Arquitetos" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-db1d3095f5632fdd.skydrive.live.com/embedrowdetail.aspx/Webcast%20de%20Arquitetura" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Eu sintetizo abaixo o que eu abordei e coloco os links para as referencias que fiz durante esta palestra.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Começei perguntando para a audiência (e por incrível que parece tinha mais gente do que eu esperava, sendo este um assunto muito específico e árido) quem acredita que a próxima onde será a de HPC e parelelismo. Muita pouco gente se manifestou de forma a concordar com está minha afirmação-questão, mas era o que eu esperava....&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Na sequencia eu fiz uma pequena restrospectiva do que aconteceu no final dos anos 80 início dos 90 quando se imagina que a tecnologia para a fabricação de processadores tinha chegado ou estava próxima de chegar ao seu limite devido as limitações no processo fabril de fotolitografia que é uma das etapas no processo de fabricação dos chips e que sem um melhoria não permitiria criar processadores menores e mais poderosos (mais detalhes sobre o processo de fabricação podem ser visto em &lt;a title="Learn how a microprocessor is made" href="http://www.intel.com/pressroom/archive/backgrnd/making_a_chip.htm?iid=tech_man+made"&gt;Learn how a microprocessor is made&lt;/a&gt; e quem quiser saber como é uma fábrica de semicondutores veja em &lt;a title="Get interactive inside the chip factory" href="http://www.oregonlive.com/news/oregonian/multimedia/wide.ssf?chip"&gt;Get interactive inside the chip factory&lt;/a&gt;)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Em seguida eu mostrei algumas das evidências econômicas que me leva a crer que desta fez o HPC/Paralelismo estão aqui para ficar.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Achei também importante relembrar alguns conceitos básicos de processamento paralelo e sistemas distribuídos tais como:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;A Lei Amdahl que limita o speed-up, ou seja em outras palavras mesmo colocando mais processadores para cada problema tem uma hora que não resolve mais nada ou seja não há ganho em desempenho (assim sendo o processamento paralelo ou distribuído também tem suas limitações).  &lt;li&gt;A taxonomia Flynn muito utilizado nos anos 90 para descrever as arquiteturas dos sistemas paralelos/distribuídos.  &lt;li&gt;Ligado a Lei de Amdahl está o problema da "granularidade" de um problema  &lt;li&gt;Paralelismo Funcional e de Dados  &lt;li&gt;Memória Compartilhada e Distribuída  &lt;li&gt;Técnicas de Modelagem do problema ou decomposição do domínio (do problema) que é muito importante para se encontrar a melhor solução para paralelizar um problema  &lt;li&gt;A diferença entre Grids e Clusters&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Estes temas podem ser fácilmente encontrados na internet buscando pelas palavras chaves dado que são temas acadêmicos de cursos de arquiteturas paralelas e sistemas distribuídos.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Em seguida eu explique por que as empresas de semicondutores entreram nesta de colocar mais de um "core" numa pastilha e cujo o racional estava na chamada, ou seja "um aumento de 20% de clock fornece um aumento de apenas 13% em desempenho mas com um aumento de 73% em consumo de energia" que como podemos ver não é uma relação das mais eficientes, veja também em &lt;a href="http://www.asyncop.com"&gt;www.asyncop.com&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;E para demonstrar que as empresas de semicondutores estão seriamente envolvidas neste conceito de multicore eu mostrei o caso da Intel que já tem um protótipo que coloca 80 cores num único "chip". Os detalhes e o filme podem ser visto em &lt;a title="Discover how" href="http://techresearch.intel.com/articles/Tera-Scale/1421.htm"&gt;Discover how&lt;/a&gt;, &lt;a title="Tera-scale computing research vision" href="http://techresearch.intel.com/articles/Tera-Scale/1421.htm#Vision"&gt;Tera-scale computing research vision&lt;/a&gt;, e &lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:305fa9ab-bd45-4422-bc10-d5d6a48307c6" class="wlWriterSmartContent"&gt;&lt;div id="384175b7-28ee-4f62-b5a0-66fc1ba5c0a9" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://youtube.com/watch?v=DkFlwKSzHms" target="_new"&gt;&lt;img src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ComputaodeAltoDesempenhoeParalelismo_10E2A/video888a06e3f7b3.jpg" galleryimg="no" onload="var downlevelDiv = document.getElementById('384175b7-28ee-4f62-b5a0-66fc1ba5c0a9'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/DkFlwKSzHms\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;param name=\&amp;quot;wmode\&amp;quot; value=\&amp;quot;transparent\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/DkFlwKSzHms\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; wmode=\&amp;quot;transparent\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Mostrado o que o universo do hardware anda preparando tinha que mostrar o que o universo do software anda fazendo. E em se tratando de MS o objetio era mostar o que estamos fazendo para lidar com este no cenário de hardware.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;u&gt;&lt;strong&gt;Cenário Scale-Up (Multi-Core)&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;O primeiro passo é fazer uma distinção entre plataformas distribuídas e platformas multicore, ou seja scale-down e scale-up respecitvamente. E que no caso da Microsoft se resumem Windows HPC e extensões parelelas para o .Net Framework que virão inclusas na versão 4.0 do .Net.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Começei pelos cenários de scale-up (multicore) por acreditar serem de mais fácil "digestão". Aqui eu recomendo&amp;nbsp; baixar o CTP do novo &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=348F73FD-593D-4B3C-B055-694C50D2B0F3&amp;amp;displaylang=en"&gt;Microsoft Parallel Extensions to .NET Framework 3.5, June 2008 Community Technology Preview&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;E "brincar"um pouco com as novas "extensões paralelas do .NET" que virão na versão 4.0. Elas estão refletidas em 3 grandes grupos, a saber, PLINQ (Parallel Linq), CDS (Concurrent Data Structures) e TPL (Task Parallel Library). Para quem quiser conhecer mais recomendo visitar links como:&lt;/p&gt; &lt;p&gt;&lt;a title="Parallel LINQ" href="mms://wm.microsoft.com/ms/uk/msdn/nuggets/PFX_PLINQ_Moth.wmv"&gt;Parallel LINQ&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a title="Parallel Extensions Samples Tour" href="mms://wm.microsoft.com/ms/uk/msdn/nuggets/PFX_TourOfSamples_Moth.wmv"&gt;Parallel Extensions Samples Tour&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a title="Understanding the Parallel Class" href="mms://wm.microsoft.com/ms/uk/msdn/nuggets/PFX_ParallelClass_Moth.wmv"&gt;Understanding the Parallel Class&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Ou visitar a página da MS sobre o tema de &lt;a href="http://msdn.microsoft.com/en-us/concurrency/default.aspx"&gt;Processamanto Parelelo&lt;/a&gt;&lt;/p&gt; &lt;p&gt;O objetivo das "extensões paralelas do .Net" é facilitar a vida do desenvolvedor. uma vez que hoje existem outras técnicas mais complexas que são hoje usadas para o desenvolvimento de aplicações concorrentes.Entre estas temos &lt;/p&gt; &lt;ul&gt; &lt;li&gt;CCR - Concurrency and Coordination Runtime parte do Microsoft Robotics Studio  &lt;ul&gt; &lt;li&gt;Trata de programação assincrona visto que robos são um conjunto de eventos assincronos. Ele lida com os 3 principais problemas em robótica:  &lt;ul&gt; &lt;li&gt;1. Assincronicidade  &lt;li&gt;2. Concorrencia  &lt;li&gt;3. Coordenação e Suporte/Tolerância a falhas&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;Mais detalhes em podem ser encontrados em &lt;a title="CCR User Guide" href="http://msdn.microsoft.com/en-us/library/bb905447.aspx"&gt;CCR User Guide&lt;/a&gt; e em &lt;a title="CCR Programming - Jeffrey Richter and George Chrysanthakopoulos" href="http://channel9.msdn.com/shows/Going+Deep/CCR-Programming-Jeffrey-Richter-and-George-Chrysanthakopoulos/"&gt;CCR Programming - Jeffrey Richter and George Chrysanthakopoulos&lt;/a&gt; e &lt;a title="Concurrency and Coordination Runtime" href="http://channel9.msdn.com/shows/Going+Deep/Concurrency-and-Coordination-Runtime/"&gt;Concurrency and Coordination Runtime&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt;Threadpools - Recurso que permite um programa C# realizar processamento concorrente.  &lt;p&gt;Multithreading pode resolver o problema de multi-tarefas e resposta de um sistema, ao permitir separar “processos” ou “tarefas” para trabalharem de forma independente e assincrona, mas ao mesmo tempo introduz outras complexidades tais como o compartilhamento de recursos (exemplo dos filosofos)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;Mais detalhes em &lt;a title="Threading (C# Programming Guide)" href="http://msdn.microsoft.com/en-us/library/ms173178(VS.80).aspx"&gt;Threading (C# Programming Guide)&lt;/a&gt; e &lt;a title="How to- Use a Thread Pool" href="http://msdn.microsoft.com/en-us/library/3dasc8as(VS.80).aspx"&gt;How to- Use a Thread Pool&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;ul&gt; &lt;li&gt;Assynchronous Programming Model - que são dois patterns para ajudar na criação de operações assincronas. mais detalhes em &lt;a title="Asynchronous Programming Design Patterns" href="http://msdn.microsoft.com/en-us/library/ms228969.aspx"&gt;Asynchronous Programming Design Patterns&lt;/a&gt; e &lt;a title="Asynchronous Programming Overview" href="http://msdn.microsoft.com/en-us/library/ms228963.aspx"&gt;Asynchronous Programming Overview&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;u&gt;&lt;strong&gt;Parallel LINQ (PLINQ)&lt;/strong&gt;&lt;/u&gt;&amp;nbsp; &lt;p&gt;&amp;nbsp; &lt;p&gt;A primeira extensão paralela do .NET é o Parallel LINQ ou PLINQ que é uma implementação paralela do LINQ-to-objects que usa paralelismo de dados. POr exemplo tomemos a seguinte exemplo que está contido no CTP (LINQRayTracer)  &lt;p&gt;&amp;nbsp; &lt;p&gt;Evidentemente não é minha intenção explicar o algoritmo de "ray-tracing" - a não ser que alguém me peça :) - mas é algo como uma forma simples de simular os raios de luz que emanam de uma fonte luminosa. A idéia é simular o comportamento de cada raio ou feixe de luz e sua intereção com os objetos a sua volta. Portanto envolve Física (teoria da luz) e logo um conjunto de equações que demandam muitos calculos. Para visualizar o que estamos falando, recomendo olhar no arquivo LINQRayTracer.cs aonde temos  &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt; &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RenderParallel(Scene scene)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;[] rgb = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;[screenWidth * screenHeight];&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     var pixelsQuery =&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         from y &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; Enumerable.Range(0, screenHeight).AsParallel()&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         let recenterY = -(y - (screenHeight / 2.0)) / (2.0 * screenHeight)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         select from x &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; Enumerable.Range(0, screenWidth)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;                let recenterX = (x - (screenWidth / 2.0)) / (2.0 * screenWidth)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;                let point =&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;                    Vector.Norm(Vector.Plus(scene.Camera.Forward,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;                                            Vector.Plus(Vector.Times(recenterX, scene.Camera.Right),&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;                                                        Vector.Times(recenterY, scene.Camera.Up))))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;                let ray = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Ray() { Start = scene.Camera.Pos, Dir = point }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;                let computeTraceRay = (Func&amp;lt;Func&amp;lt;TraceRayArgs, Color&amp;gt;, Func&amp;lt;TraceRayArgs, Color&amp;gt;&amp;gt;)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;                 (f =&amp;gt; traceRayArgs =&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;                  (from isect &lt;span style="color: #0000ff"&gt;in&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;                       from thing &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; traceRayArgs.Scene.Things&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt;                       select thing.Intersect(traceRayArgs.Ray)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;                   &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; isect != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;                   orderby isect.Dist&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;                   let d = isect.Ray.Dir&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;                   let pos = Vector.Plus(Vector.Times(isect.Dist, isect.Ray.Dir), isect.Ray.Start)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;                   let normal = isect.Thing.Normal(pos)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;                   let reflectDir = Vector.Minus(d, Vector.Times(2 * Vector.Dot(normal, d), normal))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;                   let naturalColors =&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;                       from light &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; traceRayArgs.Scene.Lights&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;                       let ldis = Vector.Minus(light.Pos, pos)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;                       let livec = Vector.Norm(ldis)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;                       let testRay = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Ray() { Start = pos, Dir = livec }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;                       let testIsects = from inter &lt;span style="color: #0000ff"&gt;in&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;                                            from thing &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; traceRayArgs.Scene.Things&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;                                            select thing.Intersect(testRay)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;                                        &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; inter != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;                                        orderby inter.Dist&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;                                        select inter&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;                       let testIsect = testIsects.FirstOrDefault()&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;                       let neatIsect = testIsect == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; ? 0 : testIsect.Dist&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;                       let isInShadow = !((neatIsect &amp;gt; Vector.Mag(ldis)) || (neatIsect == 0))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;                       &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; !isInShadow&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;                       let illum = Vector.Dot(livec, normal)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;                       let lcolor = illum &amp;gt; 0 ? Color.Times(illum, light.Color) : Color.Make(0, 0, 0)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt;                       let specular = Vector.Dot(livec, Vector.Norm(reflectDir))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  44:&lt;/span&gt;                       let scolor = specular &amp;gt; 0&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  45:&lt;/span&gt;                                      ? Color.Times(Math.Pow(specular, isect.Thing.Surface.Roughness),&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  46:&lt;/span&gt;                                                    light.Color)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  47:&lt;/span&gt;                                      : Color.Make(0, 0, 0)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  48:&lt;/span&gt;                       select Color.Plus(Color.Times(isect.Thing.Surface.Diffuse(pos), lcolor),&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  49:&lt;/span&gt;                                         Color.Times(isect.Thing.Surface.Specular(pos), scolor))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  50:&lt;/span&gt;                   let reflectPos = Vector.Plus(pos, Vector.Times(.001, reflectDir))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  51:&lt;/span&gt;                   let reflectColor = traceRayArgs.Depth &amp;gt;= MaxDepth&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  52:&lt;/span&gt;                                       ? Color.Make(.5, .5, .5)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  53:&lt;/span&gt;                                       : Color.Times(isect.Thing.Surface.Reflect(reflectPos),&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  54:&lt;/span&gt;                                                     f(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TraceRayArgs(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Ray()&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  55:&lt;/span&gt;                                                     {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  56:&lt;/span&gt;                                                         Start = reflectPos,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  57:&lt;/span&gt;                                                         Dir = reflectDir&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  58:&lt;/span&gt;                                                     },&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  59:&lt;/span&gt;                                                                        traceRayArgs.Scene,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  60:&lt;/span&gt;                                                                        traceRayArgs.Depth + 1)))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  61:&lt;/span&gt;                   select naturalColors.Aggregate(reflectColor,&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  62:&lt;/span&gt;                                                  (color, natColor) =&amp;gt; Color.Plus(color, natColor))&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  63:&lt;/span&gt;                  ).DefaultIfEmpty(Color.Background).First())&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  64:&lt;/span&gt;                let traceRay = Y(computeTraceRay)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  65:&lt;/span&gt;                select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { X = x, Y = y, Color = traceRay(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TraceRayArgs(ray, scene, 0)) };&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  66:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  67:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; rowsProcessed = 0;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  68:&lt;/span&gt;     pixelsQuery.ForAll(row =&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  69:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  70:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var pixel &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; row)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  71:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  72:&lt;/span&gt;             rgb[pixel.X + (pixel.Y * screenWidth)] = pixel.Color.ToInt32();&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  73:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  74:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; processed = Interlocked.Increment(&lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; rowsProcessed);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  75:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (processed % rowsPerUpdate == 0 ||&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  76:&lt;/span&gt;             processed &amp;gt;= screenHeight) updateImageHandler(rgb);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  77:&lt;/span&gt;     });&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  78:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Esta demo possivilmente só vai mostrar resultado positivos se o seu computador tiver mais de 1 "core". No caso do meu notebook ele possuí dois cores. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/LINQ%20RayTracer%20Demo/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Execute primeiro sequencialmente e depois em paralelo e veja como os cores são utilizados em ambos os casos. Para isto use Windows Task Manager (ctrl-alt-del) e selecione a aba Performance e dê um duplo click em CPU Usage.&lt;/p&gt;
&lt;p&gt;No meu notebook os resultado foram algo como uma melhora de aproximadamente 10 a 30%. Existe grande variação pois tive de usar um software de gravação que intervere com o resultado final.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;strong&gt;Task Parallel Library&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;O segundo exemplo é o mesmo problema de ray-tracing só que agora usando o segundo recurso da extensão paralela do .NET que é o TPL (Task Parallel Library). TPL é implementado em um bilbioteca e&amp;nbsp; não depende da extensão da linguagem.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RenderParallel(Scene scene, Int32[] rgb)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     Parallel.For(0, screenHeight, y =&amp;gt;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; stride = y * screenWidth;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         Camera camera = scene.Camera;&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; x = 0; x &amp;lt; screenWidth; x++)&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;             Color color = TraceRay(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Ray(camera.Pos, GetPoint(x, y, camera)), scene, 0);&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;             rgb[x + stride] = color.ToInt32();&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     });&lt;/pre&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Como no caso anterior esta demo só tirará vantagem se o seu computador possuir uma CPU com mais de um core. Se observarem, no caso do processamento sequencial os cores da CPU nunca (ou quase nunca) chegam a 100%. Entetanto quando selecionamos o processamento paralelo (via TPL) os cores são usados a 100%. Acima quando eu mencionei "ou quase nunca" é por que, como no caso anterior, o software usado para gravar interfere com o resultado uma vez que ele consome bastante CPU.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/TPL%20RayTracing%20Demo/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Concurrent Data Structures&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Neste CTP ainda não temos nenhum material ou bits sobre o CDS. Assim que ele seja incluido eu volto a blogar sobre que estas estruturas de dados paralelos tais como: &lt;/p&gt;
&lt;p&gt;Coleções thread-safe (p.e. ConcurrentDictionary&amp;lt;K,V&amp;gt;, ConcurrentQueue&amp;lt;T&amp;gt;, ConcurrentStack&amp;lt;T&amp;gt;,etc. )&lt;/p&gt;
&lt;p&gt;Troca (p.e. BlockingCollection&amp;lt;T&amp;gt;, SynchronousQueue&amp;lt;T&amp;gt;, etc.)&lt;/p&gt;
&lt;p&gt;e outros, podem fazer.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Velocity&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Como existe uma outra iniciativa para trazer desempenho para aplicações achei importante durante o Encontro de Arquitetos falar sobre o &lt;a title="Microsoft Project Code Named &amp;ldquo;Velocity&amp;rdquo; Community Technology Preview 1 (CTP1)" href="http://www.microsoft.com/downloads/info.aspx?na=47&amp;amp;p=4&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=348f73fd-593d-4b3c-b055-694c50d2b0f3&amp;amp;u=details.aspx%3ffamilyid%3dB24C3708-EEFF-4055-A867-19B5851E7CD2%26displaylang%3den"&gt;Microsoft Project Code Named “Velocity” Community Technology Preview 1 (CTP1)&lt;/a&gt;. Esta é um tecnologia que permite "fundir" caches de várias aplicações em um cache único, é como um cache compartilhado. Ou seja você pode agora criar um cache virtual "gigante" que atende a várias aplicações. Como os caches são estruturas intermediárias para armazenagem de dados que devem estar muito próximos da aplicação por questões de desempenho, esta iniciativa permite trazer melhorias a aplicações que precisam de muitos dados e não querem fazer acesso a memória ou discos em outro lugar, logo as informações podem ser mantidas no cache. Embora esta seja uma forma de trazer desempenho a estas aplicações e o cache tenha a "cara" de uma grande memória compartilhada, este não é um problema ou solução de computação de alto desempenho (HPC) ou paralela. De qualquer forma achei importante mencionar e mais detalhes podem ser vistos no link acima.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Cenários Scale-Out (HPC)&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Por fim acabei mostrando os cenários de scale-out que significam problemas que requerem soluções em plataformas do tipo cluster ou grids. Para isto eu falei da solucão Windows High Performance Computer Server (WHPCS) que nada mais é do que uma evolução do Windows Computer Cluster Server (WCCS).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Neste caso importante modificações foram introduzidas e melhoradas no Job Scheduler do WHPCS. Novas ferramentas internas e de terceiros foram incorporadas ou agregadas a solução. Além disto o WCF (Windows Communication Foundation) foi utilizado para permitir a criação de "brokers" (mediadores/negociadores). Com estes brokers é possível uma aplicação paralela negociar com o broker um aumento da quantidade de nós de processamento necessários.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Uma descrição para completa pode ser encontrada em &lt;a target="_blank" href="http://windowshpc.net/"&gt;Windows HPC&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8921069" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 2 - Parte 1</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/08/23/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-2-parte-1.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/08/23/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-2-parte-1.aspx</id><published>2008-08-23T20:09:14Z</published><updated>2008-08-23T20:09:14Z</updated><content type="html">&lt;p&gt;   &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f00731de-bb82-4160-af0a-e46fecff35f0" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Desculpem a demora em atualizar e dar continuidade a esta s&amp;#233;rie de videos-demo do DSL. Estava em f&amp;#233;rias, e f&amp;#233;rias quer dizer sem computador :) . Vamos ent&amp;#227;o retomar a nosso exemplo de DSL. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;No &amp;#250;ltimo &amp;quot;post&amp;quot; terminou-se a constru&amp;#231;&amp;#227;o b&amp;#225;sica da DSL que representa a m&amp;#225;quina de estados, criamos o toolbox. Ou seja, algo muito parecido com a figura apresentada no Laborat&amp;#243;rio 1 - Parte 3 e nas Figuras 1 e 2 do Laborat&amp;#243;rio 1 - Parte 2;&amp;#160; Entretanto esta DSL&amp;#160; na forma em que ela se encontra ainda possue uma s&amp;#233;rie de limita&amp;#231;&amp;#245;es que requer&amp;#227;o um comportamento exemplar de quem quer que venha us&amp;#225;-la. Na pr&amp;#225;tica isto n&amp;#227;o ocorre, em geral as pessoas tendem a n&amp;#227;o seguir comportamentos exemplares, existindo sim comportamentos que cobrem os dois extremos. Ou seja pessoas relapsas que construir&amp;#227;o diagramas imposs&amp;#237;veis e pessoas cuidadosas mas curiosas que por fim conseguiram tamb&amp;#233;m gerar diagramas imposs&amp;#237;veis. Desta forma temos de complementar a DSL at&amp;#233; aqui apresentada para que possamos lidar com estas possibilidades e previnir que os usu&amp;#225;rios da DSL gerem representa&amp;#231;&amp;#245;es sem sentido. Para tornar mais claro tomemos por exemplo o caso do elemento inicial. No problema proposto desde o in&amp;#237;cio, &amp;#233; de que somente deveria se ter uma &amp;#250;nica condi&amp;#231;&amp;#227;o inicial, e este n&amp;#227;o &amp;#233; o caso. Experimente a DSL recem criada, e veremos que &amp;#233; poss&amp;#237;vel de se colocar mais de um estado inicial. E ainda pior, &amp;#233; poss&amp;#237;vel ter condi&amp;#231;&amp;#245;es iniciais que n&amp;#227;o se conectam a nada. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#201; neste ponto que vamos apresentar o que Restri&amp;#231;&amp;#245;es e Valida&amp;#231;&amp;#245;es que ir&amp;#225; nos ajudar a evitar erros e limitar a possibilidade de serem criadas constru&amp;#231;&amp;#245;es &amp;quot;imposs&amp;#237;veis&amp;quot; com a DSL. De uma forma geral o tema relativos a erros de &amp;quot;linguagem&amp;quot; encerra uma discuss&amp;#227;o que vai al&amp;#233;m do escopo destes laborat&amp;#243;rio. Recomendo aos interessado a recorrem ao cap&amp;#237;tulo 7 do livro texto &lt;a href="http://www.amazon.com/Domain-Specific-Development-Visual-Studio-Microsoft/dp/0321398203/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1205073817&amp;amp;sr=1-1"&gt;Domain-Specific Development with Visual Studio DSL Tools&lt;/a&gt; aonde uma discuss&amp;#227;o mais aprofundada &amp;#233; apresentada.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Esta Laborat&amp;#243;rio 2 esta relacionado portanto as regras de valida&amp;#231;&amp;#227;o e restri&amp;#231;&amp;#245;es que v&amp;#227;o auxiliar no aprimoramento e &amp;quot;ajuste fino&amp;quot; da linguagem criada. Existem como veremos restri&amp;#231;&amp;#245;es e valida&amp;#231;&amp;#245;es r&amp;#237;gidas (hard)&amp;#160; e flex&amp;#237;veis (soft). As r&amp;#237;gidas em geral est&amp;#227;o associadas a situa&amp;#231;&amp;#245;es que um vez realizadas e imediatemente detectas pela ferramenta de desenho impedir&amp;#227;o que o usu&amp;#225;rio &lt;/p&gt;  &lt;p&gt;prossiga. As flex&amp;#237;veis por outro lado permitem que o usu&amp;#225;rio prossiga com o desenho mas o erro ser&amp;#225; apenas detectado quando for solicitado para se gerar a linguagem.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;No caso do &amp;quot;Issue Tracker&amp;quot; a m&amp;#225;quina de estado que o representa possu&amp;#237; um comportamento bastante espec&amp;#237;fico. Que limita, portanto o comportamento da m&amp;#225;quina de estado que ir&amp;#225; representa-lo. No dom&amp;#237;nio do nosso problema de rastreamento (Issue Tracker) de &amp;quot;problemas&amp;quot; temos as seguintes condi&amp;#231;&amp;#245;es para a condi&amp;#231;&amp;#227;o inicial (Start Element) e os estados (Issue State) que o representam. Imaginamos inicialmente as seguintes 5 condi&amp;#231;&amp;#245;es, ou restri&amp;#231;&amp;#245;es:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Issue State n&amp;#227;o pode ser repetido, ou seja eu n&amp;#227;o posso ter estados cujo nome se repete, &lt;/li&gt;    &lt;li&gt;Issue States que estejam soltos ou desconectados (este parece ser uma condi&amp;#231;&amp;#227;o simples mas imagine um desenho complexo que ocupa muito mais que uma tela), &lt;/li&gt;    &lt;li&gt;Apenas um Start Element, ou seja um ponto de entrada, ou condi&amp;#231;&amp;#227;o inicial, &lt;/li&gt;    &lt;li&gt;Issue States n&amp;#227;o pode estar vazio, ou seja sem um nome, &lt;/li&gt;    &lt;li&gt;E por fim n&amp;#227;o se pode ter comportamentos ciclom&amp;#225;ticos. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;As 2 primeiras op&amp;#231;&amp;#245;es acima s&amp;#227;o restri&amp;#231;&amp;#245;es que iremos considerar como flex&amp;#237;veis e as outras 3 &amp;#250;ltimas s&amp;#227;o do tipo r&amp;#237;gidas.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Vamos come&amp;#231;ar tratando primeiro caso: Issue State n&amp;#227;o pode ter nomes repetidos.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;O video a seguir mostra como conseguir isto.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Laborat%c3%b3rio%202%20-%20Parte%201/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Abaixo o c&amp;#243;digo que implementa esta valida&amp;#231;&amp;#227;o.&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 99.31%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; height: 251px; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling.Diagrams;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling.Validation;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.VisualStudio.Modeling;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Globalization;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Como requisito da nossa maquina de estado que representa os nossos &amp;quot;Issues&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; &lt;span style="color: #008000"&gt;// ela nao pode ter 2 estados com o mesmo nome&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Logo o metod abaixo verifica em todo o espaco do dominio da classe (IssueStateModels)&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt; &lt;span style="color: #008000"&gt;// senao existem dois estados com nome iguais.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Caso existam um erro 'e gerado&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt; &lt;span style="color: #008000"&gt;// O erro gerado apenas quando o usu'ario da DSL solicitar uma validacao do modelo&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt; &lt;span style="color: #008000"&gt;// Ou seja um Soft Validation&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; height: 46px; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Microsoft.IssueStateModels&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     [ValidationState(ValidationState.Enabled)]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; IssueStateModel&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  22:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  23:&lt;/span&gt;         [ValidationMethod(ValidationCategories.Menu)]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  24:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ValidateStateNamesUnique(ValidationContext context)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  25:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  26:&lt;/span&gt;             Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;, IssueState&amp;gt; stateNames = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;, IssueState&amp;gt;();&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  27:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  28:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (StateElement element &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.StateElements)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  29:&lt;/span&gt;             {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  30:&lt;/span&gt;                 IssueState state = element &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; IssueState;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  31:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (state != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  32:&lt;/span&gt;                 {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  33:&lt;/span&gt;                     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (stateNames.ContainsKey (state.Name))&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  34:&lt;/span&gt;                     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  35:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; description = String.Format(CultureInfo.CurrentCulture, &lt;span style="color: #006080"&gt;&amp;quot;State name '{0}' is used more than once.&amp;quot;&lt;/span&gt;, state.Name);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  36:&lt;/span&gt;                         context.LogError(description, &lt;span style="color: #006080"&gt;&amp;quot;Err 01&amp;quot;&lt;/span&gt;, state, stateNames[state.Name]);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  37:&lt;/span&gt;                     }      &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  38:&lt;/span&gt;                     stateNames[state.Name] = state;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  39:&lt;/span&gt;                 }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  40:&lt;/span&gt;             }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  41:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  42:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  43:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  44:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8890765" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="Arquitetura" scheme="http://blogs.msdn.com/hulot/archive/tags/Arquitetura/default.aspx" /><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 1 - Parte 4</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/07/20/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-4.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/07/20/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-4.aspx</id><published>2008-07-20T23:35:02Z</published><updated>2008-07-20T23:35:02Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d786247a-3030-4e48-b811-98884e0ec6fa" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Resta agora criarmos o toolbox para que possamos fazer &amp;quot;drag-and-drop&amp;quot; dos elementos que representam nossa DSL. O prop&amp;#243;sito deste laborat&amp;#243;rio &amp;#233; mostrar como criar a toolbox e seus elementos.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Nesta parte vamos aprender a criar os tabs e os toolbox. Eles s&amp;#227;o particularmente&amp;#160; &amp;#250;teis pois s&amp;#227;o os elementos neles representados ser&amp;#227;o os elementos que o usu&amp;#225;rio da linguagem (DSL) ir&amp;#225; usar. Eles s&amp;#227;o identicos aos toolbox que temos dentro do VS para o desenvolvimento de aplica&amp;#231;&amp;#245;es por exemplo para ASP.NET. &amp;#201; portanto muito importante que eles representem visualmente os elementos da nossa linguagem.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Laborat%c3%b3rio%201%20-%20Parte%204/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Esta &amp;#233; parte final&amp;#160; do nosso Laborat&amp;#243;rio 1, e com isto conclu&amp;#237;mos a cria&amp;#231;&amp;#227;o da nossa linguagem de uma forma b&amp;#225;sica, e gen&amp;#233;rica para resolver o problema proposto. Como veremos a seguir, ela ainda tem uma s&amp;#233;ria de limita&amp;#231;&amp;#245;es. Entretanto estas limita&amp;#231;&amp;#242;es s&amp;#227;o relativas a&amp;#160; restri&amp;#231;&amp;#245;es e valida&amp;#231;&amp;#245;es que em geral s&amp;#227;o inerentes as linguagens. Nos laborat&amp;#243;rio seguinte vamos nos atentar a melhorar a nossa linguagem atrav&amp;#233;s da cria&amp;#231;&amp;#227;o destas regras de valida&amp;#231;&amp;#227;o e das restri&amp;#231;&amp;#245;es.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8759840" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="Tecnologias" scheme="http://blogs.msdn.com/hulot/archive/tags/Tecnologias/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 1 - Parte 3</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/07/16/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-3.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/07/16/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-3.aspx</id><published>2008-07-17T00:56:48Z</published><updated>2008-07-17T00:56:48Z</updated><content type="html">&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0e7ca368-b2b6-4933-852f-357d9ed742b4" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Feita a limpeza do &amp;quot;Experimental Hive&amp;quot; estamos prontos a dar continuidade a cria&amp;#231;&amp;#227;o da DSL. No Laborat&amp;#243;rio 1 - Parte 2 criamos a representa&amp;#231;&amp;#227;o ou a descri&amp;#231;&amp;#227;o da linguagem do dom&amp;#237;nio agora vamos nos concentrar na cria&amp;#231;&amp;#227;o da representa&amp;#231;&amp;#227;o desta linguagem.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;O primeiro passo &amp;#233; escolher as formas geom&amp;#233;tricas que v&amp;#227;o representar os &amp;quot;classes&amp;quot; da nossa linguagem ou seja os elementos representados no nosso dom&amp;#237;nio criado anteriormente.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;A id&amp;#233;ia &amp;#233; criar portanto uma representa&amp;#231;&amp;#227;o que possa refletir a simbologia como mostrada na figura abaixo&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13E38/IssueStates%20and%20IssueState%20Transitions%201_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="167" alt="IssueStates and IssueState Transitions 1" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_13E38/IssueStates%20and%20IssueState%20Transitions%201_thumb.jpg" width="293" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;E em seguida estabelecermos a rela&amp;#231;&amp;#227;o entre estas formas e conectores (elementos de representa&amp;#231;&amp;#227;o gr&amp;#225;fica) e &amp;quot;classes&amp;quot; definidas anteriormente.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Os detalhes de como isto &amp;#233; feito est&amp;#227;o na demo abaixo&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Laboratorio_1-Parte_3/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#201; poss&amp;#237;vel personalizar a apar&amp;#234;ncia, a forma de intera&amp;#231;&amp;#227;o, as propriedades destas representa&amp;#231;&amp;#227;o das mais variadas formas atr&amp;#225;ves de c&amp;#243;digo. Ou seja assim com no caso das classes que representam o dom&amp;#237;nio que foi mostrada no Laborat&amp;#243;rio 1 - Parte, aqui tamb&amp;#233;m &amp;#233; poss&amp;#237;vel criar representa&amp;#231;&amp;#245;es bastante elaboradas atrav&amp;#233;s de cria&amp;#231;&amp;#227;o de c&amp;#243;digo espec&amp;#237;fco que extenda ou complemente as classes existentes. &lt;/p&gt;  &lt;p&gt;Para os que comprarem o livro maiores detalhes podem ser encontrados no cap&amp;#237;tulo 4.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8741544" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 1 - Parte 2 (Limpando o "Experimental Hive")</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/06/15/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-2-limpando-o-experimental-hive.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/06/15/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-2-limpando-o-experimental-hive.aspx</id><published>2008-06-15T22:30:11Z</published><updated>2008-06-15T22:30:11Z</updated><content type="html">&lt;p&gt;&amp;#160; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4d9c5e6a-a374-49ab-82cc-aee6e5aa4976" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;No Laborat&amp;#243;rio anterior vimos que ao final um pequeno &amp;quot;problema&amp;quot;ocorreu. Fizemos isto propositalmente para explicarmos um conceito que est&amp;#225; dentro do VS quando se trabalha com aplica&amp;#231;&amp;#245;es que s&amp;#227;o desenvolvidas para serem parte do VS, que &amp;#233; o caso da nossa DSL. A este conceito &amp;#233; dado o nome de &amp;quot;Experimental Hive&amp;quot;, ou seja um espa&amp;#231;o reservado para que o VS possa executar as aplica&amp;#231;&amp;#245;es que a ele mesmo destinadas. Como em geral na montagem de uma demo, como est&amp;#225; que estamos aqui colocando no ar, muitas indas e vindas s&amp;#227;o necess&amp;#225;rios, e com isto este espa&amp;#231;o acaba ficando com dados, classes e estados &amp;quot;persistidos&amp;quot;, portanto &lt;/p&gt;  &lt;p&gt;&amp;#233; importanto ter certeza que esta &amp;#225;rea experimental est&amp;#225; limpa antes de come&amp;#231;ar um novo exerc&amp;#237;cio. E &amp;#233; isto exatamente que vamos fazer neste laborat&amp;#243;rio.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Labortatorio_1-Parte_2-Limpando_Experimental_Hive/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8602064" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 1 - Parte 2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/06/15/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-2.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/06/15/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-2.aspx</id><published>2008-06-15T21:07:05Z</published><updated>2008-06-15T21:07:05Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Vimos no Laborat&amp;#243;rio 1 - Parte 1 que parte do nosso problema &amp;#233; encontrar uma forma de representar situa&amp;#231;&amp;#245;es do tipo &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/IssueStates%20and%20IssueState%20Transitions%201_4.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="139" alt="IssueStates and IssueState Transitions 1" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/IssueStates%20and%20IssueState%20Transitions%201_thumb_1.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Figura 1&lt;/p&gt;  &lt;p&gt;Ou talvez algo mais gen&amp;#233;rico como&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/IssueStates%20and%20IssueState%20Transitions%20Examples_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="397" alt="IssueStates and IssueState Transitions Examples" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/IssueStates%20and%20IssueState%20Transitions%20Examples_thumb.jpg" width="545" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Figura 2&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Seguindo o livro estas transi&amp;#231;&amp;#245;es de estado como representadas na figura 1 podem ser de forma equivalente representadas por&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/Issue%20State%20Model%20-%20Chapter%203_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="283" alt="Issue State Model - Chapter 3" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/Issue%20State%20Model%20-%20Chapter%203_thumb.jpg" width="403" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Figura 3&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;E &amp;#233; aqui que as coisas come&amp;#231;am a ficar interessantes pois vamos come&amp;#231;ar a modelar a nossa linguagem espec&amp;#237;fica para resolver este problema em particular. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Poder&amp;#237;amos encarar a Figura 3 como a seguinte representa&amp;#231;&amp;#227;o para uma classe (StateElement) que representa os estados que tentamos representar no nosso problema.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/Issue%20State%20Model%20com%20coment%C3%A1rios%20-%20Chapter%203_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="294" alt="Issue State Model com coment&amp;#225;rios - Chapter 3" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_10D32/Issue%20State%20Model%20com%20coment%C3%A1rios%20-%20Chapter%203_thumb.jpg" width="419" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Figura 4&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Assim sendo o nosso &amp;quot;dom&amp;#237;nio&amp;quot; (IssueStateModel) &amp;#233; composto de classes StateElement.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;E &amp;#233; a partir deste modelo que vamos criar a &amp;quot;defini&amp;#231;&amp;#227;o&amp;quot; para a DSL que representa o problema acima de transi&amp;#231;&amp;#227;o entre estados que &amp;#233; o que est&amp;#225; demonstrado no v&amp;#237;deo abaixo&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:61bd2d48-5b1c-415a-9c90-895a7146e99e" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Laboratorio_1-Parte_2/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8602025" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL Laboratório 1 - Parte 1</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/05/30/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-1.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/05/30/produtividade-no-desenvolvimento-de-software-dsl-laborat-rio-1-parte-1.aspx</id><published>2008-05-30T02:12:42Z</published><updated>2008-05-30T02:12:42Z</updated><content type="html">&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c9d5f30c-8df2-44ed-92c1-51586fbdad89" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;Como eu havia dito anteriormente os laborat&amp;#243;rios que ser&amp;#227;o apresentados daqui para frente se baseiam no exemplo do livro que eu citei (&lt;a href="http://www.amazon.com/Domain-Specific-Development-Visual-Studio-Microsoft/dp/0321398203/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1205073817&amp;amp;sr=1-1"&gt;Domain-Specific Development with Visual Studio DSL Tools&lt;/a&gt; ) dado no cap&amp;#237;tulo 2. O exemplo diz respeito a uam empresa de desenvolvimento de software fict&amp;#237;cia, a CJKW,&amp;#160; que desenvolveu um software para o rastreamento de problemas de software - Issue Tracker - e um dos seus elementos chaves &amp;#233; o monitor de problemas ou &amp;quot;issues&amp;quot;. Este software de rastreamento de problemas (de agora em diante apenas IssueTracker) foi desenvolvido pela CJKW usando o &lt;a href="http://asp.net/downloads/archived/starter-kits/issue-tracker/"&gt;Issue Tracker Model Kit&lt;/a&gt; dado no site Microsoft para o &lt;a href="http://asp.net/"&gt;ASP.NET&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;O monitor de problemas pode ser abaixo visualizado &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_146B6/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="404" alt="image" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_146B6/image_thumb_1.png" width="714" border="0" /&gt;&lt;/a&gt; figura 1&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;A parte que nos interessa &amp;#233; justamente a parte em evidencia na imagem acima, ou seja o Status que d&amp;#225; uma s&amp;#233;rie de condi&amp;#231;&amp;#245;es ou &amp;quot;estados&amp;quot; do problema.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Cada cliente da CJKW tem requisitos diferentes para as condi&amp;#231;&amp;#245;es ou estados de status, como era de se esperar, bem como as transi&amp;#231;&amp;#245;es entre estas estados tamb&amp;#233;m s&amp;#227;o diferentes de cliente para cliente.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Um exemplo de transi&amp;#231;&amp;#227;o entre diferentes estados de status poderia ser &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_146B6/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="139" alt="image" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_146B6/image_thumb_5.png" width="244" border="0" /&gt;&lt;/a&gt; figura 2&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Um exemplo de c&amp;#243;digo que representaria as transi&amp;#231;&amp;#245;es acima poderia ser:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_146B6/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="520" alt="image" src="http://blogs.msdn.com/blogfiles/hulot/WindowsLiveWriter/ProdutividadenoDesenvolvimentodeSoftware_146B6/image_thumb_4.png" width="426" border="0" /&gt;&lt;/a&gt; figura 3&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Ou seja a cada cliente eles tem de re-escrever este peda&amp;#231;o de c&amp;#243;digo para poder representar as poss&amp;#237;veis transi&amp;#231;&amp;#245;es e manter o dro-down box de status com as op&amp;#231;&amp;#245;es corretas dependendo do estado em que um problema se encontra.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Evidentemente este problema &amp;#233; t&amp;#237;pico de uma m&amp;#225;quina de estado e suas transi&amp;#231;&amp;#245;es e por certo existem m&amp;#233;todos mais efic&amp;#225;zes de se resolver este problema, mas para o laborat&amp;#243;rio em quest&amp;#227;o vamos partir do princ&amp;#237;pio que queremos automatizar a gera&amp;#231;&amp;#227;o de c&amp;#243;digo para poder dado uma representa&amp;#231;&amp;#227;o como a da figura 2 poder autom&amp;#225;ticamente gerar o c&amp;#243;digo da figura 3.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Maiores detalhes podem ser encontrados no livro.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Nesta primeiro laborat&amp;#243;rio vamos nos concentrar em representar a linguagem que representa este problema, ou seja como representar os estados e suas transi&amp;#231;&amp;#245;es. Este Laborat&amp;#243;rio 1, na qual vamos criar a representa&amp;#231;&amp;#227;o deste problema, ser&amp;#225; feito passo a passo, ou seja em partes. Na primeira parte tratamos apenas de criarmos um projeto do zero para o que chamaremos de Issue Tracker Model.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/Laboratorio_1-Parte_1/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8561209" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL - SDK Demo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/05/26/produtividade-no-desenvolvimento-de-software-dsl-sdk-demo.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/05/26/produtividade-no-desenvolvimento-de-software-dsl-sdk-demo.aspx</id><published>2008-05-27T00:31:34Z</published><updated>2008-05-27T00:31:34Z</updated><content type="html">&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:85f7a116-7d1b-49e5-95d6-49a6ca9d8b3d" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Produtividade%20no%20Desenvolvimento" rel="tag"&gt;Produtividade no Desenvolvimento&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;O kit SDK do Visual Studio (&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=51A5C65B-C020-4E08-8AC0-3EB9C06996F4&amp;amp;displaylang=en"&gt;Visual Studio SDK 2005&lt;/a&gt;) &amp;#233; o pacote essencial para que se possa ter o DSL integrado ao Visual Studio, como vimos na parte anterior &lt;a title="Produtividade no Desenvolvimento de Software - DSL - Introdu&amp;#231;&amp;#227;o" href="http://blogs.msdn.com/hulot/archive/2008/05/13/produtividade-no-desenvolvimento-de-software-dsl-introdu-o.aspx"&gt;Produtividade no Desenvolvimento de Software - DSL - Introdu&amp;#231;&amp;#227;o&lt;/a&gt;. Ao mesmo tempo ele contem um conjunto de demos (samples) que permitem explorar e conhecer melhor o que &amp;#233; poss&amp;#237;vel se fazer com DSL. &lt;/p&gt;  &lt;p&gt;A demo a seguir faz justamente uso de um dos exemplos contidos no SDK (&lt;a href="http://msdn.microsoft.com/en-us/library/bb126260(VS.80).aspx"&gt;User Interface Process Sample&lt;/a&gt;). Este &amp;#233; um exemplo que faz uso do &lt;a href="http://msdn.microsoft.com/en-us/library/ms979217.aspx"&gt;User Interface Application Block&lt;/a&gt; (UIPAB). Este Application Block usa o pattern MVC (model-view-controller). Neste exemplo um DSL &amp;#233; desenvolvida para se criar um sistema de reserva de hoteis cuja a interface obedece ao conceito de MVC. A DSL permite se criar a l&amp;#243;gica do sistema de reserva de um hotel e partir dela usando o UIPAB toda a interface de intera&amp;#231;&amp;#227;o da aplica&amp;#231;&amp;#227;o para o sistema de reserva de hotel &amp;#233; gerada autom&amp;#225;ticamente.&lt;/p&gt;  &lt;p&gt;A demo mostra algumas das possibilidades de como &amp;quot;brincar&amp;quot;com este exemplo presente no Visual Studio SDK 2005. Minha sugest&amp;#227;o &amp;#233; que os leitores interessados em aprender DSL, baixem e fa&amp;#231;am outra &amp;quot;bricadeiras&amp;quot;com estes exemplos para conhecer melhor as potencia;idades e limita&amp;#231;&amp;#245;es do DSL.&lt;/p&gt;  &lt;p&gt;A prop&amp;#243;sito o &lt;a href="http://msdn.microsoft.com/en-us/library/bb126260.aspx"&gt;mesmo exemplo&lt;/a&gt; pode ser feito usando o Visual Studio 2008 mas para isto o leitor ter&amp;#225; de baixar o &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=30402623-93ca-479a-867c-04dc45164f5b&amp;amp;displaylang=en"&gt;Visual Studio SDK da vers&amp;#227;o 2008&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/DSL_SDK_Demo/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8553774" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /><category term="DSL" scheme="http://blogs.msdn.com/hulot/archive/tags/DSL/default.aspx" /></entry><entry><title>Produtividade no Desenvolvimento de Software - DSL - Introdução</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/05/13/produtividade-no-desenvolvimento-de-software-dsl-introdu-o.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/05/13/produtividade-no-desenvolvimento-de-software-dsl-introdu-o.aspx</id><published>2008-05-13T02:36:28Z</published><updated>2008-05-13T02:36:28Z</updated><content type="html">&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:87fd9de3-2117-4a67-99b8-715f84f0edc7" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/DSL" rel="tag"&gt;DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/F%c3%a1bricas%20de%20Software" rel="tag"&gt;F&amp;#225;bricas de Software&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;H&amp;#225; aproximadamente uns 2 meses eu, Otavio e Waldemir fizemos um experimento que foi a montagem de um curso (workshop). &lt;a href="http://blogs.msdn.com/otavio/archive/2008/03/09/workshop-sobre-produtividade-no-desenvolvimento-de-software-final.aspx"&gt;Otavio&lt;/a&gt; d&amp;#225; uma vis&amp;#227;o geral do workshop no seu blog e neste memo blog ele menciona que eu iria reativar meu blog, que j&amp;#225; esta parado h&amp;#225; algum tempo em fun&amp;#231;&amp;#227;o da minha &amp;quot;pregui&amp;#231;a&amp;quot;de escrever j&amp;#225; que n&amp;#227;o sou muito bom em texto, para colocar uns videos mostrando o que foi feito pelo menos na parte de DSL. A ide&amp;#237;a deste videos era mostrar como construir uma DSL.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;O exemplo b&amp;#225;sico foi tirado do livro &lt;a href="http://www.amazon.com/Domain-Specific-Development-Visual-Studio-Microsoft/dp/0321398203/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1205073817&amp;amp;sr=1-1"&gt;Domain-Specific Development with Visual Studio DSL Tools&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/otavio/WindowsLiveWriter/WorkshopsobreProdutividadenoDesenvolvime_A68F/51PowJFAeAL__AA240__2.jpg"&gt;&lt;img height="244" alt="51PowJFAeAL__AA240_" src="http://blogs.msdn.com/blogfiles/otavio/WindowsLiveWriter/WorkshopsobreProdutividadenoDesenvolvime_A68F/51PowJFAeAL__AA240__thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;A ideia &amp;#233; que este videos ajudem aos interessados a terem uma melhor compreens&amp;#227;o do que &amp;#233; DSL e como usa-la. &lt;/p&gt;  &lt;p&gt;S&amp;#227;o uma s&amp;#233;rie de 16 videos que varia de 1 minuto (abertura) a 28 minutos totalizando algo como quase 6 horas de videos de demonstra&amp;#231;&amp;#227;o. Eles seguem uma ordem cuja o objetivo &amp;#233; mostrar desde como ter DSL instalado no ambiente do Visual Studio at&amp;#233; um exerc&amp;#237;cio completo de cria&amp;#231;&amp;#227;o de uma DSL para o exemplo do livro (end-to-end)&lt;/p&gt;  &lt;p&gt;Espero que vcs aproveitem e d&amp;#234;em feedback pois assim posso altera-las e complementa-las a fim de fazer mais claro o exerc&amp;#237;cio.&lt;/p&gt;  &lt;p&gt;Vou posta-las ao longo das proximas semanas sempre acompanhadas de um pequeno texto descritivo explicando a que cada uma das parte se prop&amp;#245;e.&lt;/p&gt;  &lt;p&gt;A ideia dos videos tem 2 prop&amp;#243;sitos o primeiro &amp;#233; demonstrar o uso da DSL e o segundo &amp;#233; do mostrar um conceito de S+S. Para tal os videos est&amp;#227;o armazanados no &lt;a href="http://silverlight.live.com/"&gt;Silverlight Streaming&lt;/a&gt; e portanto s&amp;#227;o streaming de videos. Posteriormente eu posso colocar os videos para download.&lt;/p&gt;  &lt;p&gt;Para come&amp;#231;ar vamos por colocar 2 videos.&lt;/p&gt;  &lt;p&gt;O primeiro &amp;#233; de abertura &lt;/p&gt;  &lt;p&gt;&lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/DSLAbertura/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Neste video eu dou um breve introdu&amp;#231;&amp;#227;o sobre o que vamos fazer.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;O segundo video explora os requisitos necess&amp;#225;rios para se ter o DSL no Visual Studio em seguida dar um exemplo ba'sico a fim de familiarizar o usu&amp;#225;rio com a interface DSL dentro do Visual Studio.&lt;/p&gt; &lt;iframe style="width: 500px; height: 375px" src="http://silverlight.services.live.com/invoke/34913/CriacaoDSLBasica/iframe.html" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8498510" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="F&amp;#225;bricas de Software" scheme="http://blogs.msdn.com/hulot/archive/tags/F_26002300_225_3B00_bricas+de+Software/default.aspx" /></entry><entry><title>RAF 2008 - Evento de Arquitetos em São Paulo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2008/04/17/raf-2008-evento-de-arquitetos-em-s-o-paulo.aspx" /><id>http://blogs.msdn.com/hulot/archive/2008/04/17/raf-2008-evento-de-arquitetos-em-s-o-paulo.aspx</id><published>2008-04-17T19:30:43Z</published><updated>2008-04-17T19:30:43Z</updated><content type="html">&lt;p&gt;Na semana passada, 8 e 9 de Abril de 2008, n&amp;#243;s realizamos o RAF 2008 (Regional Architect Forum) em S&amp;#227;o Paulo. Algumas mudan&amp;#231;as foram feitas com rela&amp;#231;&amp;#227;o aos RAFs anteriores mais o espir&amp;#237;to do evento permaneceu o mesmo. &lt;/p&gt;  &lt;p&gt;Foram duas sess&amp;#245;es gerais aonde o tema foi S+S (software plus service). Na primeira sess&amp;#227;o (O Yin e o Yang do Software - Gianpaolo Carraro) foram abordados elementos mais conceituais do S+S mostrando atrav&amp;#233;s de uma analogia como alguns elementos tem de estar presentes para que uma arquitetura que siga o modelo S+S possa ser bem sucedida. Na segunda sess&amp;#227;o (Arquiteturas H&amp;#237;bridas - Eugenio Pace) foram abordados elementos de carater pr&amp;#225;tico atrav&amp;#233;s de um estudo de caso.&lt;/p&gt;  &lt;p&gt;Foram 10 mesas redondas abordando temas como: Green IT, Dynamic System Initiative, Infra-estrutura Web, Business Inteligence, F&amp;#225;bricas de Software, Domain Specific Languages, Enterprise Services Bus / Internet Services Bus, Windows Communication Foundation e Windows Workflow Foundation.&lt;/p&gt;  &lt;p&gt;Foram 3 sesso&amp;#245;es informativas aonde tivemos 3 vis&amp;#245;es dstintas do uso da tecnologia da informa&amp;#231;&amp;#227;o. Do ponto de vista de hardware, atrav&amp;#233;s da palestra &amp;quot;Data Center Utility&amp;quot; proferida por Bruno Domingues da Intel. Do ponto de vista de software, atrav&amp;#233;s da palestra &amp;quot;SOA Roadmap e OSLO&amp;quot; proferida por Lalo Steinmann. E finalmente do ponto de vista de pesquisa cient&amp;#237;fica atrav&amp;#233;s da palestra &amp;quot;Arquitetura das proteinas, nano e macro m&amp;#225;quinas e do software&amp;quot; proferida pelo Dr. Goran Neshich da EMBRAPA.&lt;/p&gt;  &lt;p&gt;Por fim tivemos uma sess&amp;#227;o de fechamento&amp;#160; feito por Hans Donner com uma apresenta&amp;#231;&amp;#227;o magnif&amp;#237;ca aonde ele falou sobre sua carreira como designer e da sua mais nova iniciativa ligada a interpreta&amp;#231;&amp;#227;o e visualiza&amp;#231;&amp;#227;o do tempo - Timension.&lt;/p&gt;  &lt;p&gt;O material das apresenta&amp;#231;&amp;#245;es ser&amp;#225; colocado no nosso site do MSDN Brasil em breve. Assim que estiver no ar eu aviso.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8404597" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author><category term="RAF" scheme="http://blogs.msdn.com/hulot/archive/tags/RAF/default.aspx" /></entry><entry><title>O que é um arquiteto?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2007/12/05/o-que-um-arquiteto.aspx" /><id>http://blogs.msdn.com/hulot/archive/2007/12/05/o-que-um-arquiteto.aspx</id><published>2007-12-05T17:21:00Z</published><updated>2007-12-05T17:21:00Z</updated><content type="html">&lt;P&gt;Vez por outra recebo perguntas do tipo o que é ser um arquiteto. Existem diversas explicações na net sobre o assunto, mas eu tenha a minha versão. Arquitetos no conceito de construção, e esta pode ser de qualquer tipo, civil, naval, industrial,etc, no primeiro mundo (USA por exemplo) são individuos que tem um papel muito importante. Por exemplo na construção civíl o arquiteto é o sujeito responsável pela obra. É ele que porjeta a cosntrução e suas detalhes, é ele quem supervisiona a execução em geral feitas por engenheiros. Outra medida da importancia do arquiteto é que em geral os cursos universitários são muitos mais extensos e completos para arquitetos do que por exemplo para engenheiros cujo foco é sempre a execução ou prática. Assim desta forma o termo arquiteto dentro do universo de TI tem um carater mais&amp;nbsp;abrangente porém menos especifico&amp;nbsp;que os engenheiros de software e desenvolvedores. Notem que eu não disse mais importante, todos os 3 são muito importantes (arquitetos, engenheiros e desenvolvedores de software). Eu disse mais abrangente ou seja ele deve ser preocupar, como na analogia da construção civíl com o planejamento e arquitetura da solução final.&lt;/P&gt;
&lt;P&gt;Entretanto se vocês buscam&amp;nbsp;visão mais pragmática e objetiva com relação ao que é um arquiteto dentro do contexto de TI eu recomendo ler &lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/en-us/skyscrapr/bb401007.aspx"&gt;http://msdn2.microsoft.com/en-us/skyscrapr/bb401007.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Outra pergunta que me fazem vez por outra é se existe um certificação para arquitetos e como obte-las. Sim existe, tanto a Microsoft como algum de seus concorrentes tem certificações para atestar um verdadeio arquiteto. Para saber mais eu recomendo a leitura do seguinte link &lt;A href="http://www.microsoft.com/learning/mcp/architect/default.mspx"&gt;http://www.microsoft.com/learning/mcp/architect/default.mspx&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6668650" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author></entry><entry><title>SAF (Stroategic Architect Forum) News</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hulot/archive/2007/11/13/saf-stroategic-architect-forum-news.aspx" /><id>http://blogs.msdn.com/hulot/archive/2007/11/13/saf-stroategic-architect-forum-news.aspx</id><published>2007-11-13T18:53:00Z</published><updated>2007-11-13T18:53:00Z</updated><content type="html">&lt;P&gt;Nestes instante estamos assistindo um demo do Behrooz Chitsaz a respeito do MSR (Microsoft Research). Ele está nos mostramos coisas incríveis que este laboratório tem feito.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apenas para ilustrar vou passar dois links para os leitores terem uma idéia:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://risingfromruin.msnbc.com/tour.html"&gt;http://risingfromruin.msnbc.com/tour.html&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Neste link vocês poderão ver video em 3 dimensões.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Neste outro aqui &lt;A href="http://research.microsoft.com/ivm/HDView.htm"&gt;http://research.microsoft.com/ivm/HDView.htm&lt;/A&gt;&amp;nbsp;vocês podem ver imagens em altíssima resolução.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mas muitos outros assuntos foram abordados de futuros dispositivos a avanços em gonoma e medicina. Vale a pena gastar algumas horas procurando coisas interessantes que este pessoal anda fazendo.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://research.microsoft.com/news/featurestories/default.aspx?0hp=n4"&gt;http://research.microsoft.com/news/featurestories/default.aspx?0hp=n4&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;ou simplesmente &lt;A href="http://research.microsoft.com/"&gt;http://research.microsoft.com/&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ok por hora é só. Tenho de correr pois na sequencia tenho de moderadar uma discussão.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6180496" width="1" height="1"&gt;</content><author><name>Hulot</name><uri>http://blogs.msdn.com/members/Hulot.aspx</uri></author></entry></feed>