Spring Overview for Freshers


       Swati Bansal
Spring

Introduction to Frameworks
What is Spring framework?
Spring Architecture
Spring Modules
Why Use Spring?




                                  2
What is a Framework?
How many times???????


           Transaction Management
 Logging                            Persistence




Security
                                    Authentication

                 Authorization
I HAVE DONE THAT BEFORE!!!!!!




                                5
A framework is an application or
      partial application…
Advantages of a Framework
Spring Framework is a Java platform that provides
comprehensive infrastructure support for developing
                Java applications.
Spring Is




             Non Intrusive

   Modular




                             10
Spring Architecture
Core Package
 Most fundamental part of the framework.
 IoC and Dependency Injection features
 Factory pattern based Bean Factory.
DAO Package




The DAO package provides a JDBC-abstraction
  layer that removes the need to do tedious JDBC
  coding and parsing of database-vendor specific
  error codes.
ORM Package
         The ORM package
        provides integration
        layers for popular object-
        relational mapping
        APIs, including
        JPA, JDO, Hibernate, and
        iBatis.

       Using the ORM package
        you can use all those
        O/R-mappers in
        combination with all the
        other features Spring
MVC Pattern
MVC Package
   Spring's MVC package provides a Model-View-
    Controller (MVC) implementation for
    webapplications.

   Spring's MVC framework is not just any old
    implementation; it provides a clean
    separation between domain model code and
    web forms, and allows you to use all the other
    features of the Spring Framework.
Aspect Oriented Programming
AOP Example
AOP Package
Spring's AOP package provides an AOP
Alliance-compliant aspect-oriented programming
implementation allowing you to define, for
example, method-interceptors and pointcuts to
cleanly decouple code implementing
functionality that should logically speaking be
separated.
A Typical Spring Application
Why Use
Spring Framework?
Why use Spring?
   Wiring of components through Dependency
    Injection
     – Promotes de-coupling among the parts that make
       the application
   Design to interfaces
     – Insulates a user of a functionality from
       implementation details
   Test-Driven Development (TDD)
     – POJO classes can be tested without being tied up
       with the framework
Why use Spring?
   Declarative programming through AOP
     – Easily configured aspects, esp. transaction support

   Popular technologies
     – Abstractions insulate application from specifics, eliminate redundant code
     – EJB for J2EE
     - Hibernate, iBatis, JDBC (for data access)
     - Velocity (for presentation)
     - Struts and WebWork (For web)

   Not an all-or-nothing solution
     – Extremely modular and flexible

   Well designed
     – Easy to extend
     – Many reusable classes
Thank You!




             26

Spring basics for freshers

  • 1.
    Spring Overview forFreshers Swati Bansal
  • 2.
    Spring Introduction to Frameworks Whatis Spring framework? Spring Architecture Spring Modules Why Use Spring? 2
  • 3.
    What is aFramework?
  • 4.
    How many times??????? Transaction Management Logging Persistence Security Authentication Authorization
  • 5.
    I HAVE DONETHAT BEFORE!!!!!! 5
  • 6.
    A framework isan application or partial application…
  • 7.
    Advantages of aFramework
  • 9.
    Spring Framework isa Java platform that provides comprehensive infrastructure support for developing Java applications.
  • 10.
    Spring Is Non Intrusive Modular 10
  • 11.
  • 13.
    Core Package  Mostfundamental part of the framework.  IoC and Dependency Injection features  Factory pattern based Bean Factory.
  • 14.
    DAO Package The DAOpackage provides a JDBC-abstraction layer that removes the need to do tedious JDBC coding and parsing of database-vendor specific error codes.
  • 15.
    ORM Package  The ORM package provides integration layers for popular object- relational mapping APIs, including JPA, JDO, Hibernate, and iBatis.  Using the ORM package you can use all those O/R-mappers in combination with all the other features Spring
  • 16.
  • 17.
    MVC Package  Spring's MVC package provides a Model-View- Controller (MVC) implementation for webapplications.  Spring's MVC framework is not just any old implementation; it provides a clean separation between domain model code and web forms, and allows you to use all the other features of the Spring Framework.
  • 18.
  • 20.
  • 21.
    AOP Package Spring's AOPpackage provides an AOP Alliance-compliant aspect-oriented programming implementation allowing you to define, for example, method-interceptors and pointcuts to cleanly decouple code implementing functionality that should logically speaking be separated.
  • 22.
    A Typical SpringApplication
  • 23.
  • 24.
    Why use Spring?  Wiring of components through Dependency Injection – Promotes de-coupling among the parts that make the application  Design to interfaces – Insulates a user of a functionality from implementation details  Test-Driven Development (TDD) – POJO classes can be tested without being tied up with the framework
  • 25.
    Why use Spring?  Declarative programming through AOP – Easily configured aspects, esp. transaction support  Popular technologies – Abstractions insulate application from specifics, eliminate redundant code – EJB for J2EE - Hibernate, iBatis, JDBC (for data access) - Velocity (for presentation) - Struts and WebWork (For web)  Not an all-or-nothing solution – Extremely modular and flexible  Well designed – Easy to extend – Many reusable classes
  • 26.