复旦大学:《高级Web技术》3-应用web_5-J2EE框架_spring_教学课件PPT_Introduction to Spring Framework

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_4-EJB_教学课件PPT_EJB高级-9-事务处理.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB高级-8-资源管理与EJB环境.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB高级-11-JavaEE 5、EJB3.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB高级-10-安全性控制..ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB开发-7-部署EJB应用.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB开发-6-创建客户程序.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB开发-5-编写Entity Bean.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB开发-4-创建Session EJB.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB基础-3-主要接口设计原则.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB基础-2-体系结构.ppt
- 复旦大学:《高级Web技术》3-应用web_4-EJB_教学课件PPT_EJB基础-1-概述.ppt
- 复旦大学:《高级Web技术》3-应用web_3-J2EE-组件-服务-通讯_教学课件PPT_servletandjsp.ppt
- 复旦大学:《高级Web技术》3-应用web_3-J2EE-组件-服务-通讯_教学课件PPT_Java Naming and Directory Interface JNDI.ppt
- 复旦大学:《高级Web技术》3-应用web_3-J2EE-组件-服务-通讯_教学课件PPT_Java Message Service JMS.ppt
- 复旦大学:《高级Web技术》3-应用web_3-J2EE-组件-服务-通讯_教学课件PPT_javabean-javamail-tld-jdbc.ppt
- 复旦大学:《高级Web技术》3-应用web_2-J2EE概述_教学课件PPT_J2EE overview.ppt
- 复旦大学:《高级Web技术》3-应用web_1-分布式计算与中间件概述_教学课件PPT_分布式计算与中间件概述.ppt
- 复旦大学:《高级Web技术》2-Web上的数据标准-XML_6-XML应用_[07级]教学课件PPT_xml应用.ppt
- 复旦大学:《高级Web技术》2-Web上的数据标准-XML_5-XML链接语言-XLL_[07级]教学课件PPT_xml-xll.ppt
- 复旦大学:《高级Web技术》2-Web上的数据标准-XML_4-XML程序接口-java&XML_[07级]教学课件PPT_xml-java.ppt
- 复旦大学:《高级Web技术》3-应用web_5-J2EE框架_教学课件PPT_J2EE模式与框架struts(J2EE模式与框架简介).ppt
- 复旦大学:《高级Web技术》4-Service web_1-SOA和WS概述_[07级]教学课件PPT_SOA Introduction.ppt
- 复旦大学:《高级Web技术》4-Service web_1-SOA和WS概述_[07级]教学课件PPT_Web Service概述.ppt
- 复旦大学:《高级Web技术》4-Service web_2-soap&wsdl&uddi_[07级]教学课件PPT_SOAP.ppt
- 复旦大学:《高级Web技术》4-Service web_2-soap&wsdl&uddi_[07级]教学课件PPT_Tomcat与SOAP&AXIS集成.ppt
- 复旦大学:《高级Web技术》4-Service web_2-soap&wsdl&uddi_[07级]教学课件PPT_UDDI.ppt
- 复旦大学:《高级Web技术》4-Service web_2-soap&wsdl&uddi_[07级]教学课件PPT_WSDL.ppt
- materials_5-语义web_Web Ontology Language:OWL.pdf
- materials_5-语义web_A Quick Introduction to OWL Web Ontology Language.ppt
- materials_5-语义web_RDF 入门 推荐标准 TransWiki - W3CHINA.ORG 开放翻译计划(OTP).doc
- 高级Web技术:RDF介绍.ppt
- materials_5-语义web_Languages for Semantic Web(台湾大同大學).ppt
- materials_5-语义web_SemanticWorks User and Reference Manual.pdf
- materials_5-语义web_Where are the Semantics in the Semantic Web.pdf
- materials_5-语义web_语义Web服务 Semantic Web Services.pdf
- Web3D_2-Web上的数据标准-XML_web3D 高级Web技术 Web3D.ppt
- Web3D_2-Web上的数据标准-XML_《Sun elearning 大学》项目实施手册v3.0.doc
- Web3D_资料_2-Web上的数据标准-XML_secondlife完全指南攻略电子书.pdf
- XML基础—概述与语法_2-Web上的数据标准-XML_XML改错.ppt
- XML应用_2-Web上的数据标准-XML_xml应用 高级W be 技术 XML应用.pdf