The Spring Framework Training Get to know Spring Framework Rohit Prabhakar

Slides:



Advertisements
Similar presentations
MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
Advertisements

11 Copyright © 2005, Oracle. All rights reserved. Creating the Business Tier: Enterprise JavaBeans.
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Apache Struts Technology
Spring, Hibernate and Web Services 13 th September 2014.
Introduction to the Spring Framework University of Kansas January 2009 This presentation and example application are available at
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
An architecture for webb applications, J2EE
Next Generation Node (NGN) Technical Overview April 2007.
Enterprise Applications & Java/J2EE Technologies Dr. Douglas C. Schmidt Professor of EECS.
© 2005, Cornell University. Rapid Application Development using the Kuali Architecture (Struts, Spring and OJB) A Case Study Bryan Hutchinson
J2EE vs..NET Nigam Patel. Topics Background –Web Services, J2EE and.NET Similarities Differences Conclusion –Pros and Con (J2EE and.NET)
Nikolaos Korfiatis The Java 2 Enterprise Edition Platform Dept. of Management & Technology-Athens University of Economics and Business Java 2 Platform.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Address - #22, 1 st Floor, Station View Road, Kodambakkam, Chennai JTech Soft Solutions Website:
The Spring Framework: A brief introduction to Inversion of Control James Brundege
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
Using Third-Party Frameworks in Building Blocks™ David Ashman Principal Architect, Product Development.
The Spring Framework A quick overview. The Spring Framework 1. Spring principles: IoC 2. Spring principles: AOP 3. A handful of services 4. A MVC framework.
Struts 2.0 an Overview ( )
UNIT-V The MVC architecture and Struts Framework.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
NetArchive Suite Workshop 2011 Technical Track - Code refactoring with the Spring Framework.
Spring Framework. Spring Overview Spring is an open source layered Java/J2EE application framework Created by Rod Johnson Based on book “Expert one-on-one.
Introduction to the Spring Framework By: Nigusse A. Duguma Kansas State university Department of Computer Science Nov 20, 2007.
Spring Overview, Application demo -Midhila Paineni 09/23/2011 Spring Overview, Application demo9/8/20151.
Spring. Spring Overview Spring Container Concepts Spring and AOP Spring and Data Access Managing Transactions and Resources Remoting and Accessing Enterprise.
Christopher Jeffers August 2012
Introduction to the Spring Framework Rajesh. Spring Mission Statement J2EE should be easier to use OO design is more important than any implementation.
Enterprise Computing COSC 617 Jeff Schmitt September 7,2006.
Copyright (C) 2009 by Abdelmonaim Remani. All rights reserved. By Abdelmonaim Remani Polymathic-coder.com Silicon Valley Code.
第十四章 J2EE 入门 Introduction What is J2EE ?
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
Text 16 de mayo de 2009 Spring Framework Part I. Dependency Injection Buenos Aires, May 2009.
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Opus College - overview. OpusCollege - background First project: ICT Capacity Building Mozambican Higher Education Institutions Partners: RUG Groningen,
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Spring Framework. Spring Overview Spring is an open source layered Java/J2EE application framework Created by Rod Johnson Based on book “Expert one-on-one.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Introduction to Web Dimitar Nenchev Ivan Nakov
A Presentation By V AIBHAV S AHARAN Web-enHanced Information Management COMS E6125.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
Spring Framework. About spring Spring is the most popular application development framework for enterprise Java. Millions of developers around the world.
Apache Struts. J2EE Web Application using MVC design pattern Why MVC? Separate components = easier maintenance – Model component holds object data – View.
Enterprise Java Overview Panos Konstantinidis Java Developer JUG Leader & Java Champion
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions Buenos Aires, June 2009.
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
Spring and DWR Frameworks for Rich Web Enterprise Application Thomas Wiradikusuma Presentation to the 20 th.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
1 Spring Framework April, 2012 Lam Ho Lam To. © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2 1.Spring Overview 2.Framework.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions Buenos Aires, June 2009.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Overview of the Spring Framework Introducing.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009.
J2EE Platform Overview (Application Architecture)
J2EE Lecture 6: Spring – IoC and Dependency Injection
Introduction to J2EE Architecture
Unit 6-Chapter 2 Struts.
By Ru Shen Department of Computer Science UAlbany, 2008
Intro to Spring CJUG - January 2013.
Building an Integrable XBRL Portal Daniel Hamm German Central Bank
Testing a persistence layer
Developing and testing enterprise Java applications
Presentation transcript:

The Spring Framework Training Get to know Spring Framework Rohit Prabhakar

Get to know Spring Framework The Spring Framework: Overview Topics: What is Spring? Spring modules Why use Spring Dependency injection / IOC in detail Lab Work

Get to know Spring Framework What is Spring? The Spring Framework is an open source application framework for the Java platform and.NET Framework (Spring.NET) It is based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002). “ Spring is an open source framework created to address the complexity of enterprise application development. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development.

Get to know Spring Framework How does the Spring Framework looks like?

Get to know Spring Framework How does the Spring Framework looks like? Each of the modules (or components) that comprise the Spring framework can stand on its own or be implemented jointly with one or more of the others. The functionality of each component is as follows: The core container: The core container provides the essential functionality of the Spring framework. A primary component of the core container is the BeanFactory, an implementation of the Factory pattern. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application's configuration and dependency specification from the actual application code. Spring context: The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, , internalization, validation, and scheduling functionality. Spring AOP: The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. As a result you can easily AOP-enable any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With Spring AOP you can incorporate declarative transaction management into your applications without relying on EJB components.

