<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Code Smart Not Hard - Code Generation</title>
    <link>http://codesmartnothard.com/</link>
    <description>Team Foundation Server, Frameworks, and Code Generation</description>
    <language>en-us</language>
    <copyright>Michael Douglas</copyright>
    <lastBuildDate>Sun, 21 Dec 2008 04:49:44 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>mike@doitconsultants.com</managingEditor>
    <webMaster>mike@doitconsultants.com</webMaster>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=d2220e5c-0e71-4fa9-8029-e9d1dc1a6b29</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,d2220e5c-0e71-4fa9-8029-e9d1dc1a6b29.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,d2220e5c-0e71-4fa9-8029-e9d1dc1a6b29.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=d2220e5c-0e71-4fa9-8029-e9d1dc1a6b29</wfw:commentRss>
      <title>Continuous Generation – Generating the code during every build using TFS and CodeSmith Tools</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,d2220e5c-0e71-4fa9-8029-e9d1dc1a6b29.aspx</guid>
      <link>http://codesmartnothard.com/ContinuousGenerationGeneratingTheCodeDuringEveryBuildUsingTFSAndCodeSmithTools.aspx</link>
      <pubDate>Sun, 21 Dec 2008 04:49:44 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Doing
builds and running unit tests after every check-in has become a standard practice
in Agile and non-Agile development teams.&amp;nbsp; Continuous Integration is the term
that describes this process and helps ensure that that nothing has been broken since
the last check-in.&amp;nbsp;&amp;nbsp;&amp;nbsp; One area that is sometimes overlooked is the
code generation.&amp;nbsp;&amp;nbsp;&amp;nbsp; Continuous Generation, the re-generating of code
/ stored procedures for every check-in and build, should be considered for your TFS
builds.&amp;nbsp; I believe there is a lot of benefit to generating the code with every
build.&amp;nbsp; There are several benefits:&lt;/span&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Table
schema and stored procedure parameters can change.&amp;nbsp; How do you know that your
generated objects are up to date and match the database?&lt;/span&gt; 
&lt;li&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;It
keeps everyone honest so they don’t break the golden rule of never editing generated
code.&amp;nbsp; If the build is going to re-generate the code there’s no way to sneak
the semicolon or curly bracket that you manually fix each time after generation.&lt;/span&gt; 
&lt;li&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Sometimes
we generate just the class we are working on and keep the rest checked in so it doesn’t
overwrite the current object.&amp;nbsp; If any changes are made to the template only this
new class will have them.&amp;nbsp; The other classes will be based on the older version.&lt;/span&gt; 
&lt;li&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;It
gives more credibility to the generation process.&amp;nbsp; There is sometimes a feeling
of nervousness when generating all of the objects.&amp;nbsp; Since generated code is never
edited, you can generate the code as often as you wish.&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;a href="http://www.codesmithtools.com/"&gt;CodeSmith
Tools&lt;/a&gt; is the code generation tool that we use.&amp;nbsp; It offers an easy way to
accomplish this from your Team Foundation Builds.&amp;nbsp;&amp;nbsp; With version 3.2 and
newer there is a custom build task included with the Professional edition.&amp;nbsp; &lt;a href="http://www.codesmithtools.com/help/Default.aspx##CodeSmith.chm/Using_a_CodeSmith_Project_from_MSBuild.html?__versionId=edcf773c-5899-42dc-b0e1-4f84ff93687e&amp;amp;__versionId=edcf773c-5899-42dc-b0e1-4f84ff93687e"&gt;Here&lt;/a&gt; is
the online help with some information about it.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;There
are a couple things to consider.&amp;nbsp; The generated classes will be checked-in to
source control.&amp;nbsp; You will need to check them out before you call the task and
then check them back in afterwards. Also, the user guide instructions do not work
quite right in the link above.&amp;nbsp; The guide explains how to use it within your
visual studio project.&amp;nbsp; However, the task needs to be called from Team Build.&amp;nbsp;
Here’s the basic steps and changes for your CI tfsbuild.proj file.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Step
1: Install CodeSmith Professional on your TFS build server.&amp;nbsp; This will install
the MSBuild task and Targets file.&amp;nbsp;&amp;nbsp; I contacted CodeSmith Tool’s sales
department and this does require an additional license for the server.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Step
2: Import the CodeSmith Targets file.&amp;nbsp; Add the following line just below the
import element below the &amp;lt;!-- Do not edit this --&amp;gt; comment. &lt;/span&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt; 
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Import&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Project&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;$(MSBuildExtensionsPath)\CodeSmith\CodeSmith.targets&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Step 3:&amp;nbsp; Add TF property in the PropertyGroup element specifying the tf.exe location
to be used throughout the process.
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;PropertyGroup&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;br&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TF&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;amp;quot;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;$(TeamBuildRefPath)\..\tf.exe&lt;span style="COLOR: red"&gt;&amp;amp;quot;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TF&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;br&gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;PropertyGroup&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Step 4:&amp;nbsp; Override the AfterGet target to check out the generated file(s).&amp;nbsp;
This must be called before the CodeSmith task or it will return an access denied error.&amp;nbsp;
This example demonstrates one file but you can use a subfolder or naming prefix for
the generated files and recursively check out all of the necessary files.
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Target&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;AfterGet&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Exec&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkingDirectory&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;$(SolutionRoot)\Main\TestCodeSmithMSBuild\&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Command&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;$(TF)
checkout Measure.cs&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;
Step 5:&amp;nbsp; Call the CodeSmith task to execute the CodeSmith project(s) in your
solution.&amp;nbsp; This will also be called in the AfterGet target.&amp;nbsp; Currently the
example in the documentation incorrectly shows the CodeSmith task using the ProjectFile
attribute.&amp;nbsp; As the usage description shows, the attribute is actually ProjectFiles.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;CodeSmith&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ProjectFiles&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;$(SolutionRoot)\Main\TestCodeSmithMSBuild\Test.csp&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Step 6:&amp;nbsp; Override the AfterCompile target to check in the updated generated files.&amp;nbsp;
Fortunately TFS will only check in the file if there is a change.&amp;nbsp; This is good
because most of the time re-generating the code should generate the same thing each
time.&amp;nbsp; However, tf.exe returns a code of 1 instead of 0 and results in a partial
success of the build.&amp;nbsp; Use the IgnoreExitCode=”true” to ignore this.&amp;nbsp; You
could additionally update this to create a work item for any other return code.&amp;nbsp;
Here’s a &lt;a href="http://social.msdn.microsoft.com/forums/en-US/tfsbuild/thread/441916a0-58d7-4b81-991c-bbe8cb5a5bd5"&gt;post&lt;/a&gt; with
a good example of this. 
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Target&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;AfterCompile&lt;/span&gt;"&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;Condition&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;'$(IsDesktopBuild)'!='true'&lt;/span&gt;"&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Exec&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkingDirectory&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;$(SolutionRoot)\Main\TestCodeSmithMSBuild&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;IgnoreExitCode&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;true&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Command&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;span style="COLOR: blue"&gt;$(TF)
checkin /comment:&lt;/span&gt;&lt;span style="COLOR: red"&gt;&amp;amp;quot;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;***NO_CI***Auto-Generate&lt;/span&gt;&lt;span style="COLOR: red"&gt;&amp;amp;quot;&lt;/span&gt;&lt;span style="COLOR: blue"&gt; /noprompt
/override:&lt;/span&gt;&lt;span style="COLOR: red"&gt;&amp;amp;quot;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Auto
Generate&lt;/span&gt;&lt;span style="COLOR: red"&gt;&amp;amp;quot;&lt;/span&gt;&lt;span style="COLOR: blue"&gt; measure.cs &lt;/span&gt;"&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Target&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt; &lt;/span&gt;
&lt;/span&gt;&gt;
&lt;p&gt;
Step 7:&amp;nbsp; Undo the check out if the build fails by overriding the BeforeOnBuildBreak.
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Target&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;BeforeOnBuildBreak&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;Condition&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;'$(IsDesktopBuild)'!='true'&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Exec&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;WorkingDirectory&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;$(SolutionRoot)\Main\TestCodeSmithMSBuild&lt;/span&gt;&lt;font color=#000000&gt;"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Command&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;$(TF)
undo /noprompt measure.cs&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Target&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font face=Verdana color=#003300&gt;That
is it.&amp;nbsp; Enjoy!&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font face=Verdana color=#003300&gt;Mike&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=d2220e5c-0e71-4fa9-8029-e9d1dc1a6b29" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,d2220e5c-0e71-4fa9-8029-e9d1dc1a6b29.aspx</comments>
      <category>Code Generation;Team Build;Team Foundation Server</category>
    </item>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=e8a2e706-294a-4b71-8e02-c8ecc7c85ae7</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,e8a2e706-294a-4b71-8e02-c8ecc7c85ae7.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,e8a2e706-294a-4b71-8e02-c8ecc7c85ae7.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=e8a2e706-294a-4b71-8e02-c8ecc7c85ae7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.codesmithtools.com">CodeSmith Tools</a> has just published a case
