IoC   :   Inversion of Control

spring是通过依赖注入(Dependency Injection )实现的IoC

IoC容器

   *   必须将被管理的对象定义到spring配置文件中
   *   必须定义constructor或者setter方法,让spring将对象注入进去

AOP  :  Aspect Oriented Programming

spring带来了一种编程方式,面向切面的编程。

AOP是一个概念

在一个程序中分离一个功能,这种功能的实现是与程序不相关的类。
同时能够使很多类共享这个功能。

关注是他的主要点,要关注某个功能,要关注切入点。

实现AOP有2点:
1、Pointcut(切入点)是一个范围---表达式
2、Advice(具体实现)功能放到那个方法



spring对hibernate的支持

注入SessionFactory到spring配置文件中

<Bean id="SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactory">
        <property nema="configLocation">
                <value>classpath:hibernate.cfg.xml</value>
        </property>
</Bean>

posted on 2009-02-13 08:40 天长 阅读(117) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: