<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Spring 2.5&#039;s Comprehensive Annotation Support</title>
	<atom:link href="http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/</link>
	<description>The voice of SpringSource</description>
	<lastBuildDate>Wed, 08 Feb 2012 17:31:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Steven Francolla</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-187463</link>
		<dc:creator>Steven Francolla</dc:creator>
		<pubDate>Wed, 23 Feb 2011 19:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-187463</guid>
		<description>Whew!  

Ok, I extended AnnotationMethodHandlerAccepter with its exact contents but made more extensible.  Then, I extended that with my custom accepter that overrides the invoker with a new one which, in writeWithMessageConverters, enables ioc of read/write executor closures to any inferred implementations of my ReadWriteInjectionHttpMessageConverter.  So, I can now detect my custom controller method annotations within the newly extensible handleResponseBody, map closures to specific ReadWriteInjectionHttpMessageConverter implementation types, which get executed on the converter during the writeWithMessageConverters process.

Outcome is I can now bridge any context declared on my custom annotations to the read/writeInternal methods.  In my case, I have a @ResponseJsonView annotation on which I define a usecase JsonView that gets automagically applied to the Jackson serialization.

I still have to wonder if there&#039;s already a pattern for custom controller annotation plugging-in that I wasn&#039;t aware of?

Cheers.</description>
		<content:encoded><![CDATA[<p>Whew!  </p>
<p>Ok, I extended AnnotationMethodHandlerAccepter with its exact contents but made more extensible.  Then, I extended that with my custom accepter that overrides the invoker with a new one which, in writeWithMessageConverters, enables ioc of read/write executor closures to any inferred implementations of my ReadWriteInjectionHttpMessageConverter.  So, I can now detect my custom controller method annotations within the newly extensible handleResponseBody, map closures to specific ReadWriteInjectionHttpMessageConverter implementation types, which get executed on the converter during the writeWithMessageConverters process.</p>
<p>Outcome is I can now bridge any context declared on my custom annotations to the read/writeInternal methods.  In my case, I have a @ResponseJsonView annotation on which I define a usecase JsonView that gets automagically applied to the Jackson serialization.</p>
<p>I still have to wonder if there&#039;s already a pattern for custom controller annotation plugging-in that I wasn&#039;t aware of?</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Francolla</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-186965</link>
		<dc:creator>Steven Francolla</dc:creator>
		<pubDate>Tue, 22 Feb 2011 03:52:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-186965</guid>
		<description>Juergen --

Any easy way to hook in support for custom Spring(v3.0.5) Controller method annotations?  I have a usecase for it and am staring at a pretty inaccessible AnnotationMethodHandlerAccepter and its ServletHandlerMethodInvoker implementation.  

Very high level, I want to relay a string value from the custom annotation to an ObjectMapper for use by my message converter.  Pseudo impl = within invoker.getModelAndView, when findAnnotation(ResponseBody) not null then string custVal = findAnnotation(MyCustAnnot).value, call handleResponseBody(returnVal, webReq, custVal)... and I can also build an appropriate override for writeWithMessageConverters.

Ideally, I wouldn&#039;t have to override much but it looks like I need to completely copy and customize AnnotationMethodHandlerAccepter.

Any other way to do this?

Thanks.


SF</description>
		<content:encoded><![CDATA[<p>Juergen &#8211;</p>
<p>Any easy way to hook in support for custom Spring(v3.0.5) Controller method annotations?  I have a usecase for it and am staring at a pretty inaccessible AnnotationMethodHandlerAccepter and its ServletHandlerMethodInvoker implementation.  </p>
<p>Very high level, I want to relay a string value from the custom annotation to an ObjectMapper for use by my message converter.  Pseudo impl = within invoker.getModelAndView, when findAnnotation(ResponseBody) not null then string custVal = findAnnotation(MyCustAnnot).value, call handleResponseBody(returnVal, webReq, custVal)&#8230; and I can also build an appropriate override for writeWithMessageConverters.</p>
<p>Ideally, I wouldn&#039;t have to override much but it looks like I need to completely copy and customize AnnotationMethodHandlerAccepter.</p>
<p>Any other way to do this?</p>
<p>Thanks.</p>
<p>SF</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Revue de Presse Xebia par J2EE, Agilité et SOA&#160;:&#160;Le blog de Xebia France</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-102022</link>
		<dc:creator>Revue de Presse Xebia par J2EE, Agilité et SOA&#160;:&#160;Le blog de Xebia France</dc:creator>
		<pubDate>Mon, 31 Mar 2008 16:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-102022</guid>
		<description>[...] Google avait défrayé la chronique en révélant Google Guice, le framework d&#8217;injection de dépendances d&#8217;Adwords dont la configuration est gérée avec du code Java plutôt qu&#8217;avec des fichiers XML. SpringSource a répondu avec l&#8217;utilisation élargie des annotations dans Spring 2.5 (@Autowired, etc) et le lancement de Spring Java Configuration Project. Ce deuxième chantier avance plus lentement, probablement parce que le concurrent Google Guice reste peu utilisé et parce que la tâche s&#8217;avère très délicate. Chris Beams nous présente les dernières évolutions dans Spring Java Configuration - What&#8217;s New in M3. Nous avons été sensibles à : [...]</description>
		<content:encoded><![CDATA[<p>[...] Google avait défrayé la chronique en révélant Google Guice, le framework d&#039;injection de dépendances d&#039;Adwords dont la configuration est gérée avec du code Java plutôt qu&#039;avec des fichiers XML. SpringSource a répondu avec l&#039;utilisation élargie des annotations dans Spring 2.5 (@Autowired, etc) et le lancement de Spring Java Configuration Project. Ce deuxième chantier avance plus lentement, probablement parce que le concurrent Google Guice reste peu utilisé et parce que la tâche s&#039;avère très délicate. Chris Beams nous présente les dernières évolutions dans Spring Java Configuration &#8211; What&#039;s New in M3. Nous avons été sensibles à : [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tOMPSON&#8217;s blog &#187; Blog Archive &#187; JSFDays summary</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-101030</link>
		<dc:creator>tOMPSON&#8217;s blog &#187; Blog Archive &#187; JSFDays summary</dc:creator>
		<pubDate>Wed, 19 Mar 2008 21:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-101030</guid>
		<description>[...] In the second session on Wednesday Jürgen Höller talked about new features in Spring 2.5 and how they could be used in a JSF environment. There were a lot of interesting new configuration options by using annotations I did not know. After the talk a discussion took place about what configurations should be done in external XML files and which configurations are better done with annotations. [...]</description>
		<content:encoded><![CDATA[<p>[...] In the second session on Wednesday Jürgen Höller talked about new features in Spring 2.5 and how they could be used in a JSF environment. There were a lot of interesting new configuration options by using annotations I did not know. After the talk a discussion took place about what configurations should be done in external XML files and which configurations are better done with annotations. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SpringSource Team Blog &#187; Spring Dependency Injection &#38; Java 5 (including slides and code)</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-100935</link>
		<dc:creator>SpringSource Team Blog &#187; Spring Dependency Injection &#38; Java 5 (including slides and code)</dc:creator>
		<pubDate>Tue, 18 Mar 2008 16:15:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-100935</guid>
		<description>[...] Spring 2.5&#039;s Comprehensive Annotation Support by Juergen Hoeller [...]</description>
		<content:encoded><![CDATA[<p>[...] Spring 2.5&#39;s Comprehensive Annotation Support by Juergen Hoeller [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juergen Hoeller</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-97047</link>
		<dc:creator>Juergen Hoeller</dc:creator>
		<pubDate>Wed, 06 Feb 2008 12:21:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-97047</guid>
		<description>That onjava article is OK. Its recommendations are pretty sound. (Even if some people may still e.g. prefer constructor injection etc... that&#039;s partly a question of style.)

Anyway, @Autowired is quite different from traditional autowiring in terms of its implications on manageability of the overall configuration. In contrast to a pure convention (that&#039;s what autowiring by name or by type actually is), it specifically applies to annotated fields/methods/constructors only - being free from side effects in that respect (i.e. no accidental mismatch in the use of the convention, leading to too much or too little autowiring).

You have a good point there that annotation-based configuration may lead to better isolation of artifacts, since you won&#039;t have to touch &quot;global&quot; configuration files that often anymore.

One point in the article that doesn&#039;t really apply anymore is the following: &quot;Remember, with powerful IDEs, such as Eclipse and IntelliJ, Java code is much easier to read, maintain, and manage than XML files!&quot; Well, when using the Spring IDE Eclipse plugin or IntelliJ IDEA 6/7, Spring XML bean definition files are actually pretty convenient to navigate, maintain and manage... Of course, annotations in Java code are even easier maintain. In any case, well-designed XML configuration is still a viable choice as well!

Juergen</description>
		<content:encoded><![CDATA[<p>That onjava article is OK. Its recommendations are pretty sound. (Even if some people may still e.g. prefer constructor injection etc&#8230; that&#039;s partly a question of style.)</p>
<p>Anyway, @Autowired is quite different from traditional autowiring in terms of its implications on manageability of the overall configuration. In contrast to a pure convention (that&#039;s what autowiring by name or by type actually is), it specifically applies to annotated fields/methods/constructors only &#8211; being free from side effects in that respect (i.e. no accidental mismatch in the use of the convention, leading to too much or too little autowiring).</p>
<p>You have a good point there that annotation-based configuration may lead to better isolation of artifacts, since you won&#039;t have to touch &#034;global&#034; configuration files that often anymore.</p>
<p>One point in the article that doesn&#039;t really apply anymore is the following: &#034;Remember, with powerful IDEs, such as Eclipse and IntelliJ, Java code is much easier to read, maintain, and manage than XML files!&#034; Well, when using the Spring IDE Eclipse plugin or IntelliJ IDEA 6/7, Spring XML bean definition files are actually pretty convenient to navigate, maintain and manage&#8230; Of course, annotations in Java code are even easier maintain. In any case, well-designed XML configuration is still a viable choice as well!</p>
<p>Juergen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baptiste</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-96958</link>
		<dc:creator>Baptiste</dc:creator>
		<pubDate>Wed, 06 Feb 2008 06:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-96958</guid>
		<description>This article is very interesting. I&#039;m a Spring user since some time now. We&#039;re still using Full-XML configuration approach, but I really consider going to full annotations mode, since it simplifies the XML file.

At this address http://www.onjava.com/pub/a/onjava/2006/01/25/spring-xml-configuration-best-practices.html, the author discourages autowiring (first point).

I feel he has some poing about being explicit, but on the other hand Spring autowiring will always load the implementation you think since if it finds two candidates (without any @Qualifier) it will just stop.

OTOH, in our case, using annotations&amp;autowiring would reduce the risk of collisions between context files modifications. In fact, we already have more than one context file, but we still find ourselves modifying the same file and having to merge. With annotations-based config, the isolation would be better I think.

I know this article is now a bit old, but I&#039;d be very interested to know what you think about it.
Maybe even what you
- *thought* about it if you already knew about it before ?
- and maybe which new Spring feature you&#039;d think would deprecate some of the article&#039;s statements (mainly about autowiring btw, but also for some other points) ?

Thanks and Cheers.</description>
		<content:encoded><![CDATA[<p>This article is very interesting. I&#039;m a Spring user since some time now. We&#039;re still using Full-XML configuration approach, but I really consider going to full annotations mode, since it simplifies the XML file.</p>
<p>At this address <a href="http://www.onjava.com/pub/a/onjava/2006/01/25/spring-xml-configuration-best-practices.html" rel="nofollow">http://www.onjava.com/pub/a/onjava/2006/01/25/spring-xml-configuration-best-practices.html</a>, the author discourages autowiring (first point).</p>
<p>I feel he has some poing about being explicit, but on the other hand Spring autowiring will always load the implementation you think since if it finds two candidates (without any @Qualifier) it will just stop.</p>
<p>OTOH, in our case, using annotations&amp;autowiring would reduce the risk of collisions between context files modifications. In fact, we already have more than one context file, but we still find ourselves modifying the same file and having to merge. With annotations-based config, the isolation would be better I think.</p>
<p>I know this article is now a bit old, but I&#039;d be very interested to know what you think about it.<br />
Maybe even what you<br />
- *thought* about it if you already knew about it before ?<br />
- and maybe which new Spring feature you&#039;d think would deprecate some of the article&#039;s statements (mainly about autowiring btw, but also for some other points) ?</p>
<p>Thanks and Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juergen Hoeller</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-96321</link>
		<dc:creator>Juergen Hoeller</dc:creator>
		<pubDate>Mon, 04 Feb 2008 01:41:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-96321</guid>
		<description>Naaman,

You do have a point, of course. For true separation of concerns, externalized metadata (such as XML) is the better choice - and still a first-class choice in Spring 2.5. We just give people more choice now, while we historically more or less enforced externalized configuration.

Note that annotations that you use in your application classes do *not* have to present in the classpath for loading those classes. At least for recent JDK versions, non-present annotations will simply be ignored when loading your class. This arguably makes it more acceptable to embed Spring-specific annotations. And of course, with respect to the JSR 250 and JPA annotations: Those aren&#039;t Spring-specific in the first place, so shouldn&#039;t cause as much concern.

Overall, Spring still aims to provide the most comprehensive XML component metadata format around: very flexible but also as concise as possible (given the fact of externalization to begin with). This will always remain a key differentiator between Spring and other solutions.

Juergen</description>
		<content:encoded><![CDATA[<p>Naaman,</p>
<p>You do have a point, of course. For true separation of concerns, externalized metadata (such as XML) is the better choice &#8211; and still a first-class choice in Spring 2.5. We just give people more choice now, while we historically more or less enforced externalized configuration.</p>
<p>Note that annotations that you use in your application classes do *not* have to present in the classpath for loading those classes. At least for recent JDK versions, non-present annotations will simply be ignored when loading your class. This arguably makes it more acceptable to embed Spring-specific annotations. And of course, with respect to the JSR 250 and JPA annotations: Those aren&#039;t Spring-specific in the first place, so shouldn&#039;t cause as much concern.</p>
<p>Overall, Spring still aims to provide the most comprehensive XML component metadata format around: very flexible but also as concise as possible (given the fact of externalization to begin with). This will always remain a key differentiator between Spring and other solutions.</p>
<p>Juergen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naaman Lifshitz</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-96216</link>
		<dc:creator>Naaman Lifshitz</dc:creator>
		<pubDate>Sun, 03 Feb 2008 08:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-96216</guid>
		<description>Juergen,

Regardless of the usefulness of the various Spring annotations, I feel that  annotations (Spring&#039;s or any other framework&#039;s for that matter) introduce a dependency on that particular framework/technology. 

In my opinion, an annotated POJO (e.g. Spring&#039;s @Transactional annotation) is no longer a POJO, don&#039;t you think?

For instance, if I want to reuse parts of my domain-model in another application, which does not use Spring, I still need to include the Spring jars in that application&#039;s classpath, don&#039;t I?

In its early days Spring used to advocate non-intrusiveness, and that was a principal differentiator between Spring and EJBs. Now, it seems to me that as Spring offers more and more annotations (which, again, are very useful) domain-specific code becomes more and more dependent on the Spring framework. I realize many people find XML configuration un-cool, but I think at least that way true separation of concerns is maintained.

I am not trying to be polemic. I am really very interested in your thoughts on this.

Thanks,
Naaman</description>
		<content:encoded><![CDATA[<p>Juergen,</p>
<p>Regardless of the usefulness of the various Spring annotations, I feel that  annotations (Spring&#039;s or any other framework&#039;s for that matter) introduce a dependency on that particular framework/technology. </p>
<p>In my opinion, an annotated POJO (e.g. Spring&#039;s @Transactional annotation) is no longer a POJO, don&#039;t you think?</p>
<p>For instance, if I want to reuse parts of my domain-model in another application, which does not use Spring, I still need to include the Spring jars in that application&#039;s classpath, don&#039;t I?</p>
<p>In its early days Spring used to advocate non-intrusiveness, and that was a principal differentiator between Spring and EJBs. Now, it seems to me that as Spring offers more and more annotations (which, again, are very useful) domain-specific code becomes more and more dependent on the Spring framework. I realize many people find XML configuration un-cool, but I think at least that way true separation of concerns is maintained.</p>
<p>I am not trying to be polemic. I am really very interested in your thoughts on this.</p>
<p>Thanks,<br />
Naaman</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Baptiste</title>
		<link>http://blog.springsource.org/2008/01/28/spring-25s-comprehensive-annotation-support/comment-page-1/#comment-96091</link>
		<dc:creator>Baptiste</dc:creator>
		<pubDate>Sat, 02 Feb 2008 10:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/01/28/spring-25s-comprehensive-annotation-support/#comment-96091</guid>
		<description>Problem with the captcha ? I just tried to post a comment, and only the alt text appeared for the image...</description>
		<content:encoded><![CDATA[<p>Problem with the captcha ? I just tried to post a comment, and only the alt text appeared for the image&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