study on my work, <a href="http://www.fcsamerica.com">Farm Credit Services of America</a>.  It talks
about how code generation is helping all of our teams.  The cool part
is that they quoted me in it.  Check it out and see my 15 bytes of fame :)
</p>
        <p>
          <a href="http://www.codesmithtools.com/lib/casestudies/Farm-Credit-Services-Of-America.pdf">http://www.codesmithtools.com/lib/casestudies/Farm-Credit-Services-Of-America.pdf</a>
        </p>
        <p>
Code Smart Not Hard
</p>
        <p>
Mike
</p>
        <img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=e8a2e706-294a-4b71-8e02-c8ecc7c85ae7" />
      </body>
      <title>CodeSmith Tools Case Study</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,e8a2e706-294a-4b71-8e02-c8ecc7c85ae7.aspx</guid>
      <link>http://codesmartnothard.com/CodeSmithToolsCaseStudy.aspx</link>
      <pubDate>Thu, 24 Apr 2008 02:50:56 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://www.codesmithtools.com"&gt;CodeSmith Tools&lt;/a&gt; has just published a case
study on my work, &lt;a href="http://www.fcsamerica.com"&gt;Farm Credit Services of America&lt;/a&gt;.&amp;nbsp;&amp;nbsp;It&amp;nbsp;talks
about&amp;nbsp;how&amp;nbsp;code generation is helping all of our teams.&amp;nbsp; The cool part
is that they quoted me in it.&amp;nbsp; Check it out and see my 15 bytes of fame :)
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codesmithtools.com/lib/casestudies/Farm-Credit-Services-Of-America.pdf"&gt;http://www.codesmithtools.com/lib/casestudies/Farm-Credit-Services-Of-America.pdf&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Code Smart Not Hard
&lt;/p&gt;
&lt;p&gt;
Mike
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=e8a2e706-294a-4b71-8e02-c8ecc7c85ae7" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,e8a2e706-294a-4b71-8e02-c8ecc7c85ae7.aspx</comments>
      <category>Code Generation</category>
    </item>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I presented at our local .NET users group in February on Subsonic.  Here's
