How MTV Uses the Spring Framework

By Darryl K. Taft  |  Posted 2008-12-11

LinkedIn, MTV Tap Spring to Develop Core Apps

HOLLYWOOD, Fla.-Popular sites such as LinkedIn and MTV are using the Spring Framework to lessen the complexity of their Java development environments.

At the SpringOne Americas developer conference here, Yan Pujante, a distinguished software engineer and member of the founding team at LinkedIn, said the social networking organization has been using Spring since 2005 and has more than 1,600 Spring files in use and more than 15,400 Spring Beans for an average of nine Beans per Spring file.

Click here to read about how SpringSource is partnering with VMware to help enterprises develop and deploy Spring applications to virtual environments.

Pujante said LinkedIn uses Spring for various things, but primarily uses Spring Core and Spring IoC. IoC is Inversion of Control, also known as dependency injection. Dependency injection refers to the process of supplying an external dependency to a software component. LinkedIn also uses Spring MVC and is looking at the new Spring dm Server for its modular OSGi (Open Services Gateway Initiative) capabilities, Pujante said.

Why Spring? "There were some problems we wanted to solve," including hard-coded wiring, issues with configuration, manual life-cycle management and hard-to-reuse software wiring, Pujante said. So LinkedIn's solution was to use Spring in addition to some LinkedIn extensions.

With Spring as a solution, Pujante said, "Wiring is not in code anymore, there is a standard way to inject configuration, Spring handles life-cycle issues automatically and it is easier to reuse Spring files."

Moreover, Pujante said Spring is extensible and his LinkedIn team "enhanced" it to support its particular needs. "We decided to enhance Spring to do what we wanted it to do," Pujante said. "We added a new XML vocabulary. Another way to extend Spring is having your own custom property editor," he said.

In addition to the new XML vocabulary and custom property editors, LinkedIn also added a new kind of application context for life-cycle management with components, Pujante said.

Pujante said LinkedIn also created LinkedIn Spring components. A LinkedIn Spring component is a reusable, self-contained piece of Spring wiring and configuration that is recursive by nature and is integrated into the LinkedIn build framework.

LinkedIn, created in 2003, has more than 30 million members. The company has two data centers with more than 600 machines supporting an infrastructure of Java applications, SOA (service-oriented architecture) platforms, Apache Tomcat, Spring, Oracle, MySQL, OSGi and other components.

Meanwhile, Pujante said although Spring has helped a lot in creating applications at LinkedIn, it does have its minuses, including the drawbacks that XML is verbose and code refactoring does not work well with Spring files.

How MTV Uses the Spring Framework


Justin Edelson, vice president of Applications & Platform for MTV Networks Global Digital, also spoke at SpringOne Americas and said MTV Networks is migrating from the ATG Dynamo Web application platform to Spring. Edelson said MTV Networks' sites are a mix of Java, PHP, Ruby, C++ and .NET software, and the use of ATG Dynamo worked well for the company. However, "ATG Dynamo was a fantastic piece of technology, but it's dying a painful death," he said.

Edelson said most of the major sites, including MTV's Viacom-based sister sites such as VH1, Comedy Central and Nickelodeon, were built using ATG Dynamo. and the developers invested heavily in IoC and dependency injection. There also is a range of skill sets in the developer ranks, he said. Long-time employees know the ATG tool set, while newer employees know Spring and Hibernate. But Spring has won over because there is a growing talent pool of Spring developers, broad adoption of the Spring Framework, a relatively easy learning curve and externalized configuration, Edelson said.

The MTV Networks migration strategy was to make applications container-independent and to stop launching new Dynamo sites. And, like LinkedIn, one of MTV's core tactics included enhancing or extending Spring, as well modularizing the organization's code base, Edelson said.

To enhance Spring, MTV Networks added support for nested Bean factories, global Beans, combinational configuration, a config path and JMX (Java Management Extension)-based Bean definition browsing. This was all wrapped in a package the developers called BoxSpring.

To modularize the code base, MTV Networks used Maven as its build tool, implemented a lever for adding unit tests and packaged default configurations with code. In addition, the team built various supporting bits such as a Grails-based module browser, Maven plug-ins for copying code around and documentation standards. The team also used the Hudson extensible continuous integration engine, Edelson said.

The migration project continues with most of the infrastructure work completed in the first half of 2008 and the first BoxSpring applications launched in the second half of 2008, Edelson said. The first rewritten site will launch in the first quarter of 2009, he said. However, Edelson would not give a firm time frame for completion of the overall migration.

Rocket Fuel