A Java configuration option for Spring

Engineering | Rod Johnson | November 28, 2006 | ...

Thanks to our philosophy of pluggability and a lot of hard work in the implementation, the Spring IoC container (like most of the rest of Spring) is extremely flexible.

One point that is often missed is that Spring configuration need not be in XML, although the XML format is by far the most commonly used. Spring has its own internal metadata format in the form of the BeanDefinition interface and subinterfaces. The BeanFactory and ApplicationContext implementations that represent IoC container instances are powered by this Java metadata, and are quite separate from metadata parsing, which is…

XML Syntax Sugar in Spring 2.0

Engineering | Rod Johnson | November 26, 2006 | ...

If you've followed October's Spring 2.0 release, you will know that one of the big new features was XML extension name spaces: the ability to define new XML elements and attributes that generate Spring metadata, and can be used alongside regular bean definitions. This provides a valuable new extension point and makes Spring configuration both more simpler to use for many repeated tasks and more powerful.

However, there is also a sweet little piece of syntax sugar that you may not have noticed--probably because no one in the Spring team has gotten around to telling you... Having promised myself…

Spring Framework: The Origins of a Project and a Name

Engineering | Rod Johnson | November 09, 2006 | ...

I am regularly asked about the origin of the name “Spring.”

The name goes back to late 2002. In November 2002, I published Expert One-on-One J2EE Design and Development. The book was accompanied by 30,000 lines of framework code, which had accounted for a good deal of the year full-time I put into writing the book. (Writing a 750 page book is enough work on its own; writing a substantial framework to go along with it is sheer masochism. It was hard.) Many of the fundamental concepts of the Spring Framework were there: an already capable IoC container, with BeanFactory and ApplicationContext…

Last chance to join 500+ others in Australia

Engineering | Ben Alex | November 01, 2006 | ...

If you're reading this blog, chances are that you already know Spring is a pretty popular framework. Most J2EE developers who've ever used it simply love it, as illustrated by 12+ books, 1,000,000+ downloads, 14,000+ forum members etc. Still, even I was surprised when my Australian Spring user group announcement a little over a week ago generated this much interest... As of today, we've had over five hundred registrations to attend these three meetings. Indeed, we've needed to move the Sydney meeting to larger premises, with the Brisbane and Melbourne meetings almost booked out. If you're…

Oracle, Open Source and Commodization

Engineering | Rod Johnson | October 28, 2006 | ...

I was in San Francisco for Oracle World. I even spoke briefly in Thomas Kurian's keynote on Java middleware. But Neelan and I had to leave on Tuesday and missed the Big Deal: Larry Ellison announcing that Oracle are offering support for Linux.

This is an interesting event from the perspective of the open source business. What are the wider implications?

Oracle are offering support for an open source product that they did not create and don't control.

This is possible for a number of reasons:

  • Linux is not a product. It is a class of technology, and companies or organizations assemble, document, distribute and support products.
  • Linux support is already commoditized to some extent. Red Hat is only one of several distributors offering support.
  • The leadership of Linux is diffused. Linus Torvalds does not work for a big distributor; Red Hat does more than most but no single company provides clear leadership.
  • The leadership of Linux matters less than you think. Linux is not primarily an engine of innovation, but an engine of commodization.

However, it's interesting to think about what the limits are for companies such as Oracle in providing…

Interface21 / Spring at Oracle OpenWorld 2006

Engineering | Neelan Choksi | October 23, 2006 | ...

Rod and I are here in San Francisco at Oracle OpenWorld 2006. This is indeed a scene. I can't decide if "hubris" or "impressive" is the right way to describe it but the numbers don't lie. They are expecting 45000 people for the conference and the City of San Francisco thinks the show will generate $50-60M in money for the city. Apparently, no Oracle employee is allowed to stay in a hotel north of the airport. One of the more shocking things was that the city blocked off a chunk of Howard St. in front of Moscone for the conference.

In this morning's Oracle Develop keynote given by Thomas Kurian, Senior Vice President at Oracle, Spring was front and center. Thomas had Rod get on stage during the keynote and describe what Spring is and what's new with Spring 2.0. Rod also talked about the collaboration…

Spring 2.0 final, with over 10,000 downloads in the first day

Engineering | Rod Johnson | October 05, 2006 | ...

Spring 2.0 went final on Tuesday! This is the product of 9 months of hard work from the Spring team, and huge amounts of user feedback (thanks!) and it's a big step forward.