the slides and a demo project I showed to the users.  It went really good. 
Everyone asked a lot of good questions and seem interested.  I'm just finishing
up another web project using it.  I know I saved about 25% of time because I
didn't have to right all of the redundant DAL code.  Cool stuff!
</p>
        <p>
          <a href="http://codesmartnothard.com/content/binary/SubsonicPresentation.zip">SubsonicPresentation.zip
(406.66 KB)</a>
        </p>
        <p>
Also check out the new Subsonic Website
</p>
        <p>
          <a href="http://subsonicproject.com/">http://subsonicproject.com/</a>
        </p>
        <p>
Mike
</p>
        <p>
CodeSmartNotHard
</p>
        <img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f" />
      </body>
      <title>Subsonc Presentation and Sample Project</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f.aspx</guid>
      <link>http://codesmartnothard.com/SubsoncPresentationAndSampleProject.aspx</link>
      <pubDate>Sat, 28 Jul 2007 11:57:48 GMT</pubDate>
      <description>&lt;p&gt;
I&amp;nbsp;presented at our local .NET users group in February on Subsonic.&amp;nbsp; Here's
the slides and a demo project I showed to the users.&amp;nbsp; It went really good.&amp;nbsp;
Everyone asked a lot of good questions and seem interested.&amp;nbsp; I'm just finishing
up another web project using it.&amp;nbsp; I know I saved about 25% of time because I
didn't have to right all of the redundant DAL code.&amp;nbsp; Cool stuff!
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://codesmartnothard.com/content/binary/SubsonicPresentation.zip"&gt;SubsonicPresentation.zip
(406.66 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Also check out the new Subsonic Website
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://subsonicproject.com/"&gt;http://subsonicproject.com/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Mike
&lt;/p&gt;
&lt;p&gt;
CodeSmartNotHard
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,598e6f9b-1e55-4c90-8ae2-4c70a16a2b1f.aspx</comments>
      <category>Code Generation;SubSonic</category>
    </item>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=ea138e37-fb83-47b3-bbf8-b0ee5c27044f</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,ea138e37-fb83-47b3-bbf8-b0ee5c27044f.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,ea138e37-fb83-47b3-bbf8-b0ee5c27044f.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ea138e37-fb83-47b3-bbf8-b0ee5c27044f</wfw:commentRss>
      <title>CSLA.NET Dynamic Validation Rules</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,ea138e37-fb83-47b3-bbf8-b0ee5c27044f.aspx</guid>
      <link>http://codesmartnothard.com/CSLANETDynamicValidationRules.aspx</link>
      <pubDate>Sat, 21 Jul 2007 20:50:13 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Our business problem:&lt;/b&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;We
have properties that are required only when the status code is particular statuses.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
caused us to look at how to dynamically add/remove Validation Rules.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Here’s a small example of the different pieces.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I
can’t include the full class because my work doesn’t like me to post that much code.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
should show you the main parts.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;The
only change to CSLA.NET that I can remember is that we had to make the ValidationRules
public so we could call the AddRule and DeleteRule from outside the business object.&amp;nbsp;&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color=#000000&gt;In
the Extended Property of the FullName column:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;font size=2&gt;Name&lt;/font&gt; &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;font face=Calibri&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;IsRequiredForStatus&lt;br&gt;
&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;font face=Calibri&gt;Value&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; =
Codes.Status.Complete&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Property is generated like this:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;IsRequiredForStatus(Codes.Status.Complete)&amp;gt;
_&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overridable&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;font color=#000000&gt; FullName() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;In the “set” of the nogen Status property (which is of type &lt;font face=Verdana&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Codes.Status&lt;/span&gt; &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;enumeration),
it calls the function to check the attributes.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
calls the EVIL attributes to process the rules:&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;RunValidationAttributes()&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="mso-bidi-font-family: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;In
the Validator, it uses reflection to get all of the properties of the object. It loops
through each of the properties and checks to see if any of the attributes are of type
VBEvilBaseAttribute.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;If so then it calls
the ProcessRule of that attribute class such as “IsRequiredForStats”.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; IsRequiredForStatus&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; VBEvilBaseAttribute&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; ProcessRule(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; pi &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; PropertyInfo, 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; entity &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;&lt;font color=#000000&gt;) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Boolean&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: black; mso-bidi-font-family: 'Courier New'; mso-no-proof: yes; mso-themecolor: text1"&gt;If
the property’s attribute enumeration value matches the enumeration of the Status property
then it’s required.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The logic below is
done for each datatype.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;If&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; IsRequired &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; pi.PropertyType &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Is&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;GetType&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; args &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; Csla2.Validation.RuleArgs(pi.Name)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;args.Description
= pi.Name &amp;amp; &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;" is required for this status."&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;args.Severity
= Csla2.Validation.RuleSeverity.FailsCustomRules&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;busObject.ValidationRules.AddRule(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;AddressOf&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;Csla2.Validation.CommonRules.StringRequired,
args)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;Else&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; pi.PropertyType &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Is&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;GetType&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;busObject.ValidationRules.DeleteRule(pi.Name, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"StringRequired"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;If you have any questions, comments, or better ideas, please let
me know.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I always like to hear ideas
for using CSLA.NET. I would like to thank Dave Cottle.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;He
is the one that figured out a lot details to make this work.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
Mike
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
Code Smart Not Hard
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=ea138e37-fb83-47b3-bbf8-b0ee5c27044f" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,ea138e37-fb83-47b3-bbf8-b0ee5c27044f.aspx</comments>
      <category>Code Generation;CSLA.NET</category>
    </item>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=63b956e6-11f2-4ed8-91ed-2fa992045df5</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,63b956e6-11f2-4ed8-91ed-2fa992045df5.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,63b956e6-11f2-4ed8-91ed-2fa992045df5.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=63b956e6-11f2-4ed8-91ed-2fa992045df5</wfw:commentRss>
      <title>Turning DataObjects into BusinessObjects</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,63b956e6-11f2-4ed8-91ed-2fa992045df5.aspx</guid>
      <link>http://codesmartnothard.com/TurningDataObjectsIntoBusinessObjects.aspx</link>
      <pubDate>Sat, 09 Jun 2007 03:54:10 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Objects that are tightly coupled to the table that they reflect
can be referred to as DataObjects.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;BusinessObjects,
however are objects that represent a logic unit contain the attributes and methods
of the business object.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Using CSLA.NET,
CodeSmith Tools for code generation, and partial classes in .NET 2.0 we are able to
take the benefits of code generation and a straightforward DAL with the flexibility
and options needed for designing Business Objects.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Below
are some of the features of my templates that allow me to generate my Business Objects
based on table schema but still allow flexibility&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;Partial
Classes&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Partial Classes is a key feature to my entire code generation
process. The golden rule for generating code is to “Never edit generated code”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;With
partial classes this is easy.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;All of
my custom functionality can be put in to my “NoGen” partial class file.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;All
of the other features actually contol how and what is generated but I included partial
classes because it really is fundamental to code generation and allows unlimited custom
functionality added to a pure DataObject.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;font color=#000000&gt;Foreign Key Fields&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;This started out a way to display both the key and value data
of a code in a particular row.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;For example
if I had an Employee table with a RoleID column, I could add a RoleName “Foreign Key
Field” to the template properties.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
would generate the property just like it was a column in the table.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It
is really handy for binding drop down lists to your business object and wanting to
display the text value somewhere else without having to go look it up again.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
feature started out as always generating the property as a string and has grown into
a delimited array where I specify the column and the datatype.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Keep
in mind this will generate code for the fetch, update, and insert logic.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;font color=#000000&gt;Require Gen &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;Column&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Sometimes I don’t want the property to be generated but I still
want the fetch, insert, and update data portal functions generated.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;In
this case, I specify in my template properties, to skip particular property generation.
Then I can create the custom property in the no-gen partial class. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;One
example for this is if you have a lookup id field in your table and want the property
to be an enumeration instead of an integer.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;font color=#000000&gt;“GenOnly” Tables&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;“GenOnly” tables are tables that I create to base my object when
the data isn’t in the format I want the data displayed.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;For
example I had a table with 6 columns each with a date.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;If
I bound this to a grid, each data for a particular row would display across in column
s.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;However the users wanted to see each
date in its own row.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I couldn’t change
the format the data is stored, so I created a “GenOnly” table with the schema in the
format I wanted.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;MyDates Table&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;MyDateID&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Year1Date&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Year2Date&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Year3Date&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Year4Date&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Year5Date&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Year6Date&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;GenOnly_MyDates&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;MyDateID&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;YearNumber&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2"&gt;
&lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&lt;font size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;YearDate&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Now I can use my templates to generate my readonly collection
and object classes based on the “GenOnly” table.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I
then create the SELECT stored procedure to pivot the data into the format of my objects.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Lastly
I can load the objects and bind it to my grid so the data displays down.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;In
this example the data is readonly so I didn’t need to worry about deletes and updates.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;However,
if I needed to that I could create the UPDATE and DELETE procs to use a CASE statement
or some dynamic SQL.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;I like to think you can get the best of both worlds in using a
code generator to generate your objects based on table schema but still have some
flexibility because something will be different.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Code Smart Not Hard&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font color=#000000&gt;Mike&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=63b956e6-11f2-4ed8-91ed-2fa992045df5" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,63b956e6-11f2-4ed8-91ed-2fa992045df5.aspx</comments>
      <category>Code Generation;CSLA.NET</category>
    </item>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=b2dc8b02-8147-43de-bf5b-157edc2a7b85</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,b2dc8b02-8147-43de-bf5b-157edc2a7b85.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,b2dc8b02-8147-43de-bf5b-157edc2a7b85.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b2dc8b02-8147-43de-bf5b-157edc2a7b85</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
SubSonic 2.0 Beta 1 is released on CodePlex.  SubSonic is a Ruby on Rails like
implemention in ASP.NET.  It combines the best of both worlds for a really cool
code generation/object framework.  Download it here.  <a href="http://www.codeplex.com/actionpack">http://www.codeplex.com/actionpack</a></p>
        <p>
I just downloaded it.  I'll have some more to report in a couple days after playing
with it.
</p>
        <p>
Code Smart Not Hard
</p>
        <p>
-Mike
</p>
        <img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=b2dc8b02-8147-43de-bf5b-157edc2a7b85" />
      </body>
      <title>SubSonic 2.0 Beta 1 is released</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,b2dc8b02-8147-43de-bf5b-157edc2a7b85.aspx</guid>
      <link>http://codesmartnothard.com/SubSonic20Beta1IsReleased.aspx</link>
      <pubDate>Thu, 12 Apr 2007 03:05:45 GMT</pubDate>
      <description>&lt;p&gt;
SubSonic 2.0 Beta 1 is released on CodePlex.&amp;nbsp; SubSonic is a Ruby on Rails like
implemention in ASP.NET.&amp;nbsp; It combines the best of both worlds for a really cool
code generation/object framework.&amp;nbsp; Download it here.&amp;nbsp; &lt;a href="http://www.codeplex.com/actionpack"&gt;http://www.codeplex.com/actionpack&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I just downloaded it.&amp;nbsp; I'll have some more to report in a couple days after playing
with it.
&lt;/p&gt;
&lt;p&gt;
Code Smart Not Hard
&lt;/p&gt;
&lt;p&gt;
-Mike
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=b2dc8b02-8147-43de-bf5b-157edc2a7b85" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,b2dc8b02-8147-43de-bf5b-157edc2a7b85.aspx</comments>
      <category>Code Generation;SubSonic</category>
    </item>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=883fb27f-2d4e-4a44-8f69-45ff48324b1f</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,883fb27f-2d4e-4a44-8f69-45ff48324b1f.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,883fb27f-2d4e-4a44-8f69-45ff48324b1f.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=883fb27f-2d4e-4a44-8f69-45ff48324b1f</wfw:commentRss>
      <title>Code Generation – It’s time to ask your boss for a raise!</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,883fb27f-2d4e-4a44-8f69-45ff48324b1f.aspx</guid>
      <link>http://codesmartnothard.com/CodeGenerationItsTimeToAskYourBossForARaise.aspx</link>
      <pubDate>Sun, 25 Mar 2007 04:05:20 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Arial&gt;Schedule that meeting to talk to
your boss about a raise.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;a href="http://www.codesmithtools.com"&gt;&lt;font face=Arial&gt;CodeSmith
Tools&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial&gt; will show you exactly how much it is saving your
company.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Well almost. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;If
you pull up the About dialog form, it will show you lines it has generated and use
its advanced calculation (Lines generated / Average lines of code per hour) * Average
cost per hour.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As you can see from the
screen shot I have saved my company almost $80K!&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I
don’t think it is too much to ask for just 10% of that &lt;span style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Arial&gt;&lt;span style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;img src="http://codesmartnothard.com/content/binary/AboutCodeSmith.jpg" border=0&gt;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000 size=3&gt;While for new code generation it is more useful,
it keeps adding the lines every time you re-generate the code.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;So
you could sit there and click on the “generate outputs” a few dozen times and easily
add some zeros to the end of that number.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000 size=3&gt;I am a huge believer in code generation.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;My
golden rule for code generation is to never edit generated code, so after you are
done coding, you can reset the counter, re-generate, and then your number should be
a good representation of what you generated and most importantly, your savings!&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;While
you might not get a raise it does show some interesting numbers and its more evidence
to show the benefits of code generation.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000 size=3&gt;Code Smart Not Hard!&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000 size=3&gt;Mike&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=883fb27f-2d4e-4a44-8f69-45ff48324b1f" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,883fb27f-2d4e-4a44-8f69-45ff48324b1f.aspx</comments>
      <category>Code Generation</category>
    </item>
    <item>
      <trackback:ping>http://codesmartnothard.com/Trackback.aspx?guid=19ca6b91-1d6a-4b9e-83a7-c120654e6bf5</trackback:ping>
      <pingback:server>http://codesmartnothard.com/pingback.aspx</pingback:server>
      <pingback:target>http://codesmartnothard.com/PermaLink,guid,19ca6b91-1d6a-4b9e-83a7-c120654e6bf5.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://codesmartnothard.com/CommentView,guid,19ca6b91-1d6a-4b9e-83a7-c120654e6bf5.aspx</wfw:comment>
      <wfw:commentRss>http://codesmartnothard.com/SyndicationService.asmx/GetEntryCommentsRss?guid=19ca6b91-1d6a-4b9e-83a7-c120654e6bf5</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A little over a year ago I presented at the Omaha.NET User Group meeting about using
CSLA.NET and Codesmith.   My team and I have been using these two products
together in a project for over a year now.   I absolutely believe these
two products have contributed to the success of the projects.  
</p>
        <p>
CSLA.NET gives us
</p>
        <ul>
          <li>
Unlimited Undo 
</li>
          <li>
Binding to UI Controls 
</li>
          <li>
Base Collection and Editable Objects with CRUD 
</li>
          <li>
Broken rules notification to client via IDataErrorInfo 
</li>
          <li>
Remoting / Direct Data Access with only config change 
</li>
          <li>
much more!</li>
        </ul>
        <p>
We extended CSLA and features provided by our templates
</p>
        <ul>
          <li>
Standard business rules through extended properties in SQL Server like MinLength,
MaxLength, ReadOnly, IsRequired, etc 
</li>
          <li>
Custom business rules for any property by overriding AddCustomBusinessRules() 
</li>
          <li>
Add any custom code in partial classes 
</li>
          <li>
Parent object can contain 0 to many children collections 
</li>
          <li>
CRUD stored procs are generated 
</li>
          <li>
Load Multiple levels at once so that there is only one round trip to the server 
</li>
          <li>
Created SortedFilteredView object to act like a DataView 
</li>
          <li>
Custom column formatting for grids in our business objects</li>
        </ul>
        <p>
Take a look at the zip file attached.   I included the demo and the slides
I used in the presentation.
</p>
        <p>
          <a href="http://codesmartnothard.com/content/binary/CSLA2Demo.zip">CSLA2Demo.zip (1.34
MB)</a>
        </p>
        <p>
If you have any questions or comments you can email me at  mike *at* doitconsultants.com
</p>
        <p>
Mike
</p>
        <img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=19ca6b91-1d6a-4b9e-83a7-c120654e6bf5" />
      </body>
      <title>CSLA.NET and Codesmith Presentation</title>
      <guid isPermaLink="false">http://codesmartnothard.com/PermaLink,guid,19ca6b91-1d6a-4b9e-83a7-c120654e6bf5.aspx</guid>
      <link>http://codesmartnothard.com/CSLANETAndCodesmithPresentation.aspx</link>
      <pubDate>Fri, 16 Mar 2007 03:44:58 GMT</pubDate>
      <description>&lt;p&gt;
A little over a year ago I presented at the Omaha.NET User Group meeting about using
CSLA.NET and Codesmith.&amp;nbsp;&amp;nbsp; My team and I have been using these two products
together in a project for over a year now.&amp;nbsp;&amp;nbsp; I absolutely believe these
two products have contributed to the success of the projects.&amp;nbsp;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
CSLA.NET gives us
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Unlimited Undo 
&lt;li&gt;
Binding to UI Controls 
&lt;li&gt;
Base Collection and Editable Objects with CRUD 
&lt;li&gt;
Broken rules notification to client via IDataErrorInfo 
&lt;li&gt;
Remoting / Direct Data Access with only config change 
&lt;li&gt;
much more!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
We extended CSLA and features provided by our templates
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Standard business rules through extended properties in SQL Server like MinLength,
MaxLength, ReadOnly, IsRequired, etc 
&lt;li&gt;
Custom business rules for any property by overriding AddCustomBusinessRules() 
&lt;li&gt;
Add any custom code in partial classes 
&lt;li&gt;
Parent object can contain 0 to many children collections 
&lt;li&gt;
CRUD stored procs are generated 
&lt;li&gt;
Load Multiple levels at once so that there is only one round trip to the server 
&lt;li&gt;
Created SortedFilteredView object to act like a DataView 
&lt;li&gt;
Custom column formatting for grids in our business objects&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Take a look at the zip file attached.&amp;nbsp;&amp;nbsp; I included the demo and the slides
I used in the presentation.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://codesmartnothard.com/content/binary/CSLA2Demo.zip"&gt;CSLA2Demo.zip (1.34
MB)&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
If you have any questions or comments you can email me at&amp;nbsp; mike *at* doitconsultants.com
&lt;/p&gt;
&lt;p&gt;
Mike
&lt;/p&gt;
&lt;img width="0" height="0" src="http://codesmartnothard.com/aggbug.ashx?id=19ca6b91-1d6a-4b9e-83a7-c120654e6bf5" /&gt;</description>
      <comments>http://codesmartnothard.com/CommentView,guid,19ca6b91-1d6a-4b9e-83a7-c120654e6bf5.aspx</comments>
      <category>Code Generation;CSLA.NET</category>
    </item>
  </channel>
</rss>