Introduction to the Spring Framework University of Kansas January 2009 This presentation and example application are available at

Slides:



Advertisements
Similar presentations
Introduction to the Spring Framework
Advertisements

Spring, Hibernate and Web Services 13 th September 2014.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Fast Track to ColdFusion 9. Getting Started with ColdFusion Understanding Dynamic Web Pages ColdFusion Benchmark Introducing the ColdFusion Language Introducing.
© 2005, Cornell University. Rapid Application Development using the Kuali Architecture (Struts, Spring and OJB) A Case Study Bryan Hutchinson
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
© Internna Technologies 1 IWebMvc Features, Possibilities & Goals.
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.
An Introduction to Hibernate Matt Secoske
UNIT-V The MVC architecture and Struts Framework.
Spring Roo CS476 Aleksey Bukin Peter Lew. What is Roo? Productivity tool Allows for easy creation of Enterprise Java applications Runs alongside existing.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
Java Frameworks Indy Java Users Group January 29, 2003.
JDBC Session 5 Tonight: Data Access Patterns 1.J2EE Architecture & Design Patterns 2.The Data Access Tier 3.Data Access Patterns –DataAccessObject (DAO)
NetArchive Suite Workshop 2011 Technical Track - Code refactoring with the Spring Framework.
Introduction to the Spring Framework By: Nigusse A. Duguma Kansas State university Department of Computer Science Nov 20, 2007.
OSGi.
Copyright 2006, Codeguild, Inc Spring Framework Fundamentals March, 2006 Larry Hamel Codeguild, Inc.
Spring Overview, Application demo -Midhila Paineni 09/23/2011 Spring Overview, Application demo9/8/20151.
UPortal Developers MIT August 2004 Persistence Strategy for uPortal 3 Mike DeSimone the r-smart group
Agenda What is Hibernate Spring Integration Questions Overview
The Spring Framework Training Get to know Spring Framework Rohit Prabhakar
Persistence Store Project Proposal.
OpusCollege and the use of Spring and iBatis
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
Opus College - overview. OpusCollege - background First project: ICT Capacity Building Mozambican Higher Education Institutions Partners: RUG Groningen,
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.
Spring Database Access Ojitha Kumanayaka Copyright © Virtusa, 2007.
JBoss at Work Databases and JBoss Chapter 4 Jeff Schmitt October 26, 2006.
Domain and Persistence Patterns. Fundamental Pattern Types Design Patterns Business Logic Patterns.
A Presentation By V AIBHAV S AHARAN Web-enHanced Information Management COMS E6125.
Ganymede Simultaneous Release | © 2008 by Springsite B.V., The Netherlands made available under the EPL v1.0 Teneo Ganymede Simultaneous Release.
Spring Framework. About spring Spring is the most popular application development framework for enterprise Java. Millions of developers around the world.
Struts Framework Anna Paščenko. What is Struts?  An open source framework for building Java web applications.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
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.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
Spring and DWR Frameworks for Rich Web Enterprise Application Thomas Wiradikusuma Presentation to the 20 th.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
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.
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.
Introduction Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Overview of the Spring Framework Introducing.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
Introduction – ORM, Helloworld Application
Fundamentals of MyBATIS
Singleton Academy, Pune. Course syllabus Singleton Academy Pune – Course Syllabus1.
EJB Enterprise Java Beans JAVA Enterprise Edition
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009.
Hibernate Java Persistence API. What is Persistence Persistence: The continued or prolonged existence of something. Most Applications Achieve Persistence.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
CS520 Web Programming Spring – Inversion of Control Chengyu Sun California State University, Los Angeles.
Training What’s Spring? The leading full-stack Java/JEE application framework.
The Holmes Platform and Applications
J2EE Lecture 6: Spring – IoC and Dependency Injection
A very brief introduction
By Ru Shen Department of Computer Science UAlbany, 2008
Intro to Spring CJUG - January 2013.
CS5220 Advanced Topics in Web Programming Spring – Web MVC
Lecture 1: Multi-tier Architecture Overview
CS5220 Advanced Topics in Web Programming Spring – Web MVC
Component Technology Bina Ramamurthy 2/25/2019 B.Ramamurthy.
Developing and testing enterprise Java applications
Presentation transcript:

Introduction to the Spring Framework University of Kansas January 2009 This presentation and example application are available at

References ◦ Spring documentation ◦ Spring API - index.html index.html ◦ Introduction to the Spring Framework 2.5, by Rod Johnson (Originator of Spring) - trotoSpring25 trotoSpring25 ◦ Spring in Action, 2nd Edition, Manning Publishing, August 2007 ◦ Pro Spring 2.5, Apress Publishing, August 2008 ◦ Maven - ◦ Maven - book/index.html

What is Spring? ◦ A Container  Creates objects and makes them available to your application ◦ A Framework  Provides an infrastructure of classes that make it easier to accomplish tasks

