<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ZenArchitect.NL (Henk van Dijken)</title>
	
	<link>http://blog.henkvandijken.nl</link>
	<description>the art of model-driven code generation</description>
	<lastBuildDate>Fri, 03 Sep 2010 21:18:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/henkvandijken" /><feedburner:info uri="henkvandijken" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>The Pain Of Model-Driven Template-Based Code Generation Is In The Model</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/3S2F5mjlUoA/</link>
		<comments>http://blog.henkvandijken.nl/2010/09/the-pain-of-model-driven-template-based-code-generation-is-the-model/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 21:15:51 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.henkvandijken.nl/2010/09/the-pain-of-model-driven-template-based-code-generation-is-the-model/</guid>
		<description><![CDATA[TweetTemplate-based code generation in fact is pretty easy. It very much resembles ordinary mail merge. You create some (sophisticated) template, fill in all the black holes with metadata from the model, and voila! All code is generated automagically. A happy ending. But no, often that is not the case. The pain is always in the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F&amp;count=none&amp;via=henkvandijken&amp;text=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>Template-based code generation in fact is pretty easy. It very much resembles ordinary mail merge. You create some (sophisticated) template, fill in all the black holes with metadata from the model, and voila! </p>
<p>All code is generated automagically. A happy ending.</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/09/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/09/image_thumb.png" width="486" height="284"></a></p>
<p>But no, often that is not the case. The pain is always in the model. Unfortunately, it is not rich enough in its metadata.</p>
<p>I love UML for communicating, but (natively) it is not rich enough for code generation. Did you ever tried to model a string that must have a length between 5 and 10? Not easy! </p>
<p>That’s why I mostly use a data model &#8211; or some slick derivative &#8211; as the data providing model.</p>
<p>The Entity Framework is a fine derivative. In fact, it is nothing more than a proprietary class diagram linked to the underlying data model. Microsoft, well done!</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F&amp;title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F&amp;title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F&amp;title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F&amp;headline=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F&amp;title=The+Pain+Of+Model-Driven+Template-Based+Code+Generation+Is+In+The+Model&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F09%2Fthe-pain-of-model-driven-template-based-code-generation-is-the-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/3S2F5mjlUoA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/09/the-pain-of-model-driven-template-based-code-generation-is-the-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/09/the-pain-of-model-driven-template-based-code-generation-is-the-model/</feedburner:origLink></item>
		<item>
		<title>Generating Business Entities from a Database Model</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/rfzJKBZaW6E/</link>
		<comments>http://blog.henkvandijken.nl/2010/07/generating-business-entities-from-a-database-model/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 20:01:56 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Code Generation]]></category>
		<category><![CDATA[Business Entities]]></category>

		<guid isPermaLink="false">http://blog.henkvandijken.nl/2010/07/generating-business-entities-from-a-database-model/</guid>
		<description><![CDATA[TweetAfter Generating Database Objects from an UML Model you are desperately in need of a data access layer (DAL) and a business logic layer (BLL). Today we are going to generate the famous Business Entities. After executing that funny sql-script we generated from UML previously, you are the proud owner of a database. Since I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F&amp;count=none&amp;via=henkvandijken&amp;text=Generating+Business+Entities+from+a+Database+Model+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>After <a href="http://blog.henkvandijken.nl/2010/06/generating-database-objects-from-an-uml-model-part-1/">Generating Database Objects from an UML Model</a> you are desperately in need of a data access layer (DAL) and a business logic layer (BLL). Today we are going to generate the famous Business Entities.</p>
<p>After executing that funny sql-script we generated from UML previously, you are the proud owner of a database. Since I am a great fan of <a href="http://www.mygenerationsoftware.com/">MyGeneration</a> we will use a similar approach and scrape the meta model from the database.</p>
<p>To be able to do so, the code generator needs some input. First, it has to know which tables must be read (filter) and where to find the tables (database) to extract meta data from.</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/07/image451.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/07/image45_thumb1.png" width="502" height="46"></a> </p>
<p>At this point the generator has enough information to read the data model and generate code. The list of tables are traversed and classes are created. Within each table the meta data of its columns are extracted.</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/07/image181.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/07/image18_thumb1.png" width="500" height="447"></a> </p>
<p>Since we – at this moment – are not able to automagically convert data types, we also need a support routine for conversion of database type to its C#.NET equivalent. This is done by append some script to the template.</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/07/image291.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/07/image29_thumb1.png" width="498" height="291"></a> </p>
<p>Finally, using this template, the following code is generated from the selected data model.</p>
<pre class="csharp" name="code">/*------------------------------------------------------------------------------
// &lt;auto-generated&gt;
//     This code was generated by a tool.
//     ZaosGenerator Version: 1.0.0.0
//     Template Author      : Henk van Dijken
//     Generation Date      : 29-7-2010 21:12:15
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// &lt;/auto-generated&gt;
//----------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;

namespace ZenArchitect2.BusinessEntities
{
	public partial class TestParent
	{
		public TestParent() {}

		private int TestParentIDField;
		public int TestParentID
		{
			get { return this.TestParentIDField; }
			set { this.TestParentIDField = value; }
		}

		private string TestParentName1Field;
		public varchar TestParentName1
		{
			get { return this.TestParentName1Field; }
			set { this.TestParentName1Field = value; }
		}

		private int TestParentNumberField;
		public int TestParentNumber
		{
			get { return this.TestParentNumberField; }
			set { this.TestParentNumberField = value; }
		}

	}

	public partial class TestChild
	{
		public TestChild() {}

		private int TestChildIDField;
		public int TestChildID
		{
			get { return this.TestChildIDField; }
			set { this.TestChildIDField = value; }
		}

		private int TestParentIDField;
		public int TestParentID
		{
			get { return this.TestParentIDField; }
			set { this.TestParentIDField = value; }
		}

		private string TestChildNameField;
		public varchar TestChildName
		{
			get { return this.TestChildNameField; }
			set { this.TestChildNameField = value; }
		}

	}

}</pre>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F&amp;title=Generating+Business+Entities+from+a+Database+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F&amp;title=Generating+Business+Entities+from+a+Database+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F&amp;title=Generating+Business+Entities+from+a+Database+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F&amp;headline=Generating+Business+Entities+from+a+Database+Model" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Generating+Business+Entities+from+a+Database+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Generating+Business+Entities+from+a+Database+Model&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Generating+Business+Entities+from+a+Database+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Generating+Business+Entities+from+a+Database+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Generating+Business+Entities+from+a+Database+Model&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F&amp;title=Generating+Business+Entities+from+a+Database+Model&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F07%2Fgenerating-business-entities-from-a-database-model%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/rfzJKBZaW6E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/07/generating-business-entities-from-a-database-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/07/generating-business-entities-from-a-database-model/</feedburner:origLink></item>
		<item>
		<title>Validation Framework – Enterprise Library Validation Block</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/YL_szEXxxqQ/</link>
		<comments>http://blog.henkvandijken.nl/2010/06/validation-framework-enterprise-library-validation-block/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 21:58:12 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Enterprise Library]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/?p=530</guid>
		<description><![CDATA[TweetIn previous posts I wrote about validation AOP-style, using Policy Injection or Depency Injection (Unity). I am a true believer that this form of validation is the way to go. That said, what kind of validation do you really need? User Input Validation is probably the first thing that pops up into your mind, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F&amp;count=none&amp;via=henkvandijken&amp;text=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>In previous<a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image_thumb4.png" width="260" height="153" /></a> posts I wrote about validation AOP-style, using <a href="http://www.zenarchitect.nl/2009/07/how-to-aop-validation-with-policy-injection/">Policy Injection</a> or <a href="http://www.zenarchitect.nl/2009/07/how-to-aop-validation-with-unity/">Depency Injection</a> (Unity). I am a true believer that this form of validation is the way to go. </p>
<p>That said, what kind of validation do you really need?</p>
<p>User Input Validation is probably the first thing that pops up into your mind, and that is indeed an important one. But, in fact, validation can be applied to almost every layer. That’s why they call it a cross cutting concern and AOP makes sense.</p>
<p>That’s not what I mean. I am talking about using validators here. You probably know the available ASP.NET validators, like shown in above picture.</p>
<p>But you know what? Although User Input Validation is important, sooner or later the data will be persisted to a database. And if your database accepts <em>varchar(10)</em> only, then <em>“Thunderbird” </em>is not such a good idea to type.</p>
<p>In short, you are in need of a <strong>StringLengthValidator.</strong></p>
<p>Of course you can create you own <a href="http://www.zenarchitect.nl/2010/05/simple-validation-rules-engine/">simple validation rules engine</a>, but fortunately it is also an out-of-the-box validator of Microsoft’s <a href="http://msdn.microsoft.com/en-us/library/ff664356(v=PandP.50).aspx">validation block</a>.</p>
<p>Difficult? Not at all, when following these simple steps:</p>
<ol>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=bcb166f7-dd16-448b-a152-9845760d9b4c&amp;displaylang=en">Download</a> and install Microsoft Enterprise Library 5.0 </li>
<li>Create a project </li>
<li>Add a reference to the assemblies <em>“Enterprise Library Validation Application Block”</em> and – not to forget – <em>“System.ComponentModel.DataAnnotations”</em> </li>
<li>In your class, add the namespace: Microsoft.Practices.EnterpriseLibrary.Validation, et voilá </li>
</ol>
<pre class="csharp" name="code">using System;

using Microsoft.Practices.EnterpriseLibrary.Validation;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

public class Customer
{
    [StringLengthValidator(0, 10)]
    public string CustomerName;

    public Customer(string name)
    {
        this.CustomerName = name;
    }
}

class Program
    {
        static void Main(string[] args)
    {
        Customer customer = new Customer(&quot;Thunderbird&quot;);
        Validator&lt;Customer&gt; validator = ValidationFactory.CreateValidator&lt;Customer&gt;();

        ValidationResults results = validator.Validate(customer);
        if (!results.IsValid)
        {
            foreach (ValidationResult result in results)
            {
                Console.WriteLine(result.Message);
            }
        }
    }
}</pre>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F&amp;title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F&amp;title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F&amp;title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F&amp;headline=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F&amp;title=Validation+Framework+%E2%80%93+Enterprise+Library+Validation+Block&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fvalidation-framework-enterprise-library-validation-block%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/YL_szEXxxqQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/06/validation-framework-enterprise-library-validation-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/06/validation-framework-enterprise-library-validation-block/</feedburner:origLink></item>
		<item>
		<title>Perspectives in Software Architecture Quality</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/T6oeEgwA2Jg/</link>
		<comments>http://blog.henkvandijken.nl/2010/06/perspectives-in-software-architecture-quality/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 11:10:00 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[software architecture]]></category>
		<category><![CDATA[software quality]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/2010/06/perspectives-in-software-architecture-quality/</guid>
		<description><![CDATA[TweetRecently, I followed a discussion about quality of software in zombie mode. Please do understand that not the software &#8211; but I &#8211; was in zombie mode. The question under discussion was: who is to blame for poor software quality? Is it the business, with their vague requirements? Or maybe the (project)managers, who only care [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F&amp;count=none&amp;via=henkvandijken&amp;text=Perspectives+in+Software+Architecture+Quality+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>Recently, I followed a discussion about quality of software in zombie mode. Please do understand that not the software &#8211; but I &#8211; was in zombie mode. </p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="left" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image_thumb3.png" width="466" height="206" /></a>The question under discussion was: who is to blame for <strong>poor software quality</strong>?</p>
<p>Is it the business, with their vague requirements? Or maybe the (project)managers, who only care for budget and scope? In any case the coders are to blame, are they? </p>
<p>Maybe all of the aforementioned?</p>
<p>Personally, I am a (sort of) believer in <a href="http://en.wikipedia.org/wiki/Theory_of_Constraints">Goldratt his theory of constraints</a>, so the answer would be obvious. Loss of quality adds well to the pile of crap.</p>
<p>However, what first struck me was the omission of software architects (and testers). The omission suggests that there is no role for software architects in quality? Strange.</p>
<p>Therefore I would say: no wonder it is of poor quality, there is no software architect involved as a <strong>technical conscience</strong>. On the other hand, technique plays &#8211; of course &#8211; only a small part in the whole software development process. For creating quality software, all perspectives must thus be taken into account. </p>
<p>True. But what is the definition of quality code? </p>
<p>From a technical viewpoint you can have <strong>high-quality software</strong>, whilst from a business perspective the software doesn’t solve the problem that the business is looking for. The other way around can also be true.</p>
<p>Therefore, the motto of today: </p>
<blockquote><p>Although the software is crappy, the business still can be happy!</p>
</blockquote>
<p>That’s the power of a good UI/UX. Apple does understand this very well.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F&amp;title=Perspectives+in+Software+Architecture+Quality" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F&amp;title=Perspectives+in+Software+Architecture+Quality" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F&amp;title=Perspectives+in+Software+Architecture+Quality" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F&amp;headline=Perspectives+in+Software+Architecture+Quality" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Perspectives+in+Software+Architecture+Quality&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Perspectives+in+Software+Architecture+Quality&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Perspectives+in+Software+Architecture+Quality&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Perspectives+in+Software+Architecture+Quality&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Perspectives+in+Software+Architecture+Quality&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F&amp;title=Perspectives+in+Software+Architecture+Quality&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fperspectives-in-software-architecture-quality%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/T6oeEgwA2Jg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/06/perspectives-in-software-architecture-quality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/06/perspectives-in-software-architecture-quality/</feedburner:origLink></item>
		<item>
		<title>Generating Database Objects from an UML Model – Part 1</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/kS_90ipWVQo/</link>
		<comments>http://blog.henkvandijken.nl/2010/06/generating-database-objects-from-an-uml-model-part-1/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 08:37:46 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Code Generation]]></category>
		<category><![CDATA[datamodel]]></category>
		<category><![CDATA[SQL Database]]></category>
		<category><![CDATA[UML]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/2010/06/generating-database-objects-from-an-uml-model-part-1/</guid>
		<description><![CDATA[TweetIn this mini-series of one post, I’ll show you how to generate SQL-script from an UML model. First, you need a model. This can be any model, but here I use an UML model. The class diagram on the left shows a simple model consisting of a parent class and a related child class. Both [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F&amp;count=none&amp;via=henkvandijken&amp;text=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image2.png"><img style="display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;" title="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image_thumb2.png" border="0" alt="image" width="252" height="302" align="left" /></a>In this mini-series of one post, I’ll show you how to generate SQL-script from an UML model.</p>
<p>First, you need a model. This can be any model, but here I use an UML model. The class diagram on the left shows a simple model consisting of a parent class and a related child class. Both are stereotyped &lt;&lt;table&gt;&gt; so you can see we are talking about a data model.</p>
<p>Both have some attributes. Note that their types have been declared explicitly.</p>
<p>The interesting part is their association. As you can see it is a traditional master-detail relationship. For clarity I have named the association and both association ends, but the latter is not strictly necessary.</p>
<p>This UML diagram can be represented in the following XML form:</p>
<pre class="xml" name="code">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;EntityModel&gt;
  &lt;Entity Name="TestParent"&gt;
    &lt;Property Name="TestParentName1" Type="String" /&gt;
    &lt;Property Name="TestParentNumber" Type="Integer" /&gt;
  &lt;/Entity&gt;
  &lt;Entity Name="TestChild"&gt;
    &lt;Property Name="TestChildName" Type="String" /&gt;
  &lt;/Entity&gt;
  &lt;Association Name="FK_TestParent_TestChild"&gt;
    &lt;End Name="TestParent_End" Role="TestParent" Multiplicity="0..1" /&gt;
    &lt;End Name="TestChild_End" Role="TestChild" Multiplicity="*" /&gt;
  &lt;/Association&gt;
&lt;/EntityModel&gt;</pre>
<p>Why that is interesting? That is because XML easily can be transformed into something useful.</p>
<p>For performing the actual transformation you can use, for example:</p>
<ol>
<li>XSLT stylesheet-driven transformation</li>
<li>template-driven code generator</li>
<li>code using XmlSerializer or XmlReader</li>
</ol>
<p>Thus, it is transformed into a sql-script.</p>
<pre class="sql" name="code">/****** Table [dbo].[TestParent] ******/
CREATE TABLE [dbo].[TestParent](
	[TestParentID] [int] IDENTITY(1,1) NOT NULL,
	[TestParentName1] [varchar](MAX) NULL,
	[TestParentNumber] [int] NULL,
 CONSTRAINT [PK_ParentTable] PRIMARY KEY CLUSTERED ([TestParentID] ASC)
)
GO
/****** Table [dbo].[TestChild] ******/
CREATE TABLE [dbo].[TestChild](
	[TestChildID] [int] IDENTITY(1,1) NOT NULL,
	[TestParentID] [int] NULL,
	[TestChildName] [varchar](50) NULL,
 CONSTRAINT [PK_ChildTable] PRIMARY KEY CLUSTERED ([TestChildID] ASC)
)
GO
/****** ForeignKey [FK_TestParent_TestChild] ******/
ALTER TABLE [dbo].[TestChild]
ADD CONSTRAINT [FK_TestParent_TestChild] FOREIGN KEY([TestParentID])
REFERENCES [dbo].[TestParent] ([TestParentID])
GO</pre>
<p>The keen eye will notice that in the final sql-script primary and foreign key columns are introduced, which are not present in the original model (diagram nor xml file). The other way around, specification of associations in the original model is much richer than the resulting foreign key constraint in the sql-script. These “mismatches” must be handled and are typically present when performing O/RM mapping.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F&amp;title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F&amp;title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F&amp;title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F&amp;headline=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F&amp;title=Generating+Database+Objects+from+an+UML+Model+%E2%80%93+Part+1&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fgenerating-database-objects-from-an-uml-model-part-1%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/kS_90ipWVQo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/06/generating-database-objects-from-an-uml-model-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/06/generating-database-objects-from-an-uml-model-part-1/</feedburner:origLink></item>
		<item>
		<title>UML Use Case – Uses or Extends?</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/jOZ4XTbH0vw/</link>
		<comments>http://blog.henkvandijken.nl/2010/06/uml-use-case-uses-or-extends/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 20:27:51 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Model-driven development with UML]]></category>
		<category><![CDATA[extends]]></category>
		<category><![CDATA[UML]]></category>
		<category><![CDATA[use-case diagram]]></category>
		<category><![CDATA[uses]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/2010/06/uml-use-case-uses-or-extends/</guid>
		<description><![CDATA[TweetIf you are a more functional focussed person, you are probably thinking: who cares. And if you are, please tell me why do you functional people talk so much with such a low information density? Is it thinking out loud? Okay. Back to topic. If you are a technical übermensch – like yours truly – [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F&amp;count=none&amp;via=henkvandijken&amp;text=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>If you are a more functional focussed person, you are probably thinking: who cares. And if you are, please tell me why do you functional people talk so much with such a low information density? Is it thinking out loud?</p>
<p>Okay. Back to topic.</p>
<p>If you are a technical übermensch – like yours truly – you probably sh*t on people who do not see the delicate difference between a uses and an extends relationship.</p>
<p>In short, a tiny refresher for your brain.</p>
<ul>
<li>Uses (formerly known as include) indicates a “<strong>has a</strong>” relationship, and</li>
<li>Extends (formerly known as extend) indicates an “<strong>is a</strong>” relationship</li>
</ul>
<p>.<a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image.png"><img style="display: inline; border: 0px;" title="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image_thumb.png" border="0" alt="image" width="375" height="231" /></a></p>
<p>As you can see I still use pre-historic diagramming. Not only because I am wise and therefore somewhat older(fashioned), but merely because I use a freely available and (almost) open source diagramming tool <a href="http://staruml.sourceforge.net/">StarUML</a>. This tool unfortunately stuck at UML v1.3 Notwithstanding, an excellent tool.</p>
<p>Translated to a real world situation:</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image1.png"><img style="display: inline; border: 0px;" title="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/06/image_thumb1.png" border="0" alt="image" width="381" height="235" /></a> If you are a car driver you want to drive a car. Something you must include at least once is to start the engine. An extension of driving a car is driving a formula 1 car, which indeed is something very special.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F&amp;title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F&amp;title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F&amp;title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F&amp;headline=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F&amp;title=UML+Use+Case+%26%238211%3B+Uses+or+Extends%3F&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F06%2Fuml-use-case-uses-or-extends%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/jOZ4XTbH0vw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/06/uml-use-case-uses-or-extends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/06/uml-use-case-uses-or-extends/</feedburner:origLink></item>
		<item>
		<title>Simple Validation Rules Engine</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/_KBL5QhmpfY/</link>
		<comments>http://blog.henkvandijken.nl/2010/05/simple-validation-rules-engine/#comments</comments>
		<pubDate>Thu, 06 May 2010 18:31:35 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Facade Design Pattern]]></category>
		<category><![CDATA[Factory Design Pattern]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/?p=464</guid>
		<description><![CDATA[TweetSometimes, you want to do some simple validation. For example, data should not exceed the reserved storage size for the field in the database. In this example CustomerName must be less than 10 characters. So, the client code should look like this: Customer customer = new Customer(); // customer name must be less than 10 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F&amp;count=none&amp;via=henkvandijken&amp;text=Simple+Validation+Rules+Engine+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>Sometimes, you want to do some simple validation. For example, data should not exceed the reserved storage size for the field in the database.</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/05/image.png"><img style="display: inline; border-width: 0px;" title="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/05/image_thumb.png" border="0" alt="image" width="351" height="110" /></a></p>
<p>In this example CustomerName must be less than 10 characters. So, the client code should look like this:</p>
<pre class="csharp" name="code">Customer customer = new Customer();

// customer name must be less than 10 characters
customer.CustomerName = this.textBox1.Text;

// Validation facade
ValidationResults results = Validation.Validate&lt;Customer&gt;(customer);

// populate listbox with validation results
foreach (ValidationResult result in results)
{
    this.listBox1.Items.Add(result.Message);
}</pre>
<p>The customer name is filled with input from a textbox. The complete customer object is validated using a validation facade. Finally, a list box is populated with the validation results.</p>
<p>Use of a facade simplifies use of validation in the client. The facade itself looks like this:</p>
<pre class="csharp" name="code">public static class Validation
{
    public static ValidationResults Validate&lt;T&gt;(T validationobject)
    {
        Validator&lt;T&gt; validator = ValidationFactory.CreateValidator&lt;T&gt;();
        ValidationResults results = validator.Validate(validationobject);

        return results;
    }
}</pre>
<p>But wait! This looks exactly like the Validation Application Block. That’s a coincidence!</p>
<p>Indeed. Since the callings are similar you easily can replace the plumbing with the real stuff later on if you want.</p>
<p>But be aware that there is a small difference. This simplified version does not use attributes, but self validation by implementing an ISelfValidation interface.</p>
<pre class="csharp" name="code">public interface ISelfValidation
{
    void Validate(ValidationResults results);
}</pre>
<p>The object in question implements ISelfValidation as follows:</p>
<pre class="csharp" name="code">class Customer : ISelfValidation
{
    public string CustomerName { get; set; }

    public void Validate(ValidationResults results)
    {
        int maxLength = 10;
        string validationString = CustomerName;

        ValidateStringLength(results, validationString, maxLength);
    }

    // this can be put into a helper class if you want
    private static void ValidateStringLength(ValidationResults results, string validationstring, int maxlength)
    {
        if (validationstring.Length &gt; maxlength)
        {
            results.Add(new ValidationResult(String.Format("Length must be less than {0}", maxlength)));
        }
    }
}</pre>
<p>This way simple validation becomes very easy. So, kids please do try this at home.</p>
<p>Download(s) : [Download not found]</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F&amp;title=Simple+Validation+Rules+Engine" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F&amp;title=Simple+Validation+Rules+Engine" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F&amp;title=Simple+Validation+Rules+Engine" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F&amp;headline=Simple+Validation+Rules+Engine" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Simple+Validation+Rules+Engine&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Simple+Validation+Rules+Engine&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Simple+Validation+Rules+Engine&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Simple+Validation+Rules+Engine&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Simple+Validation+Rules+Engine&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F&amp;title=Simple+Validation+Rules+Engine&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F05%2Fsimple-validation-rules-engine%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/_KBL5QhmpfY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/05/simple-validation-rules-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/05/simple-validation-rules-engine/</feedburner:origLink></item>
		<item>
		<title>Microsoft SQL Database Analysis – SqlCop</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/l9mxy-pwtg8/</link>
		<comments>http://blog.henkvandijken.nl/2010/04/microsoft-sql-database-analysis-sqlcop/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 19:11:05 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[SQL Database]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/2010/04/microsoft-sql-database-analysis-sqlcop/</guid>
		<description><![CDATA[TweetDo you know FxCop? FxCop is an application that analyzes managed code assemblies. Many of the issues concern violations of the programming and design rules set forth in Design Guidelines. Today, I announce my wish for an equivalent for SQL Database Analysis. As it happens over time a database structure grows, and grows. Sometimes, it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F&amp;count=none&amp;via=henkvandijken&amp;text=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/04/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/04/image_thumb2.png" width="179" height="240" /></a>Do you know <a href="http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx">FxCop</a>? </p>
<p>FxCop is an application that analyzes managed code assemblies. Many of the issues concern violations of the programming and design rules set forth in Design Guidelines.</p>
<p>Today, I announce my wish for an equivalent for SQL Database Analysis.</p>
<p>As it happens over time a database structure grows, and grows. Sometimes, it grows like wild grass. At other times, the database is restructured by someone who smoked to much wild grass.</p>
<p>There are two problems here:</p>
<ol>
<li>it is difficult to know in which shape the database its structure is,</li>
<li>you are desperately in ***need** of serious tooling.</li>
</ol>
<p>For .NET code you can use FxCop or StyleCop, but serious tooling is lacking for databases.</p>
<p>Therefore &#8211; all you tool belt lovers – lets unite and demand for a tool called <strong>SqlCop</strong>.</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/04/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/04/image_thumb3.png" width="579" height="328" /></a></p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F&amp;title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F&amp;title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F&amp;title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F&amp;headline=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F&amp;title=Microsoft+SQL+Database+Analysis+%E2%80%93+SqlCop&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fmicrosoft-sql-database-analysis-sqlcop%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/l9mxy-pwtg8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/04/microsoft-sql-database-analysis-sqlcop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/04/microsoft-sql-database-analysis-sqlcop/</feedburner:origLink></item>
		<item>
		<title>The MySQL Craftsman’s Tool Belt</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/lVFLcLuYAZA/</link>
		<comments>http://blog.henkvandijken.nl/2010/04/the-mysql-craftsmans-tool-belt/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 10:11:54 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Microsoft SQL]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/2010/04/the-mysql-craftsmans-tool-belt/</guid>
		<description><![CDATA[TweetTo start with, you are desperately in need of a database migration toolkit. That’s all.]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F&amp;count=none&amp;via=henkvandijken&amp;text=The+MySQL+Craftsman%E2%80%99s+Tool+Belt+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>To start with, you are desperately in need of a database migration toolkit.</p>
<p><a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/04/image1.png"><img style="display: inline; border: 0px;" title="MySQL" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/04/image_thumb1.png" border="0" alt="MySQL" width="595" height="165" /></a></p>
<p>That’s all.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F&amp;title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F&amp;title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F&amp;title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F&amp;headline=The+MySQL+Craftsman%E2%80%99s+Tool+Belt" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=The+MySQL+Craftsman%E2%80%99s+Tool+Belt&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F&amp;title=The+MySQL+Craftsman%E2%80%99s+Tool+Belt&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F04%2Fthe-mysql-craftsmans-tool-belt%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/lVFLcLuYAZA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/04/the-mysql-craftsmans-tool-belt/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/04/the-mysql-craftsmans-tool-belt/</feedburner:origLink></item>
		<item>
		<title>Generating a Graphical User Interface</title>
		<link>http://feedproxy.google.com/~r/henkvandijken/~3/m2KlsKeh-pM/</link>
		<comments>http://blog.henkvandijken.nl/2010/03/generating-a-graphical-user-interface/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 21:08:38 +0000</pubDate>
		<dc:creator>Henk van Dijken</dc:creator>
				<category><![CDATA[Code Generation]]></category>
		<category><![CDATA[StarUML]]></category>

		<guid isPermaLink="false">http://www.zenarchitect.nl/2010/03/generating-a-graphical-user-interface/</guid>
		<description><![CDATA[TweetRemember my factory method design pattern example to compute the first name and last name from a full name? No? It’s really easy. You only have to provide a full name, like “John Doe” or “Doe, John” and the business logic computes the correct first name and last name. This time we are not interested [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/share?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F&amp;count=none&amp;via=henkvandijken&amp;text=Generating+a+Graphical+User+Interface+-+ZenArchitect.NL+%28Henk+van+Dijken%29" class="twitter-share-button">Tweet</a></p><p>Remember my <a href="http://www.zenarchitect.nl/2009/02/cs-design-patterns-factory-method-pattern/">factory method</a> design pattern example to compute the first name and last name from a full name?</p>
<p><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="generated GUI" border="0" alt="generated GUI" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/03/image_thumb2.png" width="611" height="354" /></p>
</p>
<p>No? It’s really easy. You only have to provide a full name, like “John Doe” or “Doe, John” and the business logic computes the correct first name and last name.</p>
<p>This time we are not interested in the business logic and data binding, but we are going to generate the graphical user interface!</p>
<p>First, we have to model the form. <a href="http://blog.henkvandijken.nl/wp-content/uploads/2010/03/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://blog.henkvandijken.nl/wp-content/uploads/2010/03/image_thumb3.png" width="149" height="174" /></a> We can do that with UML. Use your favorite UML tool (<a href="http://staruml.sourceforge.net/">StarUML</a>), export to XMI. Finally, feed the XMI to a code generator (<a href="http://www.mygenerationsoftware.com">MyGeneration</a>) using the right templates. </p>
<p>That’s all there is!</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F&amp;title=Generating+a+Graphical+User+Interface" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F&amp;title=Generating+a+Graphical+User+Interface" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F&amp;title=Generating+a+Graphical+User+Interface" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F&amp;headline=Generating+a+Graphical+User+Interface" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Generating+a+Graphical+User+Interface&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Generating+a+Graphical+User+Interface&amp;u=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Generating+a+Graphical+User+Interface&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Generating+a+Graphical+User+Interface&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Generating+a+Graphical+User+Interface&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F&amp;title=Generating+a+Graphical+User+Interface&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.henkvandijken.nl%2F2010%2F03%2Fgenerating-a-graphical-user-interface%2F" ><img class="lightsocial_img" src="http://blog.henkvandijken.nl/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div><img src="http://feeds.feedburner.com/~r/henkvandijken/~4/m2KlsKeh-pM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.henkvandijken.nl/2010/03/generating-a-graphical-user-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.henkvandijken.nl/2010/03/generating-a-graphical-user-interface/</feedburner:origLink></item>
	</channel>
</rss>
