---
title: "Spring中Bean继承注意事项"
author: "hadix"
date: "2011-11-01T11:30:46Z"
tags: []
categories: ["编程语言"]
slug: "spring-bean"
draft: false
lastmod: "2011-11-01T11:30:46Z"
id: 1226558
url: "https://hadix.iteye.com/blog/1226558"
---

今天在排除项目错误的时候发现,Spring的Bean继承并不是所有的属性都可以继承自parent的.

*depends on, autowire mode, dependency check, singleton, scope, lazy init.*

上述这些属性,全部都不从parent继承,而使用child自己的设置,如果不设置将采用默认值,跟parent无关.