<?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: I Don&#8217;t Really See The Problem With NHibernate&#8217;s XML Mapping Files</title>
	<atom:link href="http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/</link>
	<description>Trying to walk that thin line between intelligence and ignorance</description>
	<lastBuildDate>Thu, 29 Jul 2010 20:54:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Günter Zöchbauer</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-16887</link>
		<dc:creator>Günter Zöchbauer</dc:creator>
		<pubDate>Tue, 26 May 2009 08:52:35 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-16887</guid>
		<description>What I was not able to accomplish with XML was to reuse parts of the mapping.
E.g. An Address class mapped as component in many entities (or Point, or whatever)

With FluentNH I use a custom base class derived from ClassMap for my fluent mapping classes, where I set common mapping properties like Id-, Version, Audit, ...
I also have some Extension Methods for the return values of Map(), References(), ...where I encapsulate my preferred settings for different mapping elements.

Two extension method examples:
        public static IProperty EnumDefaults(this IProperty property)
        {
            return property.Not.Nullable().CustomTypeIs(); //.Not.Nullable();
        }

        /// for References
        public static ManyToOnePart Defaults(this ManyToOnePart property)
        {
            return property.Cascade.SaveUpdate().LazyLoad();
        }


With this tools I have a single place where I can apply common settings and don&#039;t need to have to maintain the same attributes in each and every XML mapping file.

Automapping and conventions seem interesting but I haven&#039;t used them yet because I&#039;m very comfortable with the explicit mapping and the tools described above.

