Sunday, April 20, 2014

[Spring] 1 - Overview Spring Framework

Goal of the Spring Framework
  • Provide comprehensive infrastructure support for developing enterprise Java applications
    • Spring deals with the plumbing
    • So you can focus on solving the domain problem


Core Support
  • Application Configuration
  • A typical application system consists of several parts working together to carry out a use case
    • Spring provides support for assembling such an application system from its parts
      • parts do not worry about finding each other
      • Any part can easily be swapped out 

      • Parts are Just Plain (Old) Java Objects (POJO) 
    • Enterprise Integration
      • Enterprise applications do not work in isolation
      • They require enterprise services and resources
        • Database Connection Pool
        • Database Transactons
        • Security
        • Messaging
        • Remote Access
        • Caching
      • Spring helps you integrate powerful enterprise services into your application
        • While keeping your application code simple and testable
      • Plugs into all Java EE application servers
        • While capable of standalone usage  

    • Testing
      • Automated testing is essential
      • Spring enables unit testability
        • Decouples objects from their environment
        • Making it easier to test each piece of your application in isolation
      • Spring provides system testing support
        • Helps you test all the pieces together
    • Data Access
      •  Most enterprise applications access data stored in a relational database
        • To carry out business functions
        • To enforce business rules
      • Spring makes data access easier to do effectively 
        • Manages resources for you
        • Provide API helpers
        • Supports all major data access technologies
          • JDBC
          • Hibernate
          • JPA
          • iBatis

Web application developer support
  • Struts integration
  • JSF Integration
  • Spring MVC and Web Flow
    • Handle user actions
    • Validate input forms
    • Enforce site navigation state
    • Render responses (HTML, XML, etc)

Enterprise application development support
  • Developing web services
  • Adding manageability
  • Integrating messaging infrastructures
  • Securing services and providing object access control
  • Scheduling jobs


Key Points - The Spring Triangle

DI - Dependency Injection
  • A technique in which objects are passively given their dependencies instead of creating or looking for dependent objects for themselves. 
  • [Nattily] DI means how we are going to make sure that all your components are related to one another.
  • [Nattily] same concept IoC
  • [Nattily] It's a form of push configuration
AOP - Aspect Oriented Programming
  • [Nattily] AOP is another programming paradigm allows us to transparently add functionality to your application without changing your main line business code.
Enterprise Service Abstraction
  • [Nattily] things like transaction, security, etc. to apply universally easily portable kind of behaviour.


Brief Spring Framework

Spring framework implements one key concept - IoC which "做緊/實現 dependency injection.
Dependency injection concept - make java objects loosely coupled. For example, write a program with config.xml, parameters values changes, just change/update .xml, and no need to re-write the Java programs and recompile them.

Spring Framework read the configuration xml files which define bean definition.  /

What is a bean? Bean stores in configuration files, .xml.
Beans link up Java classes.

Spring Framework manages beans through Inversion of Control (IoC) container.

Spring has once concept MVC
Why need to use Spring framework?
What benefit with Spring framework?
Any features provided  by Spring framework?


Source: www.springbyexample.org/examples/intro-to-ioc.htmlwww.springbyexample.org/examples/intro-to-ioc.html

No comments:

Post a Comment