﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Harry S.  commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>@Dave,
  
Maybe you should check out the Nitpicker Corner at the end of the post...
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment10</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment10</guid><pubDate>Tue, 09 Jun 2009 22:05:26 GMT</pubDate></item><item><title>Ian Nelson commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>Who knew NH could double-up as a poetry generator?!
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment9</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment9</guid><pubDate>Tue, 09 Jun 2009 14:16:06 GMT</pubDate></item><item><title>Dan F commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>Hahahahaha, nice!
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment8</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment8</guid><pubDate>Tue, 09 Jun 2009 12:38:05 GMT</pubDate></item><item><title>Dave commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>Sorry, make that 'never a good solution.'
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment7</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment7</guid><pubDate>Tue, 09 Jun 2009 07:29:30 GMT</pubDate></item><item><title>Dave commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>Security by obscurity is ever a good solution. And in this case it would only make your work harder when the shit hit the fence. SQL Performance analyze would become a real bitch.
  
  
Preventing people to run queries is a solution. That's where our nhibernate repository comes in. It's basically a facade around the ISession interface, but it prevents submitting a raw query. Only nhibernate objects or an ICriteria/IQuery instance is allowed.
  
  
Code should be as self describing as possible. 
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment6</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment6</guid><pubDate>Tue, 09 Jun 2009 07:28:22 GMT</pubDate></item><item><title>Tobin Harris commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>Hahahaha. That's awesome. 
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment5</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment5</guid><pubDate>Mon, 08 Jun 2009 19:14:46 GMT</pubDate></item><item><title>configurator commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>No no no, this just won't work. You are bound to have collisions here. You should use this function to avoid collisions:
  
  
public string GetName(string prefix, uint code) {
  
    StringBuilder result = new StringBuilder(prefix);
  
    while (code &gt; words.Length) {
  
        result.Append("_");
  
        result.Append(words[code % words.Length);
  
        code /= words.Length;
  
    }
  
    result.Append("_");
  
    result.Append(words[code % words.Length]);
  
}
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment4</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment4</guid><pubDate>Mon, 08 Jun 2009 18:54:30 GMT</pubDate></item><item><title>matt hinze commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>3rd requirement, the names of tables must be the names of entities in the system: 
  
  
foreach (var clazz in configuration.ClassMappings)
  
clazz.Table.Name = getRandomFromExistingTableNames();
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment3</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment3</guid><pubDate>Mon, 08 Jun 2009 18:54:27 GMT</pubDate></item><item><title>Rafal commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>Ayende, this great technique should make it into next edition of  'Teach Yourself Application Architecture in a Weekend' 
</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment2</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment2</guid><pubDate>Mon, 08 Jun 2009 18:40:06 GMT</pubDate></item><item><title>jdn commented on NHibernate – Get Thou Out Of My Database – 2nd Edition</title><description>I once suggested to my DBA team that all table names should be First Names of People, like 'Steve' and 'Lisa' because then you can write SQL like "Insert into 
&lt;marginally".
  
  
The ones that laughed were the good ones.
  
  
&gt;</description><link>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment1</link><guid>http://ayende.com/4051/nhibernate-get-thou-out-of-my-database-2nd-edition#comment1</guid><pubDate>Mon, 08 Jun 2009 17:40:01 GMT</pubDate></item></channel></rss>