<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Jimmy Bogard Blog - Latest Comments</title><link xmlns="http://www.w3.org/2005/Atom" rel="http://api.friendfeed.com/2008/03#sup" href="http://disqus.com/sup/all.sup#forumcomments-5507c2d5" type="application/json"/><link>http://jimmybogardblog.disqus.com/</link><description></description><atom:link href="http://jimmybogardblog.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 09 May 2012 08:43:36 -0000</lastBuildDate><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-524333016</link><description>&lt;p&gt;Yep - but the easiest way is to have all of the values in the DB, and just model it such that some are "built in" and can't be deleted/modified through your app, and some are custom. We usually use a "System" or "BuiltIn" bit flag to indicate this on that table.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jbogard</dc:creator><pubDate>Wed, 09 May 2012 08:43:36 -0000</pubDate></item><item><title>Re: Language feature parity and the polyglot programmer</title><link>http://lostechies.com/jimmybogard/2009/02/15/language-feature-parity-and-the-polyglot-programmer/#comment-522557261</link><description>&lt;p&gt;You can use most fluent interfaces from VB.NET, but -man- they really do look ugly compared to their C# counterparts. Especialy the use of lambda expressions for nearly anything creates an interface that's accessable from VB.NET, but nothing more. Supporting another interface with lots of optional (named) parameters is much more VB.NET minded, but you won't find it on any major project because C# cannot handle this interface so easily.&lt;/p&gt;

&lt;p&gt;Yes, you can use nearly every C# library from VB.NET, but that doesn't mean it's suited for VB.NET. And you can't switch an entire company from VB.NET to C# just because of those o-so-beautiful fluent interfaces ...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dony</dc:creator><pubDate>Tue, 08 May 2012 06:37:01 -0000</pubDate></item><item><title>Re: Strengthening your domain: The double dispatch pattern</title><link>http://lostechies.com/jimmybogard/2010/03/30/strengthening-your-domain-the-double-dispatch-pattern/#comment-522490295</link><description>&lt;p&gt;Since we're trying not to inject things into our model objects and we certainly don't want them concerned with knowing what a Repository is, then is a service (domain service) the appropriate place to have a Repository injected for acquiring items from other aggregates if that's the sort of logic that is required in some method of a domain object?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">matt kocaj</dc:creator><pubDate>Tue, 08 May 2012 03:21:14 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-522121949</link><description>&lt;p&gt;Hello, I have to map soma classes that are almost the same of this.&lt;/p&gt;

&lt;p&gt;The difference is that in my case I have some prefedined values, but the user can add more values to the database (the enumeration is an entity).&lt;/p&gt;

&lt;p&gt;There are any way to do this using NH?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Carlos Alberto Costa Beppler</dc:creator><pubDate>Mon, 07 May 2012 20:27:11 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-521550927</link><description>&lt;p&gt;Copy-Paste from other projects, really. It wasn't an intentional decision one way or the other, other than it seemed that PrimitiveType had less to implement out of the box than IUserType.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jbogard</dc:creator><pubDate>Mon, 07 May 2012 09:03:41 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-521458427</link><description>&lt;p&gt;Just a question - why did you use PrimitiveType instead of IUserType? &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">cbp</dc:creator><pubDate>Mon, 07 May 2012 05:20:27 -0000</pubDate></item><item><title>Re: Strategies and discriminators in NHibernate</title><link>http://lostechies.com/jimmybogard/2008/08/27/strategies-and-discriminators-in-nhibernate/#comment-521349463</link><description>&lt;p&gt;Hey Jimmy,&lt;/p&gt;

&lt;p&gt;I can't get this method working for me. The line &amp;lt;subclass discriminator-value="1" extends="PricingStrategy" name="PricingStrategy+FullPriceStrategy"&amp;gt; is giving me trouble.&lt;/p&gt;

&lt;p&gt;I get the exception: NHibernate.MappingException: persistent class &lt;br&gt;PricingStrategy+FullPriceStrategy not found.&lt;/p&gt;

