跳转到内容

Spring Framework

维基百科,自由的百科全书

这是本页的一个历史版本,由Rocman留言 | 贡献2006年4月30日 (日) 11:07编辑。这可能和当前版本存在着巨大的差异。

Spring Framework 是一个 Java/Java EE/.NET 的分层应用程序框架。该框架基于 Expert One-on-One Java EE Design and DevelopmentISBN 0-7645-4385-7)一文中的代码,并最初由 Rod Johnson 和 Juergen Hoeller et al 开发。The Spring Framework provides a simple approach to development that does away with numerous properties files and helper classes littering the codebase.

Spring 中包含的关键特性:

  • 强大的基于 JavaBeans 的应用了翻转控制(Inversion of Control,IoC)原则的配置管理,使得应用程序的组建更加快捷简易。
  • 数据库事务的一般化抽象层,允许插件式事务管理器,简化事务的划分使之与底层无关。
  • 内建的针对 JTA 和 单个 JDBC 数据源的一般化策略,使 Spring 的事务支持不要求 Java EE 环境,这与一般的 JTA 或者 EJB CMT 相反。
  • JDBC abstraction layer that offers a meaningful exception hierarchy (no more pulling vendor codes out of SQLException), simplifies error handling, and greatly reduces the amount of code programmers need to write. You'll never need to write another 'finally' block to use JDBC again. The JDBC-oriented exceptions comply with Spring's generic DAO (Data Access Object) exception hierarchy.
  • HibernateJDOiBATIS SQL Maps 集成: 以资源容器,DAO 实现和事务策略等形式。First-class Hibernate support with lots of IoC convenience features, addressing many typical Hibernate integration issues. All of these comply with Spring's generic transaction and DAO exception hierarchies.

As MVC patterns (such as Struts) often have difficulty in providing a clear framework for designing the Model part of an application, Spring's ability to work easily with such patterns means that developers can quickly refactor many unsuccessful approaches to make use of Spring's JDBC abstraction layer.

For a Spring framework tutorial, visit Wikibooks:Spring framework.