spring框架简介

来源:互联网 发布:进口牛奶推荐 知乎 编辑:程序博客网 时间:2024/05/20 21:20

1.什么是Spring?

Spring是分层的JavaSE/EE full-stack(一站式) 轻量级开源框架

* Spring框架有对三层的每层解决方案:

web层:Spring MVC.

持久层:JDBC Template

业务层:Spring的Bean管理.

2.spring框架的核心

IOC:(Inverse of Control 反转控制)

控制反转:将对象的创建权,交由Spring完成.

AOP:AspectOriented Programming

是面向对象的功能延伸.不是替换面向对象,是用来解决OO中一些问题

3. Spring框架加载配置文件:

ApplicationContext 应用上下文,加载Spring 框架配置文件

加载classpath:

     new ClassPathXmlApplicationContext("applicationContext.xml"); //加载classpath下面配置文件.

加载磁盘路径:

     new FileSystemXmlApplicationContext("applicationContext.xml"); //加载磁盘下配置文件.相当于webroot的根目录

0 0