So FluentNHibernate rocks.</description>
		<content:encoded><![CDATA[<p>What I was not able to accomplish with XML was to reuse parts of the mapping.<br />
E.g. An Address class mapped as component in many entities (or Point, or whatever)</p>
<p>With FluentNH I use a custom base class derived from ClassMap for my fluent mapping classes, where I set common mapping properties like Id-, Version, Audit, &#8230;<br />
I also have some Extension Methods for the return values of Map(), References(), &#8230;where I encapsulate my preferred settings for different mapping elements.</p>
<p>Two extension method examples:<br />
        public static IProperty EnumDefaults(this IProperty property)<br />
        {<br />
            return property.Not.Nullable().CustomTypeIs(); //.Not.Nullable();<br />
        }</p>
<p>        /// for References<br />
        public static ManyToOnePart Defaults(this ManyToOnePart property)<br />
        {<br />
            return property.Cascade.SaveUpdate().LazyLoad();<br />
        }</p>
<p>With this tools I have a single place where I can apply common settings and don&#8217;t need to have to maintain the same attributes in each and every XML mapping file.</p>
<p>Automapping and conventions seem interesting but I haven&#8217;t used them yet because I&#8217;m very comfortable with the explicit mapping and the tools described above.</p>
<p>So FluentNHibernate rocks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Hinze</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-8543</link>
		<dc:creator>Matt Hinze</dc:creator>
		<pubDate>Sat, 07 Feb 2009 04:29:58 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-8543</guid>
		<description>The conventions are cool.  The F2 (Rename) support is cool.  But there is *very little* pain to be had with the xml files.  Let&#039;s be clear, it&#039;s NOT a challenge to maintain them.</description>
		<content:encoded><![CDATA[<p>The conventions are cool.  The F2 (Rename) support is cool.  But there is *very little* pain to be had with the xml files.  Let&#8217;s be clear, it&#8217;s NOT a challenge to maintain them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Batum</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7901</link>
		<dc:creator>Paul Batum</dc:creator>
		<pubDate>Tue, 20 Jan 2009 00:06:49 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7901</guid>
		<description>&quot;probably because up until now, nobody thought this was important enough to implement… there’s always a lot of work to do in NH-core, and there’s always very few people willing to actually do it.&quot;

Fair enough.</description>
		<content:encoded><![CDATA[<p>&#8220;probably because up until now, nobody thought this was important enough to implement… there’s always a lot of work to do in NH-core, and there’s always very few people willing to actually do it.&#8221;</p>
<p>Fair enough.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7900</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 19 Jan 2009 23:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7900</guid>
		<description>Conventions are great...for new projects.  But if I&#039;m welding on some new functionality in an existing application, mapping files are a very painless way of getting there.  That and the ability to change my mappings (within reason like a column name or something that doesn&#039;t require a new property to my object) without a recompile-deployment.</description>
		<content:encoded><![CDATA[<p>Conventions are great&#8230;for new projects.  But if I&#8217;m welding on some new functionality in an existing application, mapping files are a very painless way of getting there.  That and the ability to change my mappings (within reason like a column name or something that doesn&#8217;t require a new property to my object) without a recompile-deployment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjan`s World &#187; LINKBLOG for January 19, 2009</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7890</link>
		<dc:creator>Arjan`s World &#187; LINKBLOG for January 19, 2009</dc:creator>
		<pubDate>Mon, 19 Jan 2009 16:14:18 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7890</guid>
		<description>[...] I Don&#8217;t Really See The Problem With NHibernate&#8217;s XML Mapping Files - Davy Brion [...]</description>
		<content:encoded><![CDATA[<p>[...] I Don&#8217;t Really See The Problem With NHibernate&#8217;s XML Mapping Files &#8211; Davy Brion [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7886</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Mon, 19 Jan 2009 15:28:03 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7886</guid>
		<description>I kinda agree, the &quot;problems&quot; with the XML were in my view overblown. We used the XML based approach for over 2 years and didn&#039;t feel much pain with it at all.

I do find the convention based approach interesting, and I&#039;d like it if we could add customized conventions (e.g. a set of DDD conventions).

Personally I see the Fluent NH stuff as a small advancement, it won&#039;t change the world but it might be the platform for some cool stuff.</description>
		<content:encoded><![CDATA[<p>I kinda agree, the &#8220;problems&#8221; with the XML were in my view overblown. We used the XML based approach for over 2 years and didn&#8217;t feel much pain with it at all.</p>
<p>I do find the convention based approach interesting, and I&#8217;d like it if we could add customized conventions (e.g. a set of DDD conventions).</p>
<p>Personally I see the Fluent NH stuff as a small advancement, it won&#8217;t change the world but it might be the platform for some cool stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7859</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Mon, 19 Jan 2009 05:59:36 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7859</guid>
		<description>&quot;I would honestly like to know why NH does not have this feature already. Is it simply the case that nobody has tried? Or would the underlying mapping architecture require serious rework to make this possible?&quot;

probably because up until now, nobody thought this was important enough to implement... there&#039;s always a lot of work to do in NH-core, and there&#039;s always very few people willing to actually do it.</description>
		<content:encoded><![CDATA[<p>&#8220;I would honestly like to know why NH does not have this feature already. Is it simply the case that nobody has tried? Or would the underlying mapping architecture require serious rework to make this possible?&#8221;</p>
<p>probably because up until now, nobody thought this was important enough to implement&#8230; there&#8217;s always a lot of work to do in NH-core, and there&#8217;s always very few people willing to actually do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: che</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7856</link>
		<dc:creator>che</dc:creator>
		<pubDate>Mon, 19 Jan 2009 05:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7856</guid>
		<description>For beginners like me, learning about NHibernate, unit testing, different patterns such as repository and MVC, SOLID principles, all at the same time can produces mental overload more often then I can remember.  If I can write mapping files in C# instead of XML, that means less baggage I can forget about.  Funny thing is this is coming from someone who is more familiar with VB.NET then C#.</description>
		<content:encoded><![CDATA[<p>For beginners like me, learning about NHibernate, unit testing, different patterns such as repository and MVC, SOLID principles, all at the same time can produces mental overload more often then I can remember.  If I can write mapping files in C# instead of XML, that means less baggage I can forget about.  Funny thing is this is coming from someone who is more familiar with VB.NET then C#.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vorleak Chy</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7848</link>
		<dc:creator>Vorleak Chy</dc:creator>
		<pubDate>Mon, 19 Jan 2009 00:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7848</guid>
		<description>For my point of views I agreed with Paul Batum said above but I&#039;m wondering why both of contributors don&#039;t collaborate to be a big community.</description>
		<content:encoded><![CDATA[<p>For my point of views I agreed with Paul Batum said above but I&#8217;m wondering why both of contributors don&#8217;t collaborate to be a big community.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Batum</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7846</link>
		<dc:creator>Paul Batum</dc:creator>
		<pubDate>Sun, 18 Jan 2009 23:58:54 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7846</guid>
		<description>Doh, looks like I failed to close my &lt;i&gt; tag correctly.</description>
		<content:encoded><![CDATA[<p>Doh, looks like I failed to close my <i> tag correctly.</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Batum</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7845</link>
		<dc:creator>Paul Batum</dc:creator>
		<pubDate>Sun, 18 Jan 2009 23:56:49 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7845</guid>
		<description>As one of the fluent nhibernate contributors I am obviously biased, but I will make a few points anyway.

- I think that learning via C# intellisense is easier than xml intellisense. Obviously your mileage will vary depending on how well the API is designed, and I will admit that our API still has plenty of rough edges. That said, I think the discoverable nature of a fluent interface makes for an easier learning experience.

- Typing out your nhibernate mapping in xml requires lots of ctrl+tab as you switch from your domain objects to the xml. It involves lots of copy and paste and there is the chance you will make simple typos. Fluent nhibernate does not suffer from the same problem, because when using it you also get intellisense &lt;i&gt;against your domain objects&lt;i&gt;. Using an xml editor does not offer the same benefit.

- Refactoring support. I know that the resharper plugin exists, but resharper isn&#039;t free. I think that resharper offers a pretty good value proposition and most developers should have a copy, but it is certainly nice to have an option that will allow the more frugal developers to work with nhibernate in a refactoring friendly way.

- As Jeremy and Ayende mentioned, conventions and auto persistence promise to really change how we configure our ORM. Davy, you make the point that NHibernate could provide support for this, and to this my response is simply: ok, why haven&#039;t you? I am not familiar enough with the NH codebase or how the decision making process works so my question is not rhetorical - I would honestly like to know why NH does not have this feature already. Is it simply the case that nobody has tried? Or would the underlying mapping architecture require serious rework to make this possible?

I certainly agree that until Fluent NHibernate has full feature support, hbm xml will sometimes be a better choice.</description>
		<content:encoded><![CDATA[<p>As one of the fluent nhibernate contributors I am obviously biased, but I will make a few points anyway.</p>
<p>- I think that learning via C# intellisense is easier than xml intellisense. Obviously your mileage will vary depending on how well the API is designed, and I will admit that our API still has plenty of rough edges. That said, I think the discoverable nature of a fluent interface makes for an easier learning experience.</p>
<p>- Typing out your nhibernate mapping in xml requires lots of ctrl+tab as you switch from your domain objects to the xml. It involves lots of copy and paste and there is the chance you will make simple typos. Fluent nhibernate does not suffer from the same problem, because when using it you also get intellisense <i>against your domain objects</i><i>. Using an xml editor does not offer the same benefit.</p>
<p>- Refactoring support. I know that the resharper plugin exists, but resharper isn&#8217;t free. I think that resharper offers a pretty good value proposition and most developers should have a copy, but it is certainly nice to have an option that will allow the more frugal developers to work with nhibernate in a refactoring friendly way.</p>
<p>- As Jeremy and Ayende mentioned, conventions and auto persistence promise to really change how we configure our ORM. Davy, you make the point that NHibernate could provide support for this, and to this my response is simply: ok, why haven&#8217;t you? I am not familiar enough with the NH codebase or how the decision making process works so my question is not rhetorical &#8211; I would honestly like to know why NH does not have this feature already. Is it simply the case that nobody has tried? Or would the underlying mapping architecture require serious rework to make this possible?</p>
<p>I certainly agree that until Fluent NHibernate has full feature support, hbm xml will sometimes be a better choice.</i></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bart Reyserhove</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7842</link>
		<dc:creator>Bart Reyserhove</dc:creator>
		<pubDate>Sun, 18 Jan 2009 20:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7842</guid>
		<description>They don&#039;t really bother me, but it sure saves time if you would not need them ;-)</description>
		<content:encoded><![CDATA[<p>They don&#8217;t really bother me, but it sure saves time if you would not need them <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7834</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Sun, 18 Jan 2009 18:14:14 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7834</guid>
		<description>ayende,

we could provide that from within NHibernate, right?</description>
		<content:encoded><![CDATA[<p>ayende,</p>
<p>we could provide that from within NHibernate, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayende Rahien</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7833</link>
		<dc:creator>Ayende Rahien</dc:creator>
		<pubDate>Sun, 18 Jan 2009 18:12:24 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7833</guid>
		<description>Davy,
For me, it is the auto mapping that is key. Being able to have the mapping inferred is immensely powerful</description>
		<content:encoded><![CDATA[<p>Davy,<br />
For me, it is the auto mapping that is key. Being able to have the mapping inferred is immensely powerful</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7829</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Sun, 18 Jan 2009 17:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7829</guid>
		<description>auto mapping based on conventions is indeed pretty cool, perhaps this is something we could (optionally) do automatically from within NHibernate

oh and thanks for letting me &#039;get away&#039; with my statements, that&#039;s very gracious of you</description>
		<content:encoded><![CDATA[<p>auto mapping based on conventions is indeed pretty cool, perhaps this is something we could (optionally) do automatically from within NHibernate</p>
<p>oh and thanks for letting me &#8216;get away&#8217; with my statements, that&#8217;s very gracious of you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy D. Miller</title>
		<link>http://davybrion.com/blog/2009/01/i-dont-really-see-the-problem-with-nhibernates-xml-mapping-files/comment-page-1/#comment-7827</link>
		<dc:creator>Jeremy D. Miller</dc:creator>
		<pubDate>Sun, 18 Jan 2009 17:15:09 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=869#comment-7827</guid>
		<description>I&#039;ll let you get away with trying to say that the Xml mapping isn&#039;t terrifyingly brittle and error prone, but I&#039;ll give you the Fluent NHibernate trump card:  Conventions.  I can get agressive with the Conventions and/or the AutoPersistenceModel in Fluent NHibernate and do less explicit mapping of any kind.  I can almost obviate the very need for that ReSharper plugin for refactoring by just letting the auto mapping + conventions pick up changes in the object model.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll let you get away with trying to say that the Xml mapping isn&#8217;t terrifyingly brittle and error prone, but I&#8217;ll give you the Fluent NHibernate trump card:  Conventions.  I can get agressive with the Conventions and/or the AutoPersistenceModel in Fluent NHibernate and do less explicit mapping of any kind.  I can almost obviate the very need for that ReSharper plugin for refactoring by just letting the auto mapping + conventions pick up changes in the object model.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