I promise my next blog will be about something other than download numbers. I've been playing around with some interesting approaches to testing pointcuts in @AspectJ annotations, so I'm hoping next time to post some interesting code.

But we just noticed some pretty amazing figures from SourceForge, so I can't resist posting about them. There were over 10,000 downloads of Spring 2.0 in the first 24 hours! Interest in Spring 2.0 has been building for months--with some users already in production with a release candidate, including a prominent media site in Europe--and I think Keith's brilliant launch page

Spring 2.0 Maven POMs ready

Engineering | Ben Hale | October 04, 2006 | ...

One last Spring 2.0 announcement on a day full of them. The Maven POMs for Spring 2.0 are up in Spring's private repository. If you want to point to it directly check https://svn.sourceforge.net/svnroot/springframework/repos/repo/. If you want to wait, they should be replicated into the Ibiblio Maven repository over the next couple of days.

For those of you who like to browse around with a bit more metadata, the ViewVC interface from SourceForge is a good choice. Remember that you should use the earlier link as a URL for maven, but you can use the later link for browsing.


Updated 10/3 22:03: Added paragraph about ViewVC

Exploiting Generics Metadata

Engineering | Rob Harrop | September 29, 2006 | ...

It is a common misconception that I hear when talking with clients that all information about generic types is erased from your Java class files. This is entirely untrue. All static generic information is maintained, and only generic information about individual instances is erased. So if I have a class Foo that implements List<String>, then I can determine that Foo implements the List interface parameterised by String at runtime. However, if I instantiate an instance of ArrayList<String> at runtime, I cannot take that instance and determine its concrete type parameter (I can determine that ArrayList requires type parameters). In this entry I’m going to show you a practical usage for some of the available generics metadata that simplifies the creation of strategy interfaces and implementations that differ by the type of object they process.

A pattern that I see occurring in many applications is the use of some kind of strategy interface with concrete implementations each of which handles a particular input type. For example, consider a simple scenario from the investment banking world. Any publicly traded company can issue Corporate Actions that bring about an actual change to their stock. A key example of this is a dividend payment which pays out a certain amount of cash, stock or property per shared to all shareholders. Within an investment bank, receiving notification of these events and calculating the resultant entitlements is very important in order to keep trading books up to date with the correct stock and cash values.

As a concrete example of this, consider BigBank which holds 1,200,000 IBM stock. IBM decides to issue a dividend paying $0.02 per share. As a result, BigBank needs to receive notification of the dividend action and, at the appropriate point in time, update their trading books to reflect the additional $24,000 of cash available.

The calculation of entitlement will differ greatly depending on which type of Corporate Action is being performed. For example, a merger will most likely result in the loss of stock in one company and the gain of stock in another.

If we think about how this might look in a Java application we could assume to see something like this (heavily simplified) example:


public class CorporateActionEventProcessor {

    public void onCorporateActionEvent(CorporateActionEvent event) {
        // do we have any stock for this security?

        // if so calculate our entitlements
    }
}

Notifications about events probably come in via a number of mechanisms from external parties and then get sent to this CorporateActionEventProcessor class. The CorporateActionEvent interface might be realised via a number of concrete classes:


public class DividendCorporateActionEvent implements CorporateActionEvent {

    private PayoutType payoutType;
    private BigDecimal ratioPerShare;

    // ...
}

public class MergerCorporateActionEvent implements CorporateActionEvent {

    private String currentIsin; // security we currently hold
    private String newIsin; // security we get
    private BigDecimal…

Boston Spring Group First Meeting

Engineering | Mark Fisher | September 25, 2006 | ...

I am very excited to announce that the Spring SIG within the New England Java Users Group will be having our first meeting this Thursday (September 28th, 2006). Ramnivas Laddad (author of AspectJ in Action and Interface21 Principal) will be presenting "AspectJ for Spring Developers". This will be a great chance to learn about the enhancements in AspectJ integration within Spring 2.0.

You can read the details HERE, and be sure to click on the 'Register' link on the left-hand side of the page if you plan on attending.

This group will provide a great forum for "all things Spring" and will be meeting roughly once per quarter initially. I am looking forward to building a community and personally meeting fellow Spring users in the greater Boston area.

A special thanks to NEJUG president Steven Maienza and the NEJUG members who expressed an interest in having a Spring group and put this into motion before I even moved to Boston. Thanks!

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all