﻿<?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>Colin Jack commented on DI &amp; IoC are not about testing!</title><description>@J.P. Hamilton
  
"There was a group of people saying that they shouldn't have to write their apps a certain way in order to do testing. I thought that this was odd, because DI, IoC and designing to interfaces have always been about maintainability and flexibility for me. The fact that it is easy to test this kind of code says a lot."
  
  
I think there are definitely people out there who have found that the ICustomer/IBlahService interfaces often don't pay off in normal application (rather than framework )code. 
  
  
Doesn't mean we don't use IoC/DI, just means that we don't necessarily use it as much or as early as others and it also probably means that we don't buy into some of the arguments for DI that are normally trotted out.  And to be clear it doesn't mean we're against interfaces or dependency inversion, just means we draw the line differently.
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment21</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment21</guid><pubDate>Thu, 27 Mar 2008 12:49:20 GMT</pubDate></item><item><title>Bruno commented on DI &amp; IoC are not about testing!</title><description>  
@The Other Steve
  
  
I believe it´s better running on the same server too. IIS 7 offers great tools, it´s more than just a web server today.
  
  
I´m gonna try to argument about performance.
  
  
I´ll check what MS ISA can offer for us, Thanks!
  
  
Bruno
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment20</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment20</guid><pubDate>Wed, 26 Mar 2008 19:56:59 GMT</pubDate></item><item><title>Bruno commented on DI &amp; IoC are not about testing!</title><description>OK! Thanks Ayende.
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment19</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment19</guid><pubDate>Wed, 26 Mar 2008 19:42:56 GMT</pubDate></item><item><title>Ayende Rahien commented on DI &amp; IoC are not about testing!</title><description>Bruno,
  
I am strongly leaning toward NServiceBus for this type of things
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment18</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment18</guid><pubDate>Wed, 26 Mar 2008 19:39:51 GMT</pubDate></item><item><title>Bruno commented on DI &amp; IoC are not about testing!</title><description>Here is the performance POST:
  
[SOA-Future-Batches]
  
http://www.ayende.com/Blog/archive/2008/03/07/SOA-Future-Batches.aspx
  
  
Thanks!
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment17</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment17</guid><pubDate>Wed, 26 Mar 2008 19:33:22 GMT</pubDate></item><item><title>Bruno commented on DI &amp; IoC are not about testing!</title><description>  
Oh, actually I do not undertand "chatty", but now I got it. 
  
I remeber one of your last posts about creating a method Process( MethodToProcessConfig methodsToProcess) to reduce IO.
  
May be I should create some kind of "unit of work" handling behind the scene, just like NHibernate does with the database calls 
  
(or find some OSS tool that does it for remote calls).
  
Do you know some framework that deals with this issues?
  
  
Thanks!
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment16</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment16</guid><pubDate>Wed, 26 Mar 2008 19:30:03 GMT</pubDate></item><item><title>Ayende Rahien commented on DI &amp; IoC are not about testing!</title><description>Mainly,
  
Chatty interfaces.
  
Imagine that to render a single page you have to make 15 calls to different services.
  
No problem if they are on the same server, big issue if they are on different servers
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment15</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment15</guid><pubDate>Wed, 26 Mar 2008 19:10:15 GMT</pubDate></item><item><title>The Other Steve commented on DI &amp; IoC are not about testing!</title><description>"Our web app´s components (services and repositories) should run on another server (not the web server) -- Client´s new Security Policy."
  
  
Bruno,
  
  
The company I work for has been doing that for 10 years.  I have a lot of experience with DCOM, Remoting, SOAP, etc. etc. for decoupling web and app layers onto different physical tiers.
  
  
After years of doing this, I can assure that you'll never get performance.  Everything will be slow, it won't matter how many servers you toss at it.  Even a single user will be much slower than you expect.
  
  
A better solution which we started implemented about two years ago.  Using Microsoft's ISA(or similar) to publish your web app.  Then your app runs on an internal server, and ISA is just sending the HTML back and forth across the wire.  We also use F5 load balancers here, and I was told the latest version offers similar functionality.  We were going to move to that, but budgets got tight.
  
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment14</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment14</guid><pubDate>Wed, 26 Mar 2008 19:06:39 GMT</pubDate></item><item><title>Bruno commented on DI &amp; IoC are not about testing!</title><description>  
I haven´t designed it thinking about remoting, in the beginning, but all those components are totally stateless.
  
  
What kind of scalability issues are you concerned about?
  
  
Thanks!
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment13</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment13</guid><pubDate>Wed, 26 Mar 2008 19:01:10 GMT</pubDate></item><item><title>Ayende Rahien commented on DI &amp; IoC are not about testing!</title><description>Bruno,
  
Actually, changing something to be remote is something that I would be easy about, unless it was designed this way.
  
Too much chance for chatty interfaces and scalability issues
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment12</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment12</guid><pubDate>Wed, 26 Mar 2008 18:40:07 GMT</pubDate></item><item><title>Bruno commented on DI &amp; IoC are not about testing!</title><description>  
The project manager have told me about a new requirement this week (during development time): 
  
  
Our web app´s components (services and repositories) should run on another server (not the web server) -- Client´s new Security Policy.
  
  
I dont´t know exactly how (usign COM+, .NET Remoting or probably WCF), ***but the point is that those components are totally decoupled, 
  
