《高级Web技术》参考资料:3-应用web_5-J2EE框架_Spring Introduction

Web Technology 高级Web技术 Introduction to Spring Framework
deeper Web Technology 高级Web技术 Introduction to Spring Framework

Web Technology Spring Overview Spring是Rod主创的一个应用于J2E领域的轻量应用程序框架,其核心是一个 Oc容器以及AOP实现 Rod Johnson(Expert One-on-One J2EE Design and Development) ng Spring Web 为内为 Spring Web MVC Source lovel metadata Web Mvc Spring Context JSP/ expert one onone Spring DAO Apa inion context 2EE Development Vaidation JDBC suppo NNDL EJB support& Remoting without EJB Spring Ce an conta nor
Web Technology 2 Spring Overview Rod Johnson 《Expert One-on-One J2EE Design and Development》 ◼ Spring是Rod主创的一个应用于J2EE领域的轻量应用程序框架,其核心是一个 IOC容器以及AOP实现

Web Technology Spring's benefits Offering a lightweight JavaBean container that eliminates the need to write repetitive plumbing code such as lookups Providing an inversion of control framework that allows bean dependencies to be automatically resolved upon object instantiation Allowing cross cutting concerns such as transaction management to be woven into beans as"aspects"rather than becoming the concern of the business object Offering layers of abstraction on top of popular existing technologies such as jdbc and hibernate that ease their use and organize configuration management
Web Technology Spring’s benefits ▪ Offering a lightweight JavaBean container that eliminates the need to write repetitive plumbing code such as lookups ▪ Providing an inversion of control framework that allows bean dependencies to be automatically resolved upon object instantiation ▪ Allowing cross cutting concerns such as transaction management to be woven into beans as “aspects” rather than becoming the concern of the business object ▪ Offering layers of abstraction on top of popular existing technologies such as JDBC and Hibernate that ease their use and organize configuration management 3

Web Technology Spring Core a Spring's core container provides the fundamental functionality of the Spring framework a In this module you'll find Spring,s Bean Factory, the heart of any Spring- based application. A Bean Factory is an implementation of the factory pattern that applies loc to separate your application's configuration and dependency specifications from the actual application code ORM DAO Web Spring JDBC JEE Framework Integration Batis JMX Rich View Support JSPS FreeMarke AOP Spring Portlet MvC Spring AOP AspectJ integratic Core The loc container
Web Technology 4 Spring Core ◼ Spring’s core container provides the fundamental functionality of the Spring framework. ◼ In this module you’ll find Spring’s BeanFactory, the heart of any Springbased application. A BeanFactory is an implementation of the factory pattern that applies IoC to separate your application’s configuration and dependency specifications from the actual application code

Web Technology The Bean Factory Configuration mechanism for managing beans The most common is the Xml BeanFactory o Could theoretically be any type of configuration - XML Properties File LDAP
Web Technology The Bean Factory ▪ Configuration mechanism for managing beans ▪ The most common is the XmlBeanFactory ▪ •Could theoretically be any type of configuration - – XML - – Properties File - – Database - – LDAP ▪ 5 ... ...

Web Technology Application Context ApplicationContext is a sub- interface of Bean Factory and adds more useful features Support for resolving text messages Generic means of loading file resources Publishing of events WebApplicationContext is a sub-interface XmlWebApplication Context is the implementation used in web applications
Web Technology Application Context ▪ ApplicationContext is a sub-interface of BeanFactory and adds more useful features - – Support for resolving text messages - – Generic means of loading file resources - – Publishing of events ▪ WebApplicationContext is a sub-interface - XmlWebApplicationContext is the implementation used in web applications 6

Web Technology What is loc loc (Inversion of control) Also called DI (Dependency Injection) Hollywood Principle: Don't call me, I'lI call you A way of sorting out dependencies between objects and automatically "injecting"references to collaborating objects on demand The loc framework, usually via XML configuration files determines injection ■控制:对象的生命周期和对象间的关系
Web Technology 7 What is IoC ▪ IoC (Inversion of control) Also called DI (Dependency Injection) Hollywood Principle: "Don't call me, I'll call you.“ ▪ A way of sorting out dependencies between objects and automatically “injecting” references to collaborating objects on demand ▪ The IoC framework, usually via XML configuration files determines injection ◼ 控制: 对象的生命周期和对象间的关系