The Spring Framework Official 1.0 release in 2004 Current release (January 2009) is ◦ See: Works with Java 1.4 or 1.5 or 1.6 and J2EE 1.3 and Java EE 5 ◦ See: /reference/new-in-2.html /reference/new-in-2.html

What does Spring provide? ◦ Lightweight container and framework  Most of your code will be unaware of the Spring framework  Use only the parts you of Spring you want ◦ Manages dependencies between your objects  Encourages use of interfaces  Lessens “coupling” between objects ◦ Cleaner separation of responsibilities  Put logic that applies to many objects in one single place  Separate the class’s core responsibility from other duties ◦ Simplifies database integration  Spring JDBC  Hibernate  iBATIS  Java Persistence

Spring Modules – Use What You Want See:

Example Application Contacts – store and retrieve contacts ◦ Created using MyEclipse 7 ◦ Uses Maven 2 to manage libraries ◦ Demonstrates basic Spring capabilities Contact has a Person, collection of , and collection of Phone objects Can use an XML file or database as repository User interface is via the console See READ_ME file under project folder

Dependency Management Manage collaboration (dependencies) between Plain Old Java Objects (POJOs) ◦ Code to interfaces ◦ Use Spring to instantiate specific interface implementations  Don’t need  InterfaceType anObject = new ClassThatImplementsInterfaceType() ◦ Use Spring to provide specific interface implementations to your objects

External Configuration Configuration options ◦ Properties files ◦ XML configuration files ◦ Annotations XML Configuration ◦ Specify the creation of objects ◦ Specify the dependencies between objects

Handling Change Change dependencies without changing code ◦ Edit the configuration file ◦ Create multiple configuration files

Testing Applications Easier to test ◦ Use a test configuration file to create test objects and manage their dependencies  Reuse objects across tests ◦ Test service layer objects by creating stub dependent objects ◦ See: /reference/testing.html /reference/testing.html

Separation of Responsibilities Aspect-Oriented Programming (AOP) ◦ /jw-0118-aspect.html /jw-0118-aspect.html Aspect-Oriented Programming in Spring ◦ See: /reference/aop.html /reference/aop.html Put a concern (logic) that applies to many different objects in one single place  Logging, security, performance testing, transaction management

Implementing AOP in Spring Advice ◦ Several different ways to configure Advice objects  Implement interfaces and XML configuration  annotations  Integrate with AspectJ ◦ Advice is commonly applied to a method ◦ Different ways to apply advice to an object  Before advice  After returning advice  After throwing advice  After advice  Around advice

Database Integration Spring provides a JDBC framework that removes much of the boiler-plate code ◦ See: bc.html bc.html ◦ Configures the data source ◦ Gets the connection ◦ Creates the statement ◦ Processes the result ◦ Creates the business objects ◦ Handles exceptions ◦ Closes connection Spring can integrate with Hibernate, Java Data Objects (JDO), Java Persistence API (JPA), iBATIS, and other Object Relational Management (ORM) technologies

Spring JDBC Spring JDBC framework takes advantage of Java 5 ◦ New classes in Spring 2.0 and 2.5 that use  Variable arguments  Auto boxing  Covariant return types  Generics ◦ Can still use older classes and Java 1.4

Spring JDBC Capabilities Simplified methods for querying and updating tables ◦ Query to create a business object - /reference/jdbc.html#jdbc-SimpleJdbcTemplate /reference/jdbc.html#jdbc-SimpleJdbcTemplate ◦ Query for single value - /reference/jdbc.html#jdbc-statements-querying /reference/jdbc.html#jdbc-statements-querying ◦ Insert business objects /reference/jdbc.html#jdbc-simple-jdbc-insert-1 /reference/jdbc.html#jdbc-simple-jdbc-insert-1

Example - Contacts Application ◦ Data source is configured and provided to other classes in the configuration file ◦ See classes ContactSearchService_DB and ContactDataAccess_DB  Extend Springs’ SimpleJdbcDaoSupport  See: ringframework/jdbc/core/simple/SimpleJdbcDaoSupport.htm l ringframework/jdbc/core/simple/SimpleJdbcDaoSupport.htm l

Additional Spring Capabilities Transaction Management ◦ “A transaction defines a logical unit of work that either completely succeeds or produces no result at all. A distributed transaction is simply a transaction that accesses and updates data on two or more networked resources, and therefore must be coordinated among those resources.” see: Scheduling Web services and remoting Spring Web Model View Controller (MVC) Integration with Struts 2 ◦ see: b-integration.html#struts and b-integration.html#struts and

Where to Learn More Review the Spring documentation online ◦ Spring documentation ◦ Spring API - /api/index.html /api/index.html Spring support forum Review on Safari (KU Library) ◦ Spring in Action, 2nd Edition, Manning Publishing, August 2007 ◦ Pro Spring 2.5, Apress Publishing, August 2008