thanks to Windsor Container (IoC/DI framework) it is gonna be easy.
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment11</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment11</guid><pubDate>Wed, 26 Mar 2008 18:29:00 GMT</pubDate></item><item><title>J.P. Hamilton commented on DI &amp; IoC are not about testing!</title><description>It's funny that you mention this. I was just thinking the same thing. Remember all those typemock discussions a few months back? There was a group of people saying that they shouldn't have to write their apps a certain way in order to do testing. I thought that this was odd, because DI, IoC and designing to interfaces have always been about maintainability and flexibility for me. The fact that it is easy to test this kind of code says a lot.  
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment10</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment10</guid><pubDate>Wed, 26 Mar 2008 17:54:48 GMT</pubDate></item><item><title>Christopher Bennage commented on DI &amp; IoC are not about testing!</title><description>We were recently contracted to take a prototype app and get it ready for their production team.  This meant taking what is essentially just  spike or proof of concept and making it into a real codebase.  The client, a software shop, wanted a list of the tasks we would perform.  We discussed using DI to reduce coupling, but that wasn't a strong sell for them.  However, they want a unit test suite added, and so that became our "excuse" for using IoC.
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment9</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment9</guid><pubDate>Wed, 26 Mar 2008 13:28:13 GMT</pubDate></item><item><title>Daniel Fernandes commented on DI &amp; IoC are not about testing!</title><description>DI and IoC are quite different things.
  
DI (using either constructors, members such as properties or why not methods or external classes such as factories) can indeed help testing but the principal useful aspect of it is that it will naturally lead to application of the Single Responsability Principle and usually as well of the Separation Of Concerns Principle.
  
  
Because DI is a pain as we end up with a lot of specialized classes IoC can be used to provide flexibility of object graph dependencies management and configuration of individual dependencies.
  
  
My personal experience has been that DI through its different forms is something to encourage, now regarding IoC I still sometimes struggle to understand whether it is best to hide the container (I used Castle Windsor) from within a rich object model.
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment8</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment8</guid><pubDate>Wed, 26 Mar 2008 12:41:06 GMT</pubDate></item><item><title>Chuggle commented on DI &amp; IoC are not about testing!</title><description>DI &amp; IoC are not JUST about testing would be a fairer comment
  
  
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment7</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment7</guid><pubDate>Wed, 26 Mar 2008 11:03:46 GMT</pubDate></item><item><title>AgileJedi commented on DI &amp; IoC are not about testing!</title><description>I'd take it a step further....I hate when people say that Unit Tests are for testing! Unit Tests are meant to be a design tool.....if you are only worried about the testing value than don't write them at all....just use user tests.
  
  
Also, can someone tell me why I have read a few others reeling against the term "Dependancy Injection"? To me, this is the most descriptive term for one of the key functions of an IoC!
  
  
AJ
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment6</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment6</guid><pubDate>Wed, 26 Mar 2008 10:25:40 GMT</pubDate></item><item><title>Tuna Toksoz commented on DI &amp; IoC are not about testing!</title><description>Interfaces &amp; Dependency Injection help an application be pluggable(i mean increased decoupling)  and then it helps testing. We can say that increased testability is a "desired" side effect.
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment5</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment5</guid><pubDate>Wed, 26 Mar 2008 05:04:35 GMT</pubDate></item><item><title>The Other Steve commented on DI &amp; IoC are not about testing!</title><description>"DI &amp; IoC are about decoupling, better flexibility, having a central place to go to and increasing the maintainability of out applications. "
  
  
Seems to me that's what makes it perfect for unit testing.
  
  
:-)
  
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment4</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment4</guid><pubDate>Wed, 26 Mar 2008 04:22:39 GMT</pubDate></item><item><title>Matthew Podwysocki commented on DI &amp; IoC are not about testing!</title><description>Totally agreed with this position.  Loose coupling is the goal, although unit testing capabilities is a nice side effect of such a position.  The containers also have the benefit of managing the lifetimes of objects, handling interception and so on.  Unit testing isn't my main goal when I'm using them, but it makes it nice...
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment3</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment3</guid><pubDate>Wed, 26 Mar 2008 03:55:51 GMT</pubDate></item><item><title>Steve B. commented on DI &amp; IoC are not about testing!</title><description>I agree with this position 1000% but often there is confusion among the masses, usually coming from a lack of understanding of good OO software design principles.
  
  
I always tell my developers that the point of DI, IoC, Interfaces, etc. is to support just the loose-coupling that you mention here.  This approach to software design allows easy extensibility points, ONE OF WHICH IS TESTING but that's hardly the only reason for your application's code  to be designed for extensibility and flexibility, to be sure.
  
  
This kind of thing goes to what I consider to be the true heart of the pro-unit-testing argument: desinging your applicaiton so that it can be unit tested effectively forces you to do the good design work you should already be doing anyway if you really know what you are doing in your profession :)
  
  
-Steve B.
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment2</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment2</guid><pubDate>Wed, 26 Mar 2008 01:25:22 GMT</pubDate></item><item><title>hammett commented on DI &amp; IoC are not about testing!</title><description>For someone that didn't buy IoC two years ago, you sure changed a lot :-))
</description><link>http://ayende.com/3214/di-ioc-are-not-about-testing#comment1</link><guid>http://ayende.com/3214/di-ioc-are-not-about-testing#comment1</guid><pubDate>Wed, 26 Mar 2008 00:31:47 GMT</pubDate></item></channel></rss>