---
title: "spring"
author: "oakeye"
date: "2011-03-28T11:58:09Z"
tags: []
categories: ["企业架构"]
slug: "spring"
draft: false
lastmod: "2011-03-28T11:58:09Z"
id: 977240
url: "https://oakeye.iteye.com/blog/977240"
---

其中base-package为需要扫描的包（含所有子包） @Service用于标注业务层组件，@Controller用于标注控制层组件（如struts中的action）,@Repository用于标注数据访问组件，即DAO组件，而@Component泛指组件，当组件不好归类的时候，我们可以使用这个注解进行标注。