<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.netapsys.fr/index.php/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Netapsys Blog - Tag - NoSuchBeanDefinitionException</title>
  <link>http://blog.netapsys.fr/index.php/</link>
  <atom:link href="http://blog.netapsys.fr/index.php/feed/tag/NoSuchBeanDefinitionException/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>fr</language>
  <pubDate>Wed, 08 Feb 2012 21:50:52 +0100</pubDate>
  <copyright>Netapsys 2008 - 2011</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Spring annotations vs standards annotations: Que choisir entre @Autowired et @Resource?</title>
    <link>http://blog.netapsys.fr/index.php/post/2010/03/05/Spring-annotations-vs-standards-annotations%3A-Que-choisir-entre-Autowired-et-Resource</link>
    <guid isPermaLink="false">urn:md5:dcc690928f9aabe1260c165b35520ddf</guid>
    <pubDate>Sun, 07 Mar 2010 19:32:00 +0100</pubDate>
    <dc:creator>Abderrazek CHINE</dc:creator>
        <category>Java J2EE</category>
        <category>@Autowired</category><category>@Repository</category><category>@Resource</category><category>@Service</category><category>Annotation</category><category>Autowire</category><category>BeanCreationException</category><category>Junit</category><category>NoSuchBeanDefinitionException</category><category>Spring</category><category>Test</category>    
    <description>&lt;p&gt;&lt;br /&gt;
L'objet de ce billet, en deux parties, est de comparer l'annotation standard @Resource du package &lt;em&gt;javax.annotation.Resource&lt;/em&gt; à celle de &lt;br /&gt;
spring @Autowired du package org.springframework.beans.factory.annotation.&lt;br /&gt;
Nous verrons les situations où nous sommes obligés de favoriser les annotations standards.&lt;br /&gt;
&lt;br /&gt;
L'utilisation des annotations réduit considérablement la verbosité des fichiers de configuration de Spring.&lt;br /&gt;
C'est aussi le même constat pour d'autres frameworks.&lt;br /&gt;
En effet, le principe &quot;convention Over configuration&quot; participe à cette diffusion.&lt;br /&gt;
Certes, les &quot;pour&quot; et les &quot;contre&quot; ne manqueront pas d'arguments pour débattre.&lt;br /&gt;Mais ceci n'est pas l'objet de ce billet.&lt;br /&gt;
L'objectif ici est de comparer ces deux types d'annotations.&lt;br /&gt;
Pour cela, nous nous appuyons sur un projet java simple, sans maven, que vous pouvez créer sous Eclipse en suivant les étapes décrites ci-après.&lt;br /&gt;
Nous écrivons d'abord un projet avec les annotations de Spring puis nous illustrons les difficultés qui nous amèneront à introduire les annotations standards.&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;    &lt;p&gt;PREMIERE PARTIE: Annotations Spring @Autowired, @Service &amp; cie

Dans cette première partie, le projet java exemple ci-après n'utilise que les annotations de Spring.

Pré-requis:

Le projet java standard doit avoir les librairies nécessaires suivantes : spring-2.5.6.jar, spring-test-2.5.6.jar et Junit 4.4.jar ( apache-commons-**.jar). 
Notez qu'il... &lt;a href=&quot;http://blog.netapsys.fr/index.php/post/2010/03/05/Spring-annotations-vs-standards-annotations%3A-Que-choisir-entre-Autowired-et-Resource&quot;&gt;&lt;em&gt;Lire&lt;/em&gt; Spring annotations vs standards annotations: Que choisir entre @Autowired et @Resource?&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2010/03/05/Spring-annotations-vs-standards-annotations%3A-Que-choisir-entre-Autowired-et-Resource#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2010/03/05/Spring-annotations-vs-standards-annotations%3A-Que-choisir-entre-Autowired-et-Resource#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/atom/comments/135</wfw:commentRss>
      </item>
    
</channel>
</rss>
