<?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"
	>
<channel>
	<title>Comments on: Spring IoC: The Java Enterprise drug</title>
	<atom:link href="http://nutrun.com/weblog/spring-ioc-the-java-enterprise-drug/feed/" rel="self" type="application/rss+xml" />
	<link>http://nutrun.com/weblog/spring-ioc-the-java-enterprise-drug/</link>
	<description>nutrun</description>
	<pubDate>Thu, 04 Dec 2008 03:51:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: Truy</title>
		<link>http://nutrun.com/weblog/spring-ioc-the-java-enterprise-drug/#comment-102</link>
		<dc:creator>Truy</dc:creator>
		<pubDate>Wed, 28 Jun 2006 15:06:32 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=25#comment-102</guid>
		<description>Nice article!

You should consider looking closely at Hivemind, which is a very nice IOC framework that avoids the  mess Spring configuration can be, in an elegant way.</description>
		<content:encoded><![CDATA[<p>Nice article!</p>
<p>You should consider looking closely at Hivemind, which is a very nice IOC framework that avoids the  mess Spring configuration can be, in an elegant way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Role Model</title>
		<link>http://nutrun.com/weblog/spring-ioc-the-java-enterprise-drug/#comment-101</link>
		<dc:creator>Role Model</dc:creator>
		<pubDate>Sun, 18 Jun 2006 18:38:26 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=25#comment-101</guid>
		<description>Spring framework has become indispensable for me too, but I only use the Ioc funcionality.
http://bloggingg.blogspot.com/</description>
		<content:encoded><![CDATA[<p>Spring framework has become indispensable for me too, but I only use the Ioc funcionality.<br />
<a href="http://bloggingg.blogspot.com/" rel="nofollow">http://bloggingg.blogspot.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://nutrun.com/weblog/spring-ioc-the-java-enterprise-drug/#comment-98</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sun, 18 Jun 2006 00:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=25#comment-98</guid>
		<description>Well you asked for it...

Let me reflect:  I think you're saying that IoC is all about functional decomposition.  And that people are using IoC at too low level of granularity.

But who defines what a component is?  It seems like a subjective decision, like deciding whether a virus is "alive" or not, or whether chimpanzees are "intelligent".  Is this the role of an "architect"?

Secondly, how do you respond to cross-cutting concerns; design constraints such as logging, security, remoting, asynchrony, transaction control, new domain models, etc.?

Objects have two responsibilities - the first to its callers, and the second to the environment in which it operates.  So I like IoC as a way of a class declaring to the world to "treat me like an object".  Objects need to become more "environmentally" aware.

Now I think that your discussion of interface vs. implementation misses out on one of the core OO concepts: message passing.  Even in the early stages of a project, injection is not just about functional decomposition, it is about deferring choices of the medium through which a message can pass.  Some people call this "context".

By using IoC only at the component level, you prevent control over the fine grained message passing, and this leads to cross cutting concerns being implemented in multiple places.

Anyway, a few points:

- Using classes breaks the whole concept of IoC, and
- ...leads to the Impl smell, you know the one, where every single class has a corresponding interface

Both these statements imply a code-base in transition.  The first: an interface hasn't been defined yet, but at least there is a seperation of complexity.  But even when injecting classes rather than interfaces, you still don't guarantee the actual implementation.  There are various interceptors that can sit between the class under test and the injected class.

The second: Once you've defined an interface, you only have one implementation.  But one assumes that you've introduced an interface for a reason.

- Castrated version of Spring IoC...

It wasn't just programmatic configuration of Spring.  It was the use of a fluent interface to express the wiring.  Given that we'd changed container at least once on the project, I think this was quite elegant.

-...in which you could only use name based constructor Dependency Injection

Spring supports multiple patterns of injection, but I think it's ok to narrow this down on any given project so that there is a consistent metaphor.  In this case we are enforcing the "Good Citizen" concept.  But exceptions are still possible...

-I think IoC should be really carefully thought out and avoided until the design has been considered more

I've always felt that "Design" isn't a thing.  It is a process.  Thus talking about the "design" is a bit like talking about the "integration".   I think that design is about considering options.  At the end of a good design process you have something that satisfies all the constraints.  So let's do it all the time.  But lets use consistent metaphors to enable that design process, in the same way that we can use TDD as a standard approach the unit, integration, and acceptance levels</description>
		<content:encoded><![CDATA[<p>Well you asked for it&#8230;</p>
<p>Let me reflect:  I think you&#8217;re saying that IoC is all about functional decomposition.  And that people are using IoC at too low level of granularity.</p>
<p>But who defines what a component is?  It seems like a subjective decision, like deciding whether a virus is &#8220;alive&#8221; or not, or whether chimpanzees are &#8220;intelligent&#8221;.  Is this the role of an &#8220;architect&#8221;?</p>
<p>Secondly, how do you respond to cross-cutting concerns; design constraints such as logging, security, remoting, asynchrony, transaction control, new domain models, etc.?</p>
<p>Objects have two responsibilities - the first to its callers, and the second to the environment in which it operates.  So I like IoC as a way of a class declaring to the world to &#8220;treat me like an object&#8221;.  Objects need to become more &#8220;environmentally&#8221; aware.</p>
<p>Now I think that your discussion of interface vs. implementation misses out on one of the core OO concepts: message passing.  Even in the early stages of a project, injection is not just about functional decomposition, it is about deferring choices of the medium through which a message can pass.  Some people call this &#8220;context&#8221;.</p>
<p>By using IoC only at the component level, you prevent control over the fine grained message passing, and this leads to cross cutting concerns being implemented in multiple places.</p>
<p>Anyway, a few points:</p>
<p>- Using classes breaks the whole concept of IoC, and<br />
- &#8230;leads to the Impl smell, you know the one, where every single class has a corresponding interface</p>
<p>Both these statements imply a code-base in transition.  The first: an interface hasn&#8217;t been defined yet, but at least there is a seperation of complexity.  But even when injecting classes rather than interfaces, you still don&#8217;t guarantee the actual implementation.  There are various interceptors that can sit between the class under test and the injected class.</p>
<p>The second: Once you&#8217;ve defined an interface, you only have one implementation.  But one assumes that you&#8217;ve introduced an interface for a reason.</p>
<p>- Castrated version of Spring IoC&#8230;</p>
<p>It wasn&#8217;t just programmatic configuration of Spring.  It was the use of a fluent interface to express the wiring.  Given that we&#8217;d changed container at least once on the project, I think this was quite elegant.</p>
<p>-&#8230;in which you could only use name based constructor Dependency Injection</p>
<p>Spring supports multiple patterns of injection, but I think it&#8217;s ok to narrow this down on any given project so that there is a consistent metaphor.  In this case we are enforcing the &#8220;Good Citizen&#8221; concept.  But exceptions are still possible&#8230;</p>
<p>-I think IoC should be really carefully thought out and avoided until the design has been considered more</p>
<p>I&#8217;ve always felt that &#8220;Design&#8221; isn&#8217;t a thing.  It is a process.  Thus talking about the &#8220;design&#8221; is a bit like talking about the &#8220;integration&#8221;.   I think that design is about considering options.  At the end of a good design process you have something that satisfies all the constraints.  So let&#8217;s do it all the time.  But lets use consistent metaphors to enable that design process, in the same way that we can use TDD as a standard approach the unit, integration, and acceptance levels</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Malamidis</title>
		<link>http://nutrun.com/weblog/spring-ioc-the-java-enterprise-drug/#comment-99</link>
		<dc:creator>George Malamidis</dc:creator>
		<pubDate>Sat, 17 Jun 2006 14:34:05 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=25#comment-99</guid>
		<description>Hey Ade, long time no see. All good points. I take it you're having second thoughts about IoC?

-Have you tried using dependency injection without a framework? What benefits does Spring bring over just using the “new” operator?

IoC, being sort of a glorified Factory Pattern, offers most of Factory's benefits. For instance, single point of replacing, say, XmlRepository with a HibernateRepository implementation to Repository. Imagine if XmlRepository has been instantiated using 'new' all over the place. This should also apply to your second question.

On stubbing external dependencies... Yes, it's not a silver bullet and should be used with caution. However, if the system has been well designed, the internal implementation of the stubbed class's services should not affect the stub and certainly should not affect the test that's making use of it. If it has a method, getTotal() which is being used by the class under test, it's just the result of this method that we care about and the way this is being calculated should not matter in the scope of the test in question.

- ... Does it help you higher-quality systems quicker?

IMHO, it does help organize the codebase and replace components' implementations with little pain. This replacement is not required that often, but when it is, Ioc can play a major role to an easy transition.

I suspect you already have your version of the answers to the above questions, and I would really like to hear it.</description>
		<content:encoded><![CDATA[<p>Hey Ade, long time no see. All good points. I take it you&#8217;re having second thoughts about IoC?</p>
<p>-Have you tried using dependency injection without a framework? What benefits does Spring bring over just using the “new” operator?</p>
<p>IoC, being sort of a glorified Factory Pattern, offers most of Factory&#8217;s benefits. For instance, single point of replacing, say, XmlRepository with a HibernateRepository implementation to Repository. Imagine if XmlRepository has been instantiated using &#8216;new&#8217; all over the place. This should also apply to your second question.</p>
<p>On stubbing external dependencies&#8230; Yes, it&#8217;s not a silver bullet and should be used with caution. However, if the system has been well designed, the internal implementation of the stubbed class&#8217;s services should not affect the stub and certainly should not affect the test that&#8217;s making use of it. If it has a method, getTotal() which is being used by the class under test, it&#8217;s just the result of this method that we care about and the way this is being calculated should not matter in the scope of the test in question.</p>
<p>- &#8230; Does it help you higher-quality systems quicker?</p>
<p>IMHO, it does help organize the codebase and replace components&#8217; implementations with little pain. This replacement is not required that often, but when it is, Ioc can play a major role to an easy transition.</p>
<p>I suspect you already have your version of the answers to the above questions, and I would really like to hear it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ade</title>
		<link>http://nutrun.com/weblog/spring-ioc-the-java-enterprise-drug/#comment-100</link>
		<dc:creator>ade</dc:creator>
		<pubDate>Sat, 17 Jun 2006 13:52:12 +0000</pubDate>
		<guid isPermaLink="false">http://new-site.nutrun.com/?p=25#comment-100</guid>
		<description>I have a few questions:

-Have you tried using dependency injection without a framework? What benefits does Spring bring over just using the "new" operator?

- Did the people who trying to programmatically configure Spring consider just using the "new" operator to manually wire their objects together?

- With regard to, "I much prefer stubbing them out by extending them in a private class inside the unit test and make them behave as I would expect to", have you had any problems maintaining code that uses that technique a lot? What do you do when the class that you've stubbed out changes and you then have to track down all of it's sub-classes in the tests?

- With regard to, "Spring has become as indispensable to ‘Enterprise’ projects as an application server", do you think this is a good thing? Does it help you higher-quality systems quicker?</description>
		<content:encoded><![CDATA[<p>I have a few questions:</p>
<p>-Have you tried using dependency injection without a framework? What benefits does Spring bring over just using the &#8220;new&#8221; operator?</p>
<p>- Did the people who trying to programmatically configure Spring consider just using the &#8220;new&#8221; operator to manually wire their objects together?</p>
<p>- With regard to, &#8220;I much prefer stubbing them out by extending them in a private class inside the unit test and make them behave as I would expect to&#8221;, have you had any problems maintaining code that uses that technique a lot? What do you do when the class that you&#8217;ve stubbed out changes and you then have to track down all of it&#8217;s sub-classes in the tests?</p>
<p>- With regard to, &#8220;Spring has become as indispensable to ‘Enterprise’ projects as an application server&#8221;, do you think this is a good thing? Does it help you higher-quality systems quicker?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