Web Technology loC Benefits Removes the responsibility of finding or creating dependent objects and moves it into configuration Reduces coupling between implementation objects and encourages interface based design Allows an application to be re-configured outside of code Can encourage writing testable components
Web Technology IoC Benefits ▪ Removes the responsibility of finding or creating dependent objects and moves it into configuration ▪ Reduces coupling between implementation objects and encourages interface based design ▪ Allows an application to be re-configured outside of code ▪ Can encourage writing testable components 8

Web Technology Anti-loC Example- Traditional ways C⊥ass private DataSource ds private static final string dataSourceJNDI="] Source private Connection getConnection() throws Exception t nu11) nitialContext context new InitialContextoi ds Data Source PortableRemoteObject. narrow(context. lookup(dataSourceJNDI), DataSource. class)i return ds getconnection ()i public void add(object xxx)(
Web Technology 9 Anti-IoC Example-Traditional ways class XxxDAO { private DataSource ds; private static final String dataSourceJNDI="jdbcDataSource"; private Connection getConnection() throws Exception { if (ds == null) { InitialContext context = new InitialContext(); ds = (DataSource) PortableRemoteObject.narrow(context.lookup(dataSourceJNDI), DataSource.class); } return ds.getConnection(); } public void add(Object xxx){ // ... } }

Web Technology loc Style Example class xxxdao i private DataSource ds; public void setData Source(DataSource ds)i this ds=ds i private Connection getConnection() throws Exception t return ds. getconnection ()i public void add(object xxx)i
Web Technology 10 IoC Style Example class XxxDAO { private DataSource ds; public void setDataSource(DataSource ds){ this.ds=ds; } private Connection getConnection() throws Exception { return ds.getConnection(); } public void add(Object xxx){ // ... } }
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_J2EE模式与框架struts(2).ppt
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_Hibernate-课件.ppt
- 《高级Web技术》参考资料:应用web - EJB 3RD EDITION - Richard Monson-Haefel.pdf
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB高级-9-事务处理.ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB高级-8-资源管理与EJB环境.ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB高级-11-EJB3..ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB高级-10-安全性控制..ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB开发-7-部署EJB应用.ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB开发-6-创建客户程序.ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB开发-5-编写Entity Bean.ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB开发-4-创建Session EJB.ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB基础-3-主要接口设计原则.ppt
- 《高级Web技术》参考资料:3-应用web_4-EJB_EJB基础-2-体系结构.ppt
- 《高级Web技术》参考资料:3-WS与工作流_4-Service web_BPELOverview.pdf
- 《高级Web技术》参考资料:2-Web上的数据标准-XML_XML基础—概述与语法.pdf
- 《高级Web技术》参考资料:2-soap&wsdl&uddi_4-Service web_WSDL.ppt
- 《高级Web技术》参考资料:2-soap&wsdl&uddi_4-Service web_UDDI.ppt
- 《高级Web技术》参考资料:2-soap&wsdl&uddi_4-Service web_Tomcat与SOAP&AXIS集成.ppt
- 《高级Web技术》参考资料:2-soap&wsdl&uddi_4-Service web_SOAP.ppt
- 《高级Web技术》参考资料:1-webapp outline_雅蛙网站的使用体验及对WEB2.0的认识.doc
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_ajax.ppt
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_Ajax介绍.ppt
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_DWR_ch03.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_DWR_ch05.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_ajax first essay.doc
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_Ajax in action中文版.doc
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_AJAXBasics.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_AJAXBasics_speakernoted.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_GWT.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_GWT_speakernoted.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_How_to_Design_a_large_AJAX_Application.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_ajax+J2EE_materials_开发保留标准浏览器功能的AJAX应用程序.doc
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE_Patterns.ppt
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE模式与框架struts(2).ppt
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE高级框架实战教学视频PPT_PPT_01MVC.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE高级框架实战教学视频PPT_PPT_02Struts简介.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE高级框架实战教学视频PPT_PPT_03Struts输入标签.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE高级框架实战教学视频PPT_PPT_04Struts其他标签.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE高级框架实战教学视频PPT_PPT_05案例1.pdf
- 《高级Web技术》参考资料:3-应用web_5-J2EE框架_阅读参考资料_J2EE高级框架实战教学视频PPT_PPT_06自定义标签.pdf