最常见的10个spring面试问题

原创
2016/09/24 15:49
阅读数 222

原文来自:http://javarevisited.blogspot.jp/2011/09/spring-interview-questions-answers-j2ee.html

我对几个自己认为感兴趣的问题做个翻译

Question 4: What are the difference between BeanFactory and ApplicationContext in spring? (answer)
Answer: This one is very popular spring interview question and often asks in entry level interview. ApplicationContext is the preferred way of using spring because of functionality provided by it and interviewer wanted to check whether you are familiar with it or not.

ApplicationContext.

BeanFactory
Here we can have more than one config files possible
In this only one config file or .xml file
Application contexts can publish events to beans that are registered as listeners
Doesn’t support.
Support internationalization (I18N) messages
It’s not
Support application life-cycle events, and validation.
Doesn’t support.
Supports  many enterprise services such JNDI access, EJB integration, remoting
Doesn’t support.


Read more: http://javarevisited.blogspot.com/2011/09/spring-interview-questions-answers-j2ee.html#ixzz4L9mzB6Bh

BeanFactory和ApplicationContext之间有什么区别:

ac:可以使用更多的配置文件,bf:只能使用一个文件或xml文件

ac:ac可以在注册时被监听器发布事件,bf:不支持

ac:支持i18n国际化消息,bf:没有

ac:支持应用的生命周期事件和验证,这里指的可能是实现了某些接口,bf:不支持

ac:支持喝多企业级业务像jndi连接,ejg整合,远程访问等,bf:不支持

 

Question 5: What are different modules in spring?
Answer: spring has seven core modules
1.      The Core container module
2.      Application context module
3.      AOP module (Aspect Oriented Programming)
4.      JDBC abstraction and DAO module
5.      O/R mapping integration module (Object/Relational)
6.      Web module
7.      MVC framework module


Read more: http://javarevisited.blogspot.com/2011/09/spring-interview-questions-answers-j2ee.html#ixzz4L9o9XL6b

spring模块之间有什么区别

spring有7个核心模块

1.core容器模块

2.应用上下文模块

3.aop模块,面向接口编程

4.jdbc抽象和dao模块

5.对象关系映射整合模块

6.web模块

7.mvc框架

 

 

展开阅读全文
打赏
0
1 收藏
分享
加载中
更多评论
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部