InfoQ

News

Spring: unifying themes and complete tour

Posted by Floyd Marinescu on Dec 14, 2006

Community
Java
Topics
Web Frameworks ,
Web Services ,
Transactions Processing
Tags
Spring
At The Spring Experience this past weekend, Adrian Colyer keynoted an overview of what the unifying themes of the Spring and what all the capabilities of the Spring portfolio are. For those who still think of Spring as an IOC container, the overview provided a great birds eye view of the entire Spring ecosystem, summarized here.

The keynote began with Adrian talking about the unifying themes of the Spring portfolio, which are simple objects plus dependency injeciton, aspects, and portable service abstractions, plus consistent blueprints of how to get things done. Adrian then showed a diagram of the layering in a typical app, and zoomed in on each layer, presenting what offerings Spring has in the area:

Data access layer
 - JDBC, iBATIS, JDO, Hibernate, TopLink support
 - New JPA support over Hibernate, OpenJPA, Toplink essentials
     - Spring 2.1 may have support for JPA namespaces, common non-standard features (criteria API, user types).
 - other backends: Spring also has support for accessing enterprise systems (CICS, IMS, JCA CCI (CCITemplate))
 - Spring Ldap: provides LdapTemplate that oes resource acquitision and release, iteration, exception translation, utility classes

Services layer
 - Scheduling - JDK Timer or Quartz, run jobs in the background with simple triggers or cron expressions
 - Asychronous tasks via TaskExecutor - can run in a ThreadPool or CommonJ Work Manager via configuration changes
 - Messaging
       - Spring 2.0 extends JMS support to deliver Message Driven pojos that can participate in transactions
       - For XML payloads: Spring Web Services includes an OXM framework (object to xml mapping) that integrates with Castor or JAXB
       - ESB Integration With Mule
                - Mule integrates with Spring's Application Contet event framework as a custom event multicaster allowing you to scan any kind of Mule end point (like pop3, or jms) which then generate application events in Spring
                - you can publish events to mule using normal ApplicationEventPublisher interface
 - Clustering
           - Tangosol Coherence's DataGrid for Spring adds new bean id's with DataGrid scope
                    - no need for cluster wide locking, combines DataGrid bean transaction management, and transactions that can work across the Grid
                    - Java and .Net interoperability is achieved using DataGrid beans
           - GigaSpaces provides access to data in a grid via JdbcTemplate integration or via GigaSpacesTemplate
                    - access MessageGrid via Spring's JMS abstraction
                    - you can submit jobs to parallel processing engine
                    - Application contexts can be part of DataGrids
                    - Java + .NET interoperability
           - Terracotta open sourced their JVM clustering solution, you can Cluster spring without any code changes or dependencies (like DataGrids in the previous examples)
                    - Cluster any singleton spring bean or non-prototype bean
                    - Publish ApplicationEvents acreoss the cluster.. application events broadcast to all the listeners
                    - Cluster Spring WebFlow to enable failover of conversation state
                    -  AOP + clustered beans + Spring JMX = cluster-wide management view

Security - impacts all layers
        - Acegi Security can secure web interfaces, service interfaces, DAO's (eg: do you have rights to this specific account row) and even operations on domain objects.

Presentation layer
   - Spring Rich Client provides a command framework with full data binding and validation
           - management of windows, pages, views, support for gui builds.
   - Spring MVC for a web framework
   - Spring Web Flow - model web interactions as flows and manage state between requests - works in all popular web frameworks
            - declare States and transitions between states
             - simplifies controller logic for workflow type stuff.
             - automatic post-redirect-get
            - browser buttons""just work"
            - Are looking to integrate with JSF later
  - Spring IDE - an Eclipse Plugin whose preview release just went live, supports XML code completion
      - Supports namespaces in Spring Web flow and will soon have a graphical Web Flow editor
      - AOP support of the same quality as AJDT coming: "I've got an aspect and it's got some advice, and these are all the places this advice matches"
  - Web 2.0/ ajax / ria
      - Exposes beans straight out via DWR, JSON-RPC
      - DWS 2.0 support - just add a line in the XML for an existing bean declaration and the javascript proxy to the ojbect gets created 
 
Web services
  - for simple RPC use XFire Exporter
  - for everything else use Spring Web Services, which facilitates contract-first WS development
        - includes object/xml mapping abstraction (OXM)
        - Web Services framework that resembles Spring MVC
        - WS-Security integrated with Spring security

Platforms

  - Spring is part of the OpenSoa collaboration
  -  SCA components can be exposed by any Spring bean in any Spring ApplicationContext

AOP - Spring has always had good AOP support and has strong integration with AspectJ

Spring OSGi - being worked on for Spring 2.1, adds support for this new module/hot deployment standard
    -  makes it easy to configure a bundle using Spring
    - a new Spring namespace handler for OSGi makes it equally easy to define beans representing OSGi services

Dynamic Langauges Integration
 -  Spring supports beans written in dyamic languages (JRuby, Groovy, Beanshell)

After the description of the Spring portfolio, Adrian pointed out that next year they will be looking to do coordinated releases, similar to Eclipse' Callisto framework.

After the keynote a panel of Spring committers assembled, and one question from the audience about whether there was any intention of implementing a good data mapper framework elicited a lot of discussion about what Spring's purpose is.  Rod Johnson stressed that Spring is not in the business of re-inventing existing technology just to call it Spring and suggested looking at iBatis. Rod also mentioned that Spring's aim is to solve problems and it does this by taking a look at what already exists and going as deep as necessary depending on what is already available. For example,  the persistrence templates (HibernateTemplate, etc) go very light since there are existing solutions for persistence, whereas Acegi security goes very deep since security is very important and the J2EE platform doesn't really provide anything.

Matt Raible also blogged detailed coverage of this same keynote. The day before, Rod also delivered a timeline of important Spring events in 2006, declaring the year one in which Spring became ubiquitous. See also the highly-trafficked Spring 2 Update on InfoQ, and the InfoQ Spring-specific content view at InfoQ.com/spring.

No comments

Watch Thread Reply

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.