<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Stefanseverin's Blog</title>
	<atom:link href="http://stefanseverin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefanseverin.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 27 May 2009 06:01:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='stefanseverin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Stefanseverin's Blog</title>
		<link>http://stefanseverin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://stefanseverin.wordpress.com/osd.xml" title="Stefanseverin&#039;s Blog" />
	<atom:link rel='hub' href='http://stefanseverin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Yes! Oslo May 2009 CTP is out!</title>
		<link>http://stefanseverin.wordpress.com/2009/05/27/yes-oslo-may-2009-ctp-is-out/</link>
		<comments>http://stefanseverin.wordpress.com/2009/05/27/yes-oslo-may-2009-ctp-is-out/#comments</comments>
		<pubDate>Wed, 27 May 2009 06:01:06 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Oslo]]></category>

		<guid isPermaLink="false">http://stefanseverin.wordpress.com/?p=91</guid>
		<description><![CDATA[Go get it here!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=91&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Go get it <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=827122a5-3ca0-4389-a79e-87af37cbf60d&amp;displaylang=en">here</a>!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanseverin.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanseverin.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=91&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanseverin.wordpress.com/2009/05/27/yes-oslo-may-2009-ctp-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd24fe49dedb5287c23963b4690dd072?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IMHO</media:title>
		</media:content>
	</item>
		<item>
		<title>Book tip: RESTful .NET</title>
		<link>http://stefanseverin.wordpress.com/2009/04/26/book-tip-restful-net/</link>
		<comments>http://stefanseverin.wordpress.com/2009/04/26/book-tip-restful-net/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 16:24:06 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Oslo]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://stefanseverin.wordpress.com/2009/04/26/book-tip-restful-net/</guid>
		<description><![CDATA[As I haven’t yet had a lot of exposure to how to build REST Web Services with WCF I was very lucky to find a book called RESTful .NET by Jon Flanders. After reading this book I enjoyed playing around with the MUrl which is a DSL for RESTful clients and I am looking really [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=88&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p align="left">As I haven’t yet had a lot of exposure to how to build REST Web Services with WCF I was very lucky to find a book called <a href="http://oreilly.com/catalog/9780596519209/" target="_blank">RESTful .NET</a> by <a href="http://www.rest-ful.net/blogs/jon/" target="_blank">Jon Flanders</a>. After reading this book I enjoyed playing around with the <a href="http://www.douglaspurdy.com/2009/03/20/murl-a-dsl-for-restful-clients/" target="_blank">MUrl</a> which is a DSL for RESTful clients and I am looking really forward trying out the <a href="http://www.douglaspurdy.com/2009/03/20/mservice-a-dsl-for-restful-services/" target="_blank">MService</a> – a DSL for RESTful services, which I believe will be shipped with the next OSLO CTP?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanseverin.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanseverin.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=88&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanseverin.wordpress.com/2009/04/26/book-tip-restful-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd24fe49dedb5287c23963b4690dd072?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IMHO</media:title>
		</media:content>
	</item>
		<item>
		<title>The M tip of the day: Defining a simple tree</title>
		<link>http://stefanseverin.wordpress.com/2009/03/12/the-m-tip-of-the-day-defining-a-simple-tree/</link>
		<comments>http://stefanseverin.wordpress.com/2009/03/12/the-m-tip-of-the-day-defining-a-simple-tree/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 21:07:48 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Oslo]]></category>
		<category><![CDATA[M]]></category>
		<category><![CDATA[MSchema]]></category>

		<guid isPermaLink="false">http://stefanseverin.wordpress.com/2009/03/12/the-m-tip-of-the-day-defining-a-simple-tree/</guid>
		<description><![CDATA[With a simple tree I mean a self-referencing one-to-many relationship without a strategy to handle cycles between linked instances. An excellent MSDN-article on that subject is found here. &#160; module Tree { &#160;&#160;&#160; type Person &#160;&#160;&#160; { &#160;&#160;&#160;&#160;&#160;&#160;&#160; Id : Integer32 = AutoNumber(); &#160;&#160;&#160;&#160;&#160;&#160;&#160; Name : Text#50; &#160;&#160;&#160;&#160;&#160;&#160;&#160; Parent : Person? where value in People; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=85&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>With a simple tree I mean a self-referencing one-to-many relationship without a strategy to handle cycles between linked instances. An excellent MSDN-article on that subject is found <a href="http://msdn.microsoft.com/sv-se/library/dd326768(en-us,VS.85).aspx" target="_blank">here</a>.</p>
<p>&#160;</p>
<div style="font-family:courier new;background:white;color:black;font-size:10pt;">
<p style="margin:0;"><span style="color:blue;">module</span><span style="color:#006400;"> </span>Tree</p>
<p style="margin:0;">{</p>
<p style="margin:0;"><span style="color:#006400;">&#160;&#160;&#160; </span><span style="color:blue;">type</span><span style="color:#006400;"> </span>Person</p>
<p style="margin:0;"><span style="color:#006400;">&#160;&#160;&#160; </span>{</p>
<p style="margin:0;"><span style="color:#006400;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Id<span style="color:#006400;"> </span>:<span style="color:#006400;"> </span>Integer32<span style="color:#006400;"> </span>=<span style="color:#006400;"> </span>AutoNumber();</p>
<p style="margin:0;"><span style="color:#006400;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Name<span style="color:#006400;"> </span>:<span style="color:#006400;"> </span>Text#<span style="color:maroon;">50</span>;</p>
<p style="margin:0;"><span style="color:#006400;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Parent<span style="color:#006400;"> </span>:<span style="color:#006400;"> </span>Person?<span style="color:#006400;"> </span><span style="color:blue;">where</span><span style="color:#006400;"> </span><span style="color:blue;">value</span><span style="color:#006400;"> </span><span style="color:blue;">in</span><span style="color:#006400;"> </span>People;</p>
<p style="margin:0;"><span style="color:#006400;">&#160;&#160;&#160; </span>}<span style="color:#006400;"> </span><span style="color:blue;">where</span><span style="color:#006400;"> </span><span style="color:blue;">identity</span>(Id);</p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;"><span style="color:#006400;">&#160;&#160;&#160; </span>People<span style="color:#006400;"> </span>:<span style="color:#006400;"> </span>Person*;</p>
<p style="margin:0;">}</p>
</p></div>
<p>This is translated into the following T-SQL:</p>
<p>&#160;</p>
<div style="font-family:courier new;background:white;color:black;font-size:10pt;">
<p style="margin:0;"><span style="color:blue;">create schema </span>[Tree];</p>
<p style="margin:0;"><span style="color:blue;">go</span></p>
<p style="margin:0;">&#160;</p>
<p style="margin:0;"><span style="color:blue;">create table </span>[Tree].[People]</p>
<p style="margin:0;">(</p>
<p style="margin:0;">&#160; [Id] <span style="color:blue;">int not null identity</span>,</p>
<p style="margin:0;">&#160; [Name] nvarchar(50) <span style="color:blue;">not null</span>,</p>
<p style="margin:0;">&#160; [Parent] <span style="color:blue;">int null</span>,</p>
<p style="margin:0;">&#160; <span style="color:blue;">constraint </span>[PK_People] <span style="color:blue;">primary key </span>clustered ([Id]),</p>
<p style="margin:0;">&#160; <span style="color:blue;">constraint </span>[FK_People_Parent_Tree_People] </p>
<p style="margin:0;">&#160; <span style="color:blue;">foreign key </span>([Parent]) references [Tree].[People] ([Id])</p>
<p style="margin:0;">);</p>
<p style="margin:0;"><span style="color:blue;">go</span></p>
</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanseverin.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanseverin.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=85&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanseverin.wordpress.com/2009/03/12/the-m-tip-of-the-day-defining-a-simple-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd24fe49dedb5287c23963b4690dd072?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IMHO</media:title>
		</media:content>
	</item>
		<item>
		<title>The M tip of the day: One-to-Many relationships</title>
		<link>http://stefanseverin.wordpress.com/2009/03/08/the-m-tip-of-the-day-one-to-many-relationships/</link>
		<comments>http://stefanseverin.wordpress.com/2009/03/08/the-m-tip-of-the-day-one-to-many-relationships/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 20:12:35 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Oslo]]></category>
		<category><![CDATA[MSchema]]></category>

		<guid isPermaLink="false">http://stefanseverin.wordpress.com/?p=83</guid>
		<description><![CDATA[&#160; Sometimes relationships can be tricky. But in the fantastic M world they are not that difficult at all. Let’s say for example that you have a product domain containing a product and a product group , and when modeling this domain you want to define a relationship constraint&#160; between product and product group objects [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=83&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&#160;</p>
<p align="left">Sometimes relationships can be tricky. But in the fantastic M world they are not that difficult at all. Let’s say for example that you have a product domain containing a product and a product group , and when modeling this domain you want to define a relationship constraint&#160; between product and product group objects saying that a product only can exist in one product group. At the same time the product group should be able to have zero or more products. This can easily be modeled using a so called <strong>entity reference</strong>. Like this:</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="400"><font size="1"><font face="Consolas"><strong>module</strong> ProductDomain               <br />{               <br />&#160;&#160;&#160; <strong>type</strong> Product               <br />&#160;&#160;&#160;&#160; {               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Id: Integer32;&#160; <br /></font></font><font size="1"><font face="Consolas">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Name : Text#50;              <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#0000ff">ProductGroup : ProductGroup <font size="1"><font face="Consolas"><strong>where value in</strong> ProductGroups</font></font>;</font>               <br />&#160;&#160;&#160;&#160; } <strong>where identity</strong>(Id);&#160; <br />&#160; <br />&#160;&#160;&#160;&#160; Products : Product*;               </p>
<p>&#160;&#160;&#160; <strong>type</strong> ProductGroup               <br />&#160;&#160;&#160; {               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Id : Integer32 = AutoNumber();               <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Name : Text#50;               <br />&#160;&#160;&#160;&#160; } <strong>where identity</strong>(Id);               </p>
<p>&#160;&#160;&#160; ProductGroups : ProductGroup*;&#160;&#160;&#160;&#160;&#160;&#160; <br />}</font></font></td>
</tr>
</tbody>
</table>
<p align="left">This will translate into the following T-SQL</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="400">
<p>/…/</p>
<p><font size="1"><font face="Consolas"><strong>create table</strong> [ProductDomain].[ProductGroups]                 <br />(                 <br />&#160; [Id] int <strong>not null identity</strong>,                 <br />&#160; [Name] nvarchar(50) <strong>not null</strong>,                 <br />&#160; <strong>constraint</strong> [PK_ProductGroups] <strong>primary key clustered</strong> ([Id])                 <br />);                 <br />go </font></font></p>
<p align="left"><font size="1"><font face="Consolas"><strong>create table</strong> [ProductDomain].[Products]                 <br />(                 <br />&#160; [Id] int <strong>not nul</strong>l,                 <br />&#160; [Name] nvarchar(50) <strong>not null</strong>,                 <br />&#160; [ProductGroup] int <strong>not null</strong>,                 <br />&#160; <strong>constraint</strong> [PK_Products] <strong>primary key clustered</strong> ([Id]),                 <br />&#160; <strong>constraint</strong> FK_Products_ProductGroup_ProductDomain_ProductGroups]                 <br />&#160; <strong>foreign key</strong> ([ProductGroup]) <strong>references</strong> [ProductDomain].[ProductGroups] ([Id])                 <br />);                 <br />go</font></font></p>
<p align="left">/…/</p>
</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanseverin.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanseverin.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=83&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanseverin.wordpress.com/2009/03/08/the-m-tip-of-the-day-one-to-many-relationships/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd24fe49dedb5287c23963b4690dd072?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IMHO</media:title>
		</media:content>
	</item>
		<item>
		<title>Five great information sources on MSchema</title>
		<link>http://stefanseverin.wordpress.com/2009/03/04/five-great-information-sources-on-mschema/</link>
		<comments>http://stefanseverin.wordpress.com/2009/03/04/five-great-information-sources-on-mschema/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 18:16:22 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Oslo]]></category>
		<category><![CDATA[MGraph]]></category>
		<category><![CDATA[MSchema]]></category>

		<guid isPermaLink="false">http://stefanseverin.wordpress.com/?p=76</guid>
		<description><![CDATA[&#160; &#34;M&#34; Programming Guide SQL Mapping Specification for Codename &#34;Oslo&#34; modeling language A three part article by Shawn Wildermuth Stephen Forte is exploring Oslo while modeling a new application MSDN Magazine article: Build Metadata-Based Applications With The “Oslo” Platform<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=76&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://msdn.microsoft.com/en-us/library/dd129568(VS.85).aspx" target="_blank">&quot;M&quot; Programming Guide</a></p>
<p><a href="http://msdn.microsoft.com/en-us/library/dd159725.aspx" target="_blank">SQL Mapping Specification for Codename &quot;Oslo&quot; modeling language</a></p>
<p><a href="http://wildermuth.com/2008/12/28/MSchema_An_Example_-_Part_1" target="_blank">A three part article by Shawn Wildermuth</a></p>
<p><a href="http://www.stephenforte.net/PermaLink,guid,3d84984e-4d4e-4bb8-81c6-c11abe3c3cf1.aspx" target="_blank">Stephen Forte is exploring Oslo while modeling a new application</a></p>
<p><a href="http://msdn.microsoft.com/en-us/magazine/dd419662.aspx" target="_blank">MSDN Magazine article: Build Metadata-Based Applications With The “Oslo” Platform</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanseverin.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanseverin.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=76&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanseverin.wordpress.com/2009/03/04/five-great-information-sources-on-mschema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd24fe49dedb5287c23963b4690dd072?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IMHO</media:title>
		</media:content>
	</item>
		<item>
		<title>Modeling with MSchema</title>
		<link>http://stefanseverin.wordpress.com/2009/03/02/modeling-with-mschema/</link>
		<comments>http://stefanseverin.wordpress.com/2009/03/02/modeling-with-mschema/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 15:44:10 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Oslo]]></category>
		<category><![CDATA[Intellipad]]></category>
		<category><![CDATA[MSchema]]></category>

		<guid isPermaLink="false">http://stefanseverin.wordpress.com/?p=15</guid>
		<description><![CDATA[I am, as many other developers I presume, in the early process of grasping what Oslo is all about, so what could be better than sharing that process (and mistakes I do) with others. In this post I will retell a lightning talk I had a while ago at Dotway’s office in Stockholm. Before having [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=15&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">I am, as many other developers I presume, in the early process of grasping what Oslo is all about, so what could be better than sharing that process (and mistakes I do) with others. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
In this post I will retell a lightning talk I had a while ago at Dotway’s office in Stockholm. </span></span></span></p>
<p class="MsoNormal" style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">Before having this Lightning talk I installed the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f2f4544c-626c-44a3-8866-b2a9fe078956&amp;displaylang=en">Oslo SDK January 2009 CTP</a> and SQL Server 2008, and of course I read the excellent documentation that comes along with the Oslo SDK.</span></span></span></p>
<p class="MsoNormal" style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">So this step-by-step talk was about how to model a fracture of a simple CV domain using the <strong>MSchema</strong> and Ipad (<strong>Intellipad</strong>) and how to use the M tool chain to put the model in SQL Server.<span>  </span>I deliberately kept the domain as simple as possible just to be able to show some of the basic steps involved in the modeling process.</span></span></span></p>
<p class="MsoNormal" style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">Here it goes…</span></span></span></p>
<p class="MsoNormal" style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">So, the first thing you need to do is to open up the text tool Ipad (Samples Enabled). You can do this either by running this in a command prompt: &#8220;C:\Program Files\Microsoft Oslo SDK 1.0\Bin\Intellipad\ipad.exe&#8221; /configuration:ipad-vs-samples.xaml, or even simpler by opening it from the start menu.<br />
Save Untitled1 as CV.m (.m is the format for M source files). Notice how the mode was changed from Standard Mode into M Mode.</span></span></span></p>
<p class="MsoNormal" style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">Everything you write in MSchema need to be inside a module, so add a module called CV:</span></span></span></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-17" title="bild11" src="http://stefanseverin.files.wordpress.com/2009/03/bild11.png?w=450" alt="bild11"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">A <strong>module</strong> controls visibility in the same way as CLR-namespaces do, however it also allocate storage, among other things. You may split up a module in different files, and a file may contain more than one module but a module cannot contain other modules. A module corresponds to a SQL Server database schema.<br />
The CV domain has consultants (each with an id and a name field) so let’s define that by adding a Consultant type into your module, something like this:</span></span></span></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-20" title="bild23" src="http://stefanseverin.files.wordpress.com/2009/03/bild23.png?w=450" alt="bild23"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">The <strong>AutoNumber()</strong> above, which is used to set a default value, maps to “identity”in T-SQL and the <strong>identity(id)</strong> constraint maps to the primary key on that field.<br />
Wouldn’t it be interesting to see the T-SQL that maps to our type?<br />
In Ipad you have two different views that let you see a preview of the T-SQL that corresponds to your model. The first one called <strong>Repository T-SQL Preview</strong> displays T-SQL based on the Oslo Repository design patterns. The second one called <strong>Generic T-SQL Preview</strong> displays a simpler version of the T-SQL needed to create a database schema corresponding to your model. For the purpose of this tutorial use the Generic T-SQL Preview menu choice, which you find under the M Mode menu.<br />
At the moment all that is displayed is the following comment:</span></span></span></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-22" title="bild3" src="http://stefanseverin.files.wordpress.com/2009/03/bild3.png?w=450&#038;h=41" alt="bild3" width="450" height="41" /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">So go ahead and add an <strong>extent</strong> called Consultants to your module and see what will happen:</span></span></span></p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-24" title="bild4" src="http://stefanseverin.files.wordpress.com/2009/03/bild4.png?w=450" alt="bild4"   /></p>
<p style="text-align:left;">This will produce the following in the T-SQL preview window:</p>
<p style="text-align:left;"><img class="alignnone size-full wp-image-26" title="bild5" src="http://stefanseverin.files.wordpress.com/2009/03/bild5.png?w=450" alt="bild5"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">As you can see the extent Consultants corresponds to the table called Consultants.<br />
Now add another type to your module called Skill with the fields Id, Name and description, and an extent called Skills:</span></span></span></p>
<p><img class="alignnone size-full wp-image-30" title="bild6" src="http://stefanseverin.files.wordpress.com/2009/03/bild6.png?w=450" alt="bild6"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;"><br />
Once again you get instant feedback from the T-SQL preview window:</span></span></span></p>
<p><img class="alignnone size-full wp-image-31" title="bild7" src="http://stefanseverin.files.wordpress.com/2009/03/bild7.png?w=450" alt="bild7"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;"><br />
Now let’s say you want a <strong>many-to-many relationship</strong> between the Consultant and Skill types. One way in which you can accomplish this is by adding a new skills field in the type Consultant and assign it the type Skill. You will also need to add a membership constraint to the field like this:</span></span></span></p>
<p><img class="alignnone size-full wp-image-34" title="bild8" src="http://stefanseverin.files.wordpress.com/2009/03/bild8.png?w=450" alt="bild8"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;"><br />
This will be transformed into a new <strong>SQL junction table</strong>:</span></span></span></p>
<p><img class="alignnone size-full wp-image-44" title="bild9" src="http://stefanseverin.files.wordpress.com/2009/03/bild91.png?w=450&#038;h=156" alt="bild9" width="450" height="156" /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;"><br />
The same thing would have been accomplished by adding this where predicate to the Consultants extent:</span></span></span></p>
<p><img class="alignnone size-full wp-image-38" title="bild10" src="http://stefanseverin.files.wordpress.com/2009/03/bild10.png?w=450" alt="bild10"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;"><br />
Although not shown here, in MSchema you can also model many-to-many relationships as two one-to-many relationships.<br />
With this in place you can define a couple instances of consultant using <strong>MGraph</strong>:</span></span></span></p>
<p><img class="alignnone size-full wp-image-40" title="bild111" src="http://stefanseverin.files.wordpress.com/2009/03/bild111.png?w=450" alt="bild111"   /></p>
<p style="text-align:left;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;"><br />
So how do you get the model into a SQL Server database?<br />
The first step is to compile your CV.m file into an image file. You do this with the m compiler, <strong>m.exe</strong><br />
Open up a new command prompt and navigate to the folder containing your CV.m file. Run the following line:<br />
&#8220;C:\Program Files\Microsoft Oslo SDK 1.0\Bin\m.exe&#8221; CV.m -p:image -t:TSQL10<br />
If you look inside the folder you will now find a file called CV.mx. The next step is to generate a new database containing the database schema found in CV.mx. This is done with the tool called <strong>mx.exe</strong>. Run the following line in the command prompt:<br />
&#8220;C:\Program Files\Microsoft Oslo SDK 1.0\Bin\mx.exe&#8221; -i:cv.mx -db:cvdb -c -ig -f –verbose<br />
Switch to SQL Server Management Studio and check that a database called cvdb has been created and that it contains the three tables CV.Consultants, CV.Skills and CV.Consultants_Skills. The database should also contain the insert into statements that you created with MGraph.</p>
<p>Ok, that’s it for now!</span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanseverin.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanseverin.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=15&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanseverin.wordpress.com/2009/03/02/modeling-with-mschema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd24fe49dedb5287c23963b4690dd072?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IMHO</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild11.png" medium="image">
			<media:title type="html">bild11</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild23.png" medium="image">
			<media:title type="html">bild23</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild3.png" medium="image">
			<media:title type="html">bild3</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild4.png" medium="image">
			<media:title type="html">bild4</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild5.png" medium="image">
			<media:title type="html">bild5</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild6.png" medium="image">
			<media:title type="html">bild6</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild7.png" medium="image">
			<media:title type="html">bild7</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild8.png" medium="image">
			<media:title type="html">bild8</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild91.png" medium="image">
			<media:title type="html">bild9</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild10.png" medium="image">
			<media:title type="html">bild10</media:title>
		</media:content>

		<media:content url="http://stefanseverin.files.wordpress.com/2009/03/bild111.png" medium="image">
			<media:title type="html">bild111</media:title>
		</media:content>
	</item>
		<item>
		<title>Me</title>
		<link>http://stefanseverin.wordpress.com/2009/03/01/me/</link>
		<comments>http://stefanseverin.wordpress.com/2009/03/01/me/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 20:40:18 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Oslo]]></category>

		<guid isPermaLink="false">http://stefanseverin.wordpress.com/?p=11</guid>
		<description><![CDATA[Hi, my name is Stefan Severin and I’m a consultant at Dotway, a company specialized in .NET technologies. My own specialty is WCF, but I am interested in all sorts of backend technologies that come from Microsoft. In this blog I’m going to write about Oslo which is Microsoft’s new modeling platform.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=11&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0 0 10pt;"><span lang="EN-US"><span style="font-size:small;"><span style="font-family:Calibri;">Hi, my name is Stefan Severin and I’m a consultant at Dotway, a company specialized in .NET technologies. My own specialty is WCF, but I am interested in all sorts of backend technologies that come from Microsoft.</span></span></span></p>
<p><span style="line-height:115%;font-family:&quot;font-size:11pt;" lang="EN-US">In this blog I’m going to write about Oslo which is Microsoft’s new modeling platform.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanseverin.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanseverin.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanseverin.wordpress.com&#038;blog=6768524&#038;post=11&#038;subd=stefanseverin&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanseverin.wordpress.com/2009/03/01/me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dd24fe49dedb5287c23963b4690dd072?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IMHO</media:title>
		</media:content>
	</item>
	</channel>
</rss>