Spring註解@Component、@Repository、@Service、@Controller區別:
•@Service用於標註業務層組件
•@Controller用於標註控制層組件(如struts中的action)
•@Repository用於標註數據訪問組件,即DAO組件
•@Component泛指組件,當組件不好歸類的時候,我們可以使用這個註解進行標註。
Spring註解@Component、@Repository、@Service、@Controller區別:
•@Service用於標註業務層組件
•@Controller用於標註控制層組件(如struts中的action)
•@Repository用於標註數據訪問組件,即DAO組件
•@Component泛指組件,當組件不好歸類的時候,我們可以使用這個註解進行標註。
一. 二. 三. ! 作 者 : Yaopengfei(姚鵬飛) 博客地址 : http://www.cnblogs.com