Академический Документы
Профессиональный Документы
Культура Документы
Technologique
avancées : Your partner of choice
Framework Spring
M. Belhassen OUESLATI
Ingénieur Java/J2EE
Objectifs
contactDao.createContact(nouveauContact);
}
Commentaire :
<beans>
<bean id="ContactService"
class="com.spring.ContactServiceImp">
<property name="ContactDao">
<ref local="CompteBancaireDao" />
</property>
</bean>
<bean id="ContactDao"
class="com.spring.ContactDaoImpl">
</bean>
</beans>
Commentaire :
"com/spring/applicationContext.xml");
ContactService cs =(ContactService)ctx.getBean("ContactService");
Commentaire :
Première étape :
Chargement du fichier de config : applicationContext.xml
Seconde opération :
Récupération de l'objet avec tous ses liens :
ctx. etBean("ContactService ");
1.3 Questions ?
Comment faire pour changer l'implémentation de ContactDao sans changer
celle de ContactService?
(Exemple : AnotherContactDaoImpl implements ContactDao)
Réaliser le Test
Créer une nouvelle configuration