<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How-To: Using the N* Stack, part 3</title>
	<atom:link href="http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/</link>
	<description>I&#039;m just here for the code</description>
	<lastBuildDate>Mon, 06 Sep 2010 12:21:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Part 5: Fixing the Broken Stuff - NHibernate blog - NHibernate Forge</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-120</link>
		<dc:creator>Part 5: Fixing the Broken Stuff - NHibernate blog - NHibernate Forge</dc:creator>
		<pubDate>Sat, 22 Aug 2009 14:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-120</guid>
		<description>[...] Part 3 – Persistence mapping [...]</description>
		<content:encoded><![CDATA[<p>[...] Part 3 – Persistence mapping [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Part 5: Fixing the Broken Stuff &#171; BASICly everything</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-118</link>
		<dc:creator>Part 5: Fixing the Broken Stuff &#171; BASICly everything</dc:creator>
		<pubDate>Sat, 22 Aug 2009 13:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-118</guid>
		<description>[...] Part 3 – Persistence mapping [...]</description>
		<content:encoded><![CDATA[<p>[...] Part 3 – Persistence mapping [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norbert Beckers</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-101</link>
		<dc:creator>Norbert Beckers</dc:creator>
		<pubDate>Thu, 20 Aug 2009 06:59:14 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-101</guid>
		<description>No Thanks. Changes go fast I reckon...;-}~</description>
		<content:encoded><![CDATA[<p>No Thanks. Changes go fast I reckon&#8230;;-}~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-99</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 19 Aug 2009 18:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-99</guid>
		<description>@Rob - Functionally, they are identical. Either will work.

Personally, I prefer the shorter AddFromAssemblyOf method. The method name indicates that you are dealing with the assembly containing the type, not the type specifically.</description>
		<content:encoded><![CDATA[<p>@Rob &#8211; Functionally, they are identical. Either will work.</p>
<p>Personally, I prefer the shorter AddFromAssemblyOf method. The method name indicates that you are dealing with the assembly containing the type, not the type specifically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Bihun</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-98</link>
		<dc:creator>Rob Bihun</dc:creator>
		<pubDate>Wed, 19 Aug 2009 15:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-98</guid>
		<description>In your configuration.cs (line # 26 in this post) you have:

.Mappings(x =&gt; x.FluentMappings.AddFromAssemblyOf()
.ExportTo(m_SchemaPath))

Is this better than:

.Mappings(x =&gt;
x.FluentMappings.AddFromAssembly(Assembly.GetAssembly(this.GetType())).ExportTo(m_SchemaPath))

Forgive me if this is an ignorant question, I am just now starting to play with NHibernate. To me your post (before looking closely) looks like you are doing something specifically with the CourseMapping class and not all the classes that inherit ClassMap... which in this case are all contained in NStackExample.Data along with the configuration class.</description>
		<content:encoded><![CDATA[<p>In your configuration.cs (line # 26 in this post) you have:</p>
<p>.Mappings(x =&gt; x.FluentMappings.AddFromAssemblyOf()<br />
.ExportTo(m_SchemaPath))</p>
<p>Is this better than:</p>
<p>.Mappings(x =&gt;<br />
x.FluentMappings.AddFromAssembly(Assembly.GetAssembly(this.GetType())).ExportTo(m_SchemaPath))</p>
<p>Forgive me if this is an ignorant question, I am just now starting to play with NHibernate. To me your post (before looking closely) looks like you are doing something specifically with the CourseMapping class and not all the classes that inherit ClassMap&#8230; which in this case are all contained in NStackExample.Data along with the configuration class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-97</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 19 Aug 2009 15:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-97</guid>
		<description>@Norbert - v1 RC was released less than 48 hours ago. I&#039;ll include those updates in my next post. Thanks.</description>
		<content:encoded><![CDATA[<p>@Norbert &#8211; v1 RC was released less than 48 hours ago. I&#8217;ll include those updates in my next post. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norbert Beckers</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-95</link>
		<dc:creator>Norbert Beckers</dc:creator>
		<pubDate>Wed, 19 Aug 2009 07:49:47 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-95</guid>
		<description>Update: &quot;WithForeignKeyConstraintName(String)&quot; now is &quot;ForeignKeyConstraintName(String)&quot;</description>
		<content:encoded><![CDATA[<p>Update: &#8220;WithForeignKeyConstraintName(String)&#8221; now is &#8220;ForeignKeyConstraintName(String)&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norbert Beckers</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-94</link>
		<dc:creator>Norbert Beckers</dc:creator>
		<pubDate>Wed, 19 Aug 2009 07:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-94</guid>
		<description>This series isn&#039;t up to date.  I&#039;m using 1.0RC, the latest release version of FluentNHibernate. The &quot;WithLengthOf(Int32)&quot; method is replaced by &quot;Length(Int32)&quot;</description>
		<content:encoded><![CDATA[<p>This series isn&#8217;t up to date.  I&#8217;m using 1.0RC, the latest release version of FluentNHibernate. The &#8220;WithLengthOf(Int32)&#8221; method is replaced by &#8220;Length(Int32)&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: José F. Romaniello</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-93</link>
		<dc:creator>José F. Romaniello</dc:creator>
		<pubDate>Tue, 18 Aug 2009 20:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-93</guid>
		<description>I agree with you.</description>
		<content:encoded><![CDATA[<p>I agree with you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/comment-page-1/#comment-86</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 18 Aug 2009 14:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/#comment-86</guid>
		<description>Yes. I did compare an FNH generated xml mapping to FNH code. You&#039;ve stripped out some property types and assembly-qualified type names, and it is cleaner. If I had one handy, I probably would have used a hand-written mapping from a greenfield project. Looking back, it does come across as a dishonest comparison.

I do agree that hand-written XML mappings are usually more readable than those generated by FNH, but as I understand it, that&#039;s not the goal of the FNH project.

I really just have two points: 
#1 - Even in their simplest form, XML mappings are still more difficult to read, and more importantly, more difficult to maintain than an FNH mapping written in C#. Of course, to a degree, readability and even maintainability are subjective.

I don&#039;t agree with the &quot;enterprise Java&quot; point of view that XML is the perfect solution for everything. I think you pay a VERY heavy &quot;magic strings&quot; tax with XML in general, and especially when a lot of XML has to stay in sync with a lot of code, as in the case of mappings. In one of the most critical locations in the applications, that&#039;s just unacceptable - again, just my opinion. 

XML has it&#039;s place. It&#039;s great for standard communications protocols and configuration settings that are likely to change as the hardware and network change. In the case of mappings, it&#039;s being used more as a replacement for code. It feels wrong to me.

#2 - XML mappings will slow the adoption of NHibernate. FNH is a success partly because it abuses the hell out of Intellisense to flatten out the NH learning curve.

I&#039;m not bashing NHibernate. It&#039;s an amazing ORM, and the XML mappings are part of its history. They also make a great integration point for codegen tools. I think as NHibernate is adopted outside of the ALT.NET community, you&#039;ll see a lot less hand-written mappings and a lot more codegen, DB reverse-engineer, and FNH mappings. 

In case it wasn&#039;t obvious already, I&#039;m pretty new to NHibernate. I&#039;m still making rookie mistakes. The learning curve for NHibernate for a newbie in a &quot;hurry up and get it done&quot; drag-n-drop programming shop is pretty steep. Add in these weird little XML mappings that refuse to stay in sync with the model and the newbie might just choose EF and its GUI designers over NHibernate.

Now that FNH is officially v1 RC, NH could serve itself well to push FNH to beginners as an easy one-size-fits-most mapping solution while still supporting the XML mappings for advanced fine-tuning. But that&#039;s for Fabio to decide, not me.</description>
		<content:encoded><![CDATA[<p>Yes. I did compare an FNH generated xml mapping to FNH code. You&#8217;ve stripped out some property types and assembly-qualified type names, and it is cleaner. If I had one handy, I probably would have used a hand-written mapping from a greenfield project. Looking back, it does come across as a dishonest comparison.</p>
<p>I do agree that hand-written XML mappings are usually more readable than those generated by FNH, but as I understand it, that&#8217;s not the goal of the FNH project.</p>
<p>I really just have two points:<br />
#1 &#8211; Even in their simplest form, XML mappings are still more difficult to read, and more importantly, more difficult to maintain than an FNH mapping written in C#. Of course, to a degree, readability and even maintainability are subjective.</p>
<p>I don&#8217;t agree with the &#8220;enterprise Java&#8221; point of view that XML is the perfect solution for everything. I think you pay a VERY heavy &#8220;magic strings&#8221; tax with XML in general, and especially when a lot of XML has to stay in sync with a lot of code, as in the case of mappings. In one of the most critical locations in the applications, that&#8217;s just unacceptable &#8211; again, just my opinion. </p>
<p>XML has it&#8217;s place. It&#8217;s great for standard communications protocols and configuration settings that are likely to change as the hardware and network change. In the case of mappings, it&#8217;s being used more as a replacement for code. It feels wrong to me.</p>
<p>#2 &#8211; XML mappings will slow the adoption of NHibernate. FNH is a success partly because it abuses the hell out of Intellisense to flatten out the NH learning curve.</p>
<p>I&#8217;m not bashing NHibernate. It&#8217;s an amazing ORM, and the XML mappings are part of its history. They also make a great integration point for codegen tools. I think as NHibernate is adopted outside of the ALT.NET community, you&#8217;ll see a lot less hand-written mappings and a lot more codegen, DB reverse-engineer, and FNH mappings. </p>
<p>In case it wasn&#8217;t obvious already, I&#8217;m pretty new to NHibernate. I&#8217;m still making rookie mistakes. The learning curve for NHibernate for a newbie in a &#8220;hurry up and get it done&#8221; drag-n-drop programming shop is pretty steep. Add in these weird little XML mappings that refuse to stay in sync with the model and the newbie might just choose EF and its GUI designers over NHibernate.</p>
<p>Now that FNH is officially v1 RC, NH could serve itself well to push FNH to beginners as an easy one-size-fits-most mapping solution while still supporting the XML mappings for advanced fine-tuning. But that&#8217;s for Fabio to decide, not me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