Get to know Spring Framework How does the Spring Framework looks like? Spring DAO: The Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections. Spring DAO's JDBC-oriented exceptions comply to its generic DAO exception hierarchy. Spring ORM: The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these comply to Spring's generic transaction and DAO exception hierarchies. Spring Web module: The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects. Spring MVC framework: The MVC framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including JSP, Velocity, Tiles, iText, and POI.

Get to know Spring Framework What does Spring Framework Offers: Summary Inversion of Control container: configuration of application components and lifecycle management of Java objects Aspect-oriented programming: enables implementation of cross-cutting routines Data access: working with relational database management systems on the Java platform using JDBC and object-relational mapping tools Transaction management: unifies several transaction management APIs and coordinates transactions for Java objects Model-view-controller: a HTTP and Servlet-based framework providing hooks for extension and customizationServlet Remote Access framework: configurative RPC-style export and import of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP) Convention-over-configuration: a rapid application development solution for Spring-based enterprise applications is offered in the Spring Roo module Batch processing: a framework for high-volume processing featuring reusable functions including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management Authentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi).Acegi Remote Management: configurative exposure and management of Java objects for local or remote configuration via JMX Messaging: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS APIs Testing: support classes for writing unit tests and integration tests

Get to know Spring Framework Why use Spring? Have you ever encountered these question? Cant’ I have a simpler solution? How can I handle my every changing requirements? How can be the architecture flexible? Can’t I have everything in components which can be verified independently? Can I make a plug and play software? How can the software components reusable and changeable? Should we use EJB? As it makes the product complex, unpredictable and un- maintainable, non-portable and everything is framework committed. …………….. And many more like these SPRING IS THE ANSWER!

Get to know Spring Framework Spring Framework’s Mission Statement We believe that: J2EE should be easier to use It is best to program to interfaces, rather than classes. Spring reduces the complexity cost of using interfaces to zero. JavaBeans offer a great way of configuring applications. OO design is more important than any implementation technology, such as J2EE. Checked exceptions are overused in Java. A platform shouldn't force you to catch exceptions you're unlikely to be able to recover from. Testability is essential, and a platform such as Spring should help make your code easier to test. We aim that: Spring should be a pleasure to use Your application code should not depend on Spring APIs Spring should not compete with good existing solutions, but should foster integration. (For example, JDO, Toplink, and Hibernate are great O/R mapping solutions. We don't need to develop another one.)

Get to know Spring Framework Are there any benefits of using spring? Pure Java Founded on POJO-based development Ordinary Java classes that follow no special APIs Non-invasive for pre-existing POJOs Rewards framework-independent business logic Encourages new software to be written as POJOs Results in highly portable, reusable, and verifiable software Less Custom Code Expand capabilities with less code Extensive and tested service abstractions , JMS, JMX, JSF, JDBC, etc… Replaces generic corporate libraries Mitigates custom integration activities Consistency eases integration because spring platform is easy to use Turn-key solution Spring components can be integrated quickly, with minimal effort and predictable results

Get to know Spring Framework Are there any benefits of using spring? Helps only where needed Modularity allows only relevant components to be introduced into the application. For instance choose one: Spring BeanFactory Spring JMX Spring JDBC Framework can be interfaced in deep or shallow layers. Interfaces are consistent at each layer Widely Available Spring is integrated into numerous frameworks Broad adoption possible because the container is portable and lightweight The container itself is designed as a POJO Integration without third-party support Performance overhead is rarely a consideration as it is not EJB ;)

Get to know Spring Framework ?

The Core Spring Module: Defining Beans and Dependency Injection Topics: Setting bean properties Supplying constructor arguments Using factory methods Dependency injection Supplying other beans as properties or constructor args

Get to know Spring Framework Spring Hello World: What will we do? Code a plain Java class model – Use the interface pattern by coding a HelloWorld interface and a HelloWorldImpl implementation Configure the Spring IoC container Instantiate the Spring IoC container Acquire the object from the Spring IoC container – The client must only have knowledge of the interface, HelloWorld

Get to know Spring Framework Spring Hello World: Create POJO 1.Create a interface HelloWorld public interface HelloWorld { public void execute(); } 2.Create an implementing class HelloWorldImpl public class HelloWorldImpl implements HelloWorld { public void execute() { System.out.println("Hello World!"); }

Get to know Spring Framework Spring Hello World: Spring IOC Configuration <beans xmlns=" xmlns:xsi=" xsi:schemaLocation=" <bean id="helloWorld" class="HelloWorldImpl" />

Get to know Spring Framework Spring Hello World: Execute import org.springframework.beans.factory.*; import org.springframework.context.support.*; public class Main{ public static void main(String[] args) { BeanFactory beanFactory = new ClassPathXmlApplicationContext( "applicationContext.xml"); HelloWorld helloWorld = (HelloWorld) beanFactory.getBean("helloWorld"); helloWorld.execute(); }

Get to know Spring Framework Spring Hello World: Output Run the main class and you shall see “ Hello World” printed.

Spring Reference Top-level documentation page Wiki Forum Books Spring Recipes. APress 2008 Spring in Action. Manning 2007 Agile Java Development with Spring, Hibernate and Get to know Spring Framework