1 / 14

Spring Overview, Application demo

Spring Overview, Application demo. -Midhila Paineni 09/23/2011. The goal of this session is to provide the Overview of the Spring framework and Demo the application built in Spring 3.X. Key Topics To Be Covered. Spring Framework Roadmap Spring Features New Features in Spring 3.X

robert
Download Presentation

Spring Overview, Application demo

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Spring Overview, Application demo -Midhila Paineni 09/23/2011 Spring Overview, Application demo

  2. The goal of this session is to provide the Overview of the Spring framework and Demo the application built in Spring 3.X Key Topics To Be Covered • Spring Framework • Roadmap • Spring Features • New Features in Spring 3.X • Dependency Injection(Inversion Of Control) • Application High Level Architecture Diagram • Demo of RefAppApplication • Questions and Answers Spring Overview, Application demo

  3. Spring Framework Spring Overview, Application demo

  4. Roadmap –Spring Releases • Spring Framework 1.0 24.03.04 • Spring Framework 2.0 05.10.05 • Spring Framework 2.5 19.11.07 • Spring Framework 3.0 July 2009 • Spring Framework 3.0.6. RELEASE is the current production release (requires Java 1.5+) Spring Overview, Application demo

  5. Spring Features • IOC and Dependency Injection • Annotations • Spring Core and Beans (POJOs) • AOP Support • Declarative Transaction • JDBC Template • O/R Integration • Exception Handling • MVC Framework • Spring Web Services • Spring Security • Expression Language • Comprehensive REST Spring Overview, Application demo

  6. New features of Spring 3.X This is a list of new features for Spring 3.X. We will discuss later more details of each feature. • Spring Expression Language • IoC enhancements • General-purpose type conversion system and field formatting system • Object to XML mapping functionality (OXM) moved from Spring Web Services project • Comprehensive REST support • @MVC additions • Declarative model validation • Early support for Java EE 6 • Embedded database support Spring Overview, Application demo

  7. Spring BeanFactory • BeanFactory is core to the Spring framework • Responsible for lifecycle methods. • It is typically configured in an XML file with the root element: <beans> • XML based component deployment contains one or more <bean> elements id (or name) attribute to identify the bean class attribute to specify the fully qualified class • Create object graphs and configure data • Inversion of Control (Dependency Injection) The bean’s fully- qualified classname The bean’s ID <beans> <bean id=“widgetService” class=“com.zabada.base.WidgetService”> <property name=“poolSize”> <!—-property value here--> </property> </bean> </beans> Maps to a setPoolSize() call Spring Overview, Application demo

  8. Property Values for BeanFactories (continued) The real magic comes in when you can set a property on a bean that refers to another bean in the configuration: This is the basic concept of Inversion of Control <bean name=“widgetService” class=“com.zabada.base.WidgetServiceImpl”> <property name=“widgetDAO”> <ref bean=“myWidgetDAO”/> </property> </bean> calls setWidgetDAO(myWidgetDAO) where myWidgetDAO is another bean defined in the configuration Spring Overview, Application demo

  9. "Inversion of Control" configuration and lifecycle of application objects objects do not configure themselves, but get configured from the outside objects don't know the origin of their configuration Eliminates lookup code from within your application Allows for plugability and hot swapping Promotes good OO design Enables reuse of existing code Makes your application extremely testable Dependency Injection(Inversion Of Control) IoC / Dependency Injection Spring Overview, Application demo

  10. Dependency Injection Pattern class MovieLister... public Movie[] moviesDirectedBy(String arg) { List allMovies = finder.findAll(); for (Iterator it = allMovies.iterator(); it.hasNext();) { Movie movie = (Movie) it.next(); if (!movie.getDirector().equals(arg)) it.remove(); } return (Movie[]) allMovies.toArray(new Movie[allMovies.size()]); } public interface MovieFinder { List findAll(); } Spring Overview, Application demo

  11. Dependency Injection Pattern cont.. class MovieLister... private MovieFinder finder; public MovieLister() { finder = new ColonDelimitedMovieFinder("movies1.txt"); } The dependencies using a simple creation in the lister class SpringOverview, Application demo 11 10/12/2014

  12. Dependency Injection Pattern cont.. • There are 3 types of dependency injection • Method injection • Constructor injection • Interface injection Spring Overview, Application demo

  13. Application High level Architecture Spring Overview, Application demo

  14. Discussion, Q & A Spring Overview, Application demo

More Related