Spring framework

来源:互联网 发布:网络调查问卷赚钱 编辑:程序博客网 时间:2024/05/18 03:56

Spring Values:

  • Spring is a non-invasive framework.   Spring Application code can be run without Spring. Lock-in to Spring minimized.  Migration to higher Spring is easier.
  • Aims to facilitate good programming practice, such as programming to interfaces, rather than classes.
  • Spring promotes pluggability. Think of application objects as named services.
  • Spring facilitates the extraction of configuration values from java code into XML or properties files.

Inversion of Control and Dependency Injection

"Hollywood principle" ----- Don't call me , I'll call you. Instead of Application call framework's API, framework's API invoke appliction code.  Dependency Injection objects never load custom properties or go to database to load configuration -- the framework is whooly responsible for actually reading configuration.

 

Types of Dependency Injection:

  • Setter Injection
  • Constructor Injection
  • Method Injection
原创粉丝点击