&lt;p&gt;Any ideas?&amp;lt;/subclass&amp;gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">matt kocaj</dc:creator><pubDate>Sun, 06 May 2012 23:31:14 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-520776102</link><description>&lt;p&gt;Probably better to use 'typedef' to reduce count of full qualified type name strings:&lt;br&gt;&amp;lt;typedef class="Namespace.To.EnumerationType`1[[Color, AssemblyWithDomainEnum]], AssemblyWithNHibCustomType" name="ColorEnum"&amp;gt;&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;&amp;lt;property column="Color1" name="Color1" type="ColorEnum"&amp;gt;&lt;br&gt;&amp;lt;property column="Color2" name="Color2" type="ColorEnum"&amp;gt; &lt;br&gt;&amp;lt;property column="Color3" name="Color3" type="ColorEnum"&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;/typedef&amp;gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Никита Говоров</dc:creator><pubDate>Sun, 06 May 2012 01:35:33 -0000</pubDate></item><item><title>Re: Limits of performance optimization</title><link>http://lostechies.com/jimmybogard/2012/05/03/limits-of-performance-optimization/#comment-519362874</link><description>&lt;p&gt;haha yep. That's what I was saying Jason. A bit of awareness of the hole you're digging for yourself.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick</dc:creator><pubDate>Fri, 04 May 2012 16:12:19 -0000</pubDate></item><item><title>Re: Organizing ASP.NET MVC solutions</title><link>http://lostechies.com/jimmybogard/2009/12/09/organizing-asp-net-mvc-solutions/#comment-518935371</link><description>&lt;p&gt;这不是一个问题 &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">man</dc:creator><pubDate>Fri, 04 May 2012 08:24:34 -0000</pubDate></item><item><title>Re: Limits of performance optimization</title><link>http://lostechies.com/jimmybogard/2012/05/03/limits-of-performance-optimization/#comment-518924857</link><description>&lt;p&gt;Jimmy's not suggesting there should be 10 layers of abstraction.  The point is to balance performance with maintainability. To far in either direction creates a problem.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason Meckley</dc:creator><pubDate>Fri, 04 May 2012 08:16:22 -0000</pubDate></item><item><title>Re: TestDriven.NET keyboard shortcut</title><link>http://lostechies.com/jimmybogard/2008/02/28/testdriven-net-keyboard-shortcut/#comment-518664756</link><description>&lt;p&gt;That is  what  I was looking for. You need to set the “Use new shortcut in:” to “Text Editor”. Otherwise current TextEditor shortcut will override your global choice, and it won't work.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mert</dc:creator><pubDate>Fri, 04 May 2012 04:35:04 -0000</pubDate></item><item><title>Re: Limits of performance optimization</title><link>http://lostechies.com/jimmybogard/2012/05/03/limits-of-performance-optimization/#comment-517681658</link><description>&lt;p&gt;Sometimes you can make beautiful code that is easy to maintain and looks great. But your data-access and network are abstracted 10 layers deep. &lt;/p&gt;

&lt;p&gt;Try and optimise that son. Or even better - diagnose it.&lt;/p&gt;

&lt;p&gt;A bit of awareness of what is all I'm saying based on experience of facades, wrapping, controllers, wrapping god knows what with 50 database and web service calls scattered from top to bottom of the stack.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick</dc:creator><pubDate>Thu, 03 May 2012 10:51:09 -0000</pubDate></item><item><title>Re: Limits of performance optimization</title><link>http://lostechies.com/jimmybogard/2012/05/03/limits-of-performance-optimization/#comment-517633749</link><description>&lt;p&gt;Bravo.  Doggedly eking out every ounce of a given QOS criteria (performance, security, etc.) without thought to cost and need is as detrimental as sloppy work.  &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gene Hughson</dc:creator><pubDate>Thu, 03 May 2012 09:52:12 -0000</pubDate></item><item><title>Re: Custom errors and error detail policy in ASP.NET Web API</title><link>http://lostechies.com/jimmybogard/2012/04/18/custom-errors-and-error-detail-policy-in-asp-net-web-api/#comment-517585067</link><description>&lt;p&gt;Ha, that's much easier than my way, which was unlocking each status code at a time. Thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jbogard</dc:creator><pubDate>Thu, 03 May 2012 08:47:21 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-517583846</link><description>&lt;p&gt;&amp;lt;property column="Color" name="Color" type="Namespace.To.EnumerationType`1[[Color, AssemblyWithDomainEnum]], AssemblyWithNHibCustomType"&amp;gt;&lt;/p&gt;

&lt;p&gt;Ugly, no?&lt;/p&gt;

&lt;p&gt;Why no Fluent NHibernate? It's really easy to migrate/have both in one project.&amp;lt;/property&amp;gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jbogard</dc:creator><pubDate>Thu, 03 May 2012 08:45:34 -0000</pubDate></item><item><title>Re: How we do MVC – View models</title><link>http://lostechies.com/jimmybogard/2009/06/30/how-we-do-mvc-view-models/#comment-517559601</link><description>&lt;p&gt;Great job Jimmy! Ilove automapper&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rlcristobal</dc:creator><pubDate>Thu, 03 May 2012 08:08:24 -0000</pubDate></item><item><title>Re: Custom errors and error detail policy in ASP.NET Web API</title><link>http://lostechies.com/jimmybogard/2012/04/18/custom-errors-and-error-detail-policy-in-asp-net-web-api/#comment-517451362</link><description>&lt;p&gt;Also, when hosting  ASP.NET WebAPI  in IIS, add the following to web.config to makes IIS not eat the body of your custom error responses.&lt;br&gt;&lt;br&gt;&amp;lt;configuration&amp;gt;&lt;br&gt;    &amp;lt;system.webserver&amp;gt;&lt;br&gt;        &amp;lt;httperrors existingresponse="PassThrough"&amp;gt;&lt;br&gt;    &amp;lt;/httperrors&amp;gt;&amp;lt;/system.webserver&amp;gt;&lt;br&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt;

&lt;p&gt;If you're running IIS7/7.5 on a "security hardened" server, you'll need to run the following commands to "unlock" that config section:&lt;/p&gt;

&lt;p&gt;cd C:\Windows\System32\inetsrv&lt;/p&gt;

&lt;p&gt;appcmd unlock config /section:httpErrors&lt;/p&gt;

&lt;p&gt;See details here: &lt;a href="http://stackoverflow.com/questions/2345532/turn-iis7-http-error-handling-off" rel="nofollow"&gt;http://stackoverflow.com/quest...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Regards, &lt;br&gt;Jan Ove&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan Ove S. Olsen</dc:creator><pubDate>Thu, 03 May 2012 04:36:14 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-517440944</link><description>&lt;p&gt;And this does or does not create a lookup table for the &lt;br&gt;TEnumeration  items? Or is it the same as my SO example (&lt;a href="http://stackoverflow.com/a/10426960/56145)" rel="nofollow"&gt;http://stackoverflow.com/a/104...&lt;/a&gt;, where it simply tells NHibernate how to link the index/value field?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">matt kocaj</dc:creator><pubDate>Thu, 03 May 2012 04:12:31 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-517419515</link><description>&lt;p&gt;And the HBM mapping example? (as much as I'd love the freedom to be using Fluent on this project)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">matt kocaj</dc:creator><pubDate>Thu, 03 May 2012 03:24:30 -0000</pubDate></item><item><title>Re: Seamless test authoring with ReSharper and AutoHotKey</title><link>http://lostechies.com/jimmybogard/2009/02/26/seamless-test-authoring-with-resharper-and-autohotkey/#comment-517176491</link><description>&lt;p&gt;Awesome, thanks!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jimmy Bogard</dc:creator><pubDate>Wed, 02 May 2012 20:00:07 -0000</pubDate></item><item><title>Re: Seamless test authoring with ReSharper and AutoHotKey</title><link>http://lostechies.com/jimmybogard/2009/02/26/seamless-test-authoring-with-resharper-and-autohotkey/#comment-517121605</link><description>&lt;p&gt;I'm coming across this nearly 3 years after it was written and still finding tremendous value in it.  Thanks for your post!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Joseph Leo</dc:creator><pubDate>Wed, 02 May 2012 18:42:14 -0000</pubDate></item><item><title>Re: The case for two-way mapping in AutoMapper</title><link>http://lostechies.com/jimmybogard/2009/09/18/the-case-for-two-way-mapping-in-automapper/#comment-516936698</link><description>&lt;p&gt;On further examination, I think you're right not to support it - there shouldn't be enough places where the EditModel to Entity conversion is taking place to make the mapping worthwhile. &lt;/p&gt;

&lt;p&gt;For now I've refactored that conversion process out into a method in the entity's controller which also validates the EditModel. Not sure if this is a great idea, but I need to do validation that can't be expressed in data annotations and this ensures only valid EditModels ever even become entities.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ted Driggs</dc:creator><pubDate>Wed, 02 May 2012 14:57:57 -0000</pubDate></item><item><title>Re: Custom errors and error detail policy in ASP.NET Web API</title><link>http://lostechies.com/jimmybogard/2012/04/18/custom-errors-and-error-detail-policy-in-asp-net-web-api/#comment-516776493</link><description>&lt;p&gt;Nice work!! Would love to see more post from you on &lt;a href="http://asp.net" rel="nofollow"&gt;asp.net&lt;/a&gt; mvc 4.0&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jalpesh Vadgama</dc:creator><pubDate>Wed, 02 May 2012 11:58:35 -0000</pubDate></item><item><title>Re: Persisting enumeration classes with NHibernate</title><link>http://lostechies.com/jimmybogard/2012/05/01/persisting-enumeration-classes-with-nhibernate/#comment-516600957</link><description>&lt;p&gt;I like to use the following simple solution to having enums mapped as integers, using only a small FluentNHibernate mapping convention:&lt;/p&gt;

&lt;p&gt;    public class EnumConvention : IUserTypeConvention&lt;br&gt;    {&lt;br&gt;        public void Accept(IAcceptanceCriteria&amp;lt;ipropertyinspector&amp;gt; criteria)&lt;br&gt;        {&lt;br&gt;            criteria.Expect(n =&amp;gt; n.Property.PropertyType.IsEnum);&lt;br&gt;        }&lt;/p&gt;

&lt;p&gt;        public void Apply(IPropertyInstance instance)&lt;br&gt;        {&lt;br&gt;            // Map using the integral representation of the enum value.&lt;br&gt;            instance.CustomType(instance.Property.PropertyType);&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt; &lt;br&gt;Further, it's important to assign explicit integral values to our enum, to ensure that the integral representation of the enum values stays the same when a new value is added for example:&lt;/p&gt;

&lt;p&gt;enum MyEnum&lt;br&gt;{&lt;br&gt;     FirstValue = 1,&lt;br&gt;     SecondValue = 2&lt;br&gt;}&lt;/p&gt;

&lt;p&gt;Ofcourse, this is no more safe than enums are in C# but it suits me well.&amp;lt;/ipropertyinspector&amp;gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sandor Drieënhuizen</dc:creator><pubDate>Wed, 02 May 2012 08:44:46 -0000</pubDate></item></channel></rss>
