---
title: "Annotation和xml哪个好？"
author: "llade"
date: "2008-04-12T11:56:20Z"
tags: []
slug: "annotation-xml"
draft: false
lastmod: "2008-04-12T11:56:20Z"
id: 182039
url: "https://llade.iteye.com/blog/182039"
---

各有优劣
spring 配置里xml + autoproxy的方式可以工作的很好。但target bean 要管理好，名字或者类型要有特征性，以便autoproxy能够识别。
annotation 也能工作的很好，但分散到了每个具体的类。最好是要annotation的方法集中到父类。这样避免了分散。