﻿<?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>Dave Meah commented on Kobe – Data Access done wrong</title><description>Don't just say it's bad show how it can be improved, with examples. Good and bad examples should be shown when writing this type of article.
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment21</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment21</guid><pubDate>Sun, 19 Apr 2009 17:56:32 GMT</pubDate></item><item><title>stuartd commented on Kobe – Data Access done wrong</title><description>re insolated = 'insolate - expose to the rays of the sun or affect by exposure to the sun' did you mean insulted?
  
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment20</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment20</guid><pubDate>Sun, 19 Apr 2009 00:06:37 GMT</pubDate></item><item><title>redsquare commented on Kobe – Data Access done wrong</title><description>There seems plenty of people who are willing to moan at every app that is put out in the public domain and actually spend hours writing blog posts to pull them apart. What is funny is that they all state they cannot put together a best practise demo because nobody will pay them to do so. Surely the time spent moaning would be better spent providing?
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment19</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment19</guid><pubDate>Fri, 17 Apr 2009 23:12:45 GMT</pubDate></item><item><title>Jim commented on Kobe – Data Access done wrong</title><description>Lot's of examples on the web of how not to do things...how about some examples of doing things right, or refactoring bad code like this into something that's ideal?
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment18</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment18</guid><pubDate>Fri, 17 Apr 2009 21:41:49 GMT</pubDate></item><item><title>Ayende Rahien commented on Kobe – Data Access done wrong</title><description>Jon,
  
The problem is that this method should NOT be written.
  
This is not the proper layer for it.
  
  
As for constructing the repository for this. All you need is transparent persistence and you are golden.
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment17</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment17</guid><pubDate>Fri, 17 Apr 2009 15:48:50 GMT</pubDate></item><item><title>Jon Galloway commented on Kobe – Data Access done wrong</title><description>Agree with the rest of the commenters - I'd love to see more explanation here. The rest of your Kobe posts have said "This is what is wrong, and this is how it should have been done". This one just says "This is wrong".
  
  
For those of us who don't use repositories and have never used EF, how should that that method be written? Or how should the repository be structured so the method was unnecessary?
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment16</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment16</guid><pubDate>Fri, 17 Apr 2009 15:43:24 GMT</pubDate></item><item><title>Rob Gibbens commented on Kobe – Data Access done wrong</title><description>I also agree...I post on repository alternatives would be great.  What's the strategy to keep the data access/orm choice (NHibernate / EF / Linq2Sql / etc) isolated and out of the "UI" layer?
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment15</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment15</guid><pubDate>Fri, 17 Apr 2009 15:20:35 GMT</pubDate></item><item><title>josh commented on Kobe – Data Access done wrong</title><description>hmm.. interesting comments. I'm partial to Rails's ActiveRecord with dynamic accesors, but you don't get that in c#. Otherwise, I have no strong bias for or against repository, and am curious why so many comments are.
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment14</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment14</guid><pubDate>Fri, 17 Apr 2009 15:19:18 GMT</pubDate></item><item><title>tawani commented on Kobe – Data Access done wrong</title><description>Who ever wrote that IUserRepository should be fired immediately. As a matter of fact, they shouldn't be allowed to touch code any more.
  
  
... Since everybody now an interface should have 100 methods...!
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment13</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment13</guid><pubDate>Fri, 17 Apr 2009 15:04:14 GMT</pubDate></item><item><title>LukeB commented on Kobe – Data Access done wrong</title><description>I think the point that Ayende is making is that a lot (most) of those methods are really domain behavior that don't have anything to do with data access per se and thus shouldn't be part of the data access layer.
  
  
Without looking at the code I suspect that this codebase has an anemic domain model.
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment12</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment12</guid><pubDate>Fri, 17 Apr 2009 15:02:11 GMT</pubDate></item><item><title>Flaker commented on Kobe – Data Access done wrong</title><description>Popular demand!!! repository alternative!!!
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment11</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment11</guid><pubDate>Fri, 17 Apr 2009 13:26:42 GMT</pubDate></item><item><title>James Brechtel commented on Kobe – Data Access done wrong</title><description>Ditto on what everyone else is saying... :)
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment10</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment10</guid><pubDate>Fri, 17 Apr 2009 13:08:34 GMT</pubDate></item><item><title>Adriaan commented on Kobe – Data Access done wrong</title><description>+1 on repository alternative
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment9</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment9</guid><pubDate>Fri, 17 Apr 2009 12:44:15 GMT</pubDate></item><item><title>J Healy commented on Kobe – Data Access done wrong</title><description>Count me in with the RepositoryAsFad crowd...
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment8</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment8</guid><pubDate>Fri, 17 Apr 2009 09:15:21 GMT</pubDate></item><item><title>Nick commented on Kobe – Data Access done wrong</title><description>+1 on repo alternative. 
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment7</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment7</guid><pubDate>Fri, 17 Apr 2009 09:07:26 GMT</pubDate></item><item><title>Nik commented on Kobe – Data Access done wrong</title><description>Another agreement with AdamB :) I wanna know!
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment6</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment6</guid><pubDate>Fri, 17 Apr 2009 08:40:13 GMT</pubDate></item><item><title>James commented on Kobe – Data Access done wrong</title><description>I agree with AdamB.  Ayende, could you please expand on this?
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment5</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment5</guid><pubDate>Fri, 17 Apr 2009 08:25:32 GMT</pubDate></item><item><title>CaliCoder commented on Kobe – Data Access done wrong</title><description>"Data access details are quite pervasive throughout the application, and the whole feeling of the application is of a circa 2001 sample app using stored procedures and hand rolled data access layers."
  
  
HAHA this is classic!  Writing those factories is like chasing watching a cat chase its tail... go find a biz problem that needs data access, abstract it, go find a biz problem that needs data access, abstract it.  Makes my hand shake just thinking about it =(
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment4</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment4</guid><pubDate>Fri, 17 Apr 2009 08:17:36 GMT</pubDate></item><item><title>AdamB commented on Kobe – Data Access done wrong</title><description>What alternative would you use to a Repository? Just ORM code such as the NHibernate DetachedCriteria API, HQL or LINQ in your services? Or even in your controllers? I'm asking because I respect your opinion and I've been using repositories for a while now, and find that they're a pretty useful abstraction.
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment3</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment3</guid><pubDate>Fri, 17 Apr 2009 08:09:56 GMT</pubDate></item><item><title>Rafal commented on Kobe – Data Access done wrong</title><description>How dare you say bad things about next sample from Microsoft? You barbarian, biting a hand that feeds you! MS programmers were working on it since 2001 so how can you expect the app to be modern and cutting edge?
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment2</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment2</guid><pubDate>Fri, 17 Apr 2009 07:25:26 GMT</pubDate></item><item><title>Nathan commented on Kobe – Data Access done wrong</title><description>&gt; I think that Repository is a fad, which is why I don’t use it much anymore myself
  
  
Would you mind writing some more about this in a new post? I'm intrigued.
</description><link>http://ayende.com/3950/kobe-data-access-done-wrong#comment1</link><guid>http://ayende.com/3950/kobe-data-access-done-wrong#comment1</guid><pubDate>Fri, 17 Apr 2009 06:57:43 GMT</pubDate></item></channel></rss>