This Week in Spring - April 2nd, 2013

Engineering | Josh Long | April 02, 2013 | ...

Welcome to another installment of This Week in Spring ! I've just returned from Devoxx UK and Devoxx France where I was very happy to talk to developers using Spring from all walks of industry. I also spoke at Skills Matter in London on building web applications using Spring. Thanks to Skills Matter, the London Spring User Group, and to the amazing Rob Harrop for having me, it was such a pleasure! The video from that session is available online if you're interested.

  1. Register today for the Super Early Bird rate at SpringOne 2GX 2013, in Santa Clara, CA Sept 9th-12th, 2013!
  2. Gary Russell's announced that Spring AMQP 1.2.0.M1 is now available.
  3. <LI> The Cujojs team has announced that <CODE>rest.js</CODE> is <a href="http://cujojs.com/">now part of Cujo.js</a>
    <a href…

Webinar Replay: Extending Spring Integration for Splunk

News | Pieter Humphrey | April 01, 2013 | ...

Join David Turanski (SpringSource) and Damien Dallimore (Splunk) as they discuss and demonstrate Splunk and Spring Integration. Spring Integration provides a number of adapters out of the box to support various transports, such as JMS, File, HTTP, Web Services, and Mail. They will introduce the Splunk channel adapter, a new entry to the out of the box adapters available for Spring Integration, which allows data to flow through Spring Integration to interact with data being ingested or queried by Splunk.

For those who may be unfamiliar, Splunk collects, indexes and harnesses machine-generated big data so you can monitor, search, analyze, visualize and act on large streams of real-time and historical machine data.

Demo Source is located at:
https://github.com/damiendallimore/spring-integration-splunk-webex-demo

About the speakers

Damien Dallimore

Damien Dallimore

Damien is the first Developer Evangelist at Splunk where he engages with the developer community to build big data applications on top of Splunk using Splunk's SDKs and Application framework. A fervent JVM fan, he has a particular interest in the new breed of alternate JVM languages and actually thinks that logging is cool. Prior to joining Splunk, Damien paid his mortgage wearing many different technical hats coding,hacking,engineering and architecting software and solutions around the globe in a variety of industries, primarily in the Enterprise Java space. He is a fanatical All Black's rugby supporter, loves scuba diving and golf and can hold his own on guitar in a blues jam.

More About Damien »

 

David Turanski

David Turanski

David Turanski is a Senior Software Engineer with SpringSource, a division of VMWare. David is a member of the Spring Data team and lead of the Spring Data GemFire project. He is also a committer on the Spring Integration project. David has extensive experience as a developer, architect and consultant serving a variety of industries. In addition he has trained hundreds of developers how to use the Spring Framework effectively.

More About David »

Rest.js 0.9 Released

Releases | Jeremy Grelle | March 28, 2013 | ...

Dear Spring Community,

Today we’re excited to announce that rest.js is now part of Cujo.js and that rest.js 0.9 has been released.

https://github.com/cujojs/rest

rest.js is a RESTful HTTP client. It goes far beyond the typical XMLHttpRequest abstraction developers are accustomed to in other frameworks. rest.js is built upon composable interceptors that incrementally add new functionality to a client. Configured clients are tamper proof and can be safely shared within an application. If a portion of the application needs specific behavior, it can chain further interceptors on the common…

This Week in Spring - March 26, 2013

Engineering | Josh Long | March 26, 2013 | ...

Welcome to another installment of This Week in Spring! This week I'm in chilly (brrr!) London, England and Paris, France, for Devoxx UK and Devoxx FR and - tonight - I gave a talk at Skills Matter for the London Spring User Group. What a pleasant experience. If you're in France and want to talk Spring, don't hesitate to ping me.

  1. The CujoJS team has announced that When.js 2.0 is now available.
  2. I found a few nice posts introducing Spring Integration. Here's part 1 and part 2.
     These posts are very thorough and well worth a read! </LI>
     <LI>New SpringOne2GX replays now available in HD on YouTube: <a href="http://www.springsource.org/node/4302">What's New in Spring Integration 2.2 and Spring Integration, Batch, &amp; Data Lightning Talks</a>.</LI>
     <LI> Did you guys miss SpringOne2GX 2012? Don't fret, Oleg Zhurakousky and Arjen Poutsma's talk introducing <a href="http://t.co/nquWxe7L3u">how to use Spring with Scala is now available on InfoQ</a>. </LI>
     <LI>Michael Isvy's been hard at work refactoring the code 
    	 of the canonical Spring PetClinic reference…

Spring Petclinic is on Github!

Engineering | Michael Isvy | March 21, 2013 | ...

We are pleased to announce that the Spring Petclinic sample application has been refactored.

The source code is now available on github. Here is a screenshot of the new application:

And here is an overview of the new architecture:

Spring, Spring, Spring

We have used the following Spring features:

  • Dependency Injection using Annotations
  • Data Access Integration using jdbc (JdbcTemplate), JPA or Spring Data JPA (repository layer). You can choose which implementation to use by setting up the corresponding bean profile in web.xml or in one of the JUnit tests.
  • Transactions using @Transactional (service layer)
  • Caching using @Cacheable with ehcache as a cache implementation (service layer)
  • Aspect Oriented Programming (to monitor how many times has been called each of the Repository methods)
  • Spring MVC: Form validation using Bean Validation (JSR-303)
  • Spring MVC: content negotiation (html, xml or atom) using ContentNegotiatingViewResolver.
  • Spring MVC: exception handling using SimpleMappingExceptionResolver
  • Spring MVC: use of the Spring MVC Test Framework

 

Our Vibrant Community

We have had quite a lot of contributions from experts in our community (including the leads of several open source projects).

 

Thymeleaf

In case you haven’t heard of it yet, Thymeleaf can be seen as a replacement for JSP. it defines itself as an  XML / XHTML / HTML5 template engine.

It is based on some plain HTML files with a little bit of namespace magic.

Daniel and Soraya from the Thymeleaf project have created a Spring-Petclinic branch that uses Thymeleaf instead of JSP. They have documented the migration steps in this blog entry: http://www.thymeleaf.org/petclinic.html

The Thymeleaf branch of Spring Petclinic is available here: https://github.com/thymeleaf/thymeleafexamples-petclinic

To learn more about Thymeleaf: http://www.thymeleaf.org

To follow Thymeleaf on twitter: https://twitter.com/thymeleaf

 

Dandelion

Dandelion provides a set of taglibs that you can use with JSP or Thymeleaf.

We have used it inside Spring-Petclinic to work with DataTables. It generates tables based on jQuery DataTables and Bootstrap.

You can do things like that:


<datatables:table data="${ownerList}" id="dataTable"  theme="bootstrap2" export="pdf">
 <datatables:column title="Name" property="name" sortable="true" />
 <datatables:column title="Address" property="address" sortable="true" />
</datatables:table>

The output html table then looks like this:

Dandelion is used inside the main branch of Spring Petclinic.

Thibault Duchateau from the Dandelion project has written a nice blog entry that describes the migration of the Spring Petclinic application

To learn more about Dandelion:  http://dandelion.github.com/

To follow them on twitter: https://twitter.com/dandelion_proj

 

Maven or Gradle?

By default, Spring Petclinic uses Maven as it is the most common choice for Java applications. While Spring Petclinic is fairly small in comparison to most real-life applications, its Maven pom.xml file is pretty verbose already.

Li Yanhui from Thoughtworks China has been nice enough to migrate Spring Petclinic to Gradle. That is a great way to compare Maven and Gradle side by side. The build.gradle configuration file is indeed much simpler to understand. It currently contains 143 lines (as opposed to 543 lines for the Maven POM).

You can browse the Gradle-based version of Spring Petclinic here: https://github.com/whimet/spring-petclinic Thanks to them we have been able to identify a few places inside Spring Petclinic that contained code duplication and lacked of automated testing.

 

Performance Testing: Let’s Scale!

Would it be possible to take Spring Petclinic as it is now and scale it up to 1000 requests per second on a single server instance? Julien Dubois from Ippon Technologies has written a great series of five blog entries on that topic.

It answers questions such as: - Should I rely on the session context? (part 2) - Which Apache Tomcat connector should I use? (part 2) - Which database connection pool should I use? (part 3) - Is JDBC faster than JPA or Spring Data JPA? ( part 4) - What are the pros of using OpenSessionInViewFilter? ( part 4)

 

References

Spring Petclinic on GitHub Spring Petclinic on Cloud Foundry Petclinic + Thymeleaf Petclinic + Gradle

 

When.js 2.0.0 Released

Releases | Jeremy Grelle | March 20, 2013 | ...

Dear Spring Community,

We are pleased to announce the release of when.js 2.0.0.

When.js is cujojs’s lightweight Promises/A+ and when() implementation, and powers the async core of wire.js, cujojs’s IOC Container. It also provides several other useful Promise-related concepts, such as joining multiple promises, mapping and reducing collections of promises, and timed promises.

This major release brings full Promises/A+ compliance, and async promise resolutions. It also includes a few new features, including a new when/keys module for working with object keys.

See the cujojs discussion group for further detail, and check out the full changelog for more info and direct links to docs for the new features.

Webinar Replay: Multi-Client Development with Spring

News | Pieter Humphrey | March 18, 2013 | ...

No application is an island and this is more obvious today than ever as applications extend their reach into people's pockets, desktops, tablets, TVs, Blu-ray players and cars. What's a modern developer to do to support these many platforms? In this talk, join Josh Long to learn how Spring can extend your reach through (sometimes Spring Security OAuth-secured) RESTful services exposed through Spring MVC, HTML5 and client-specific rendering thanks to Spring Mobile, and powerful, native support for Android with Spring Android.


About the speaker

Josh Long

Josh Long

Josh Long is the Spring developer advocate. Josh is the lead author on Apress’ Spring Recipes, 2nd Edition, and a SpringSource committer and contributor. When he's not hacking on code, he can be found at the local Java User Group or at the local coffee shop. Josh likes solutions that push the boundaries of the technologies that enable them. His interests include scalability, BPM, grid processing, mobile computing and so-called "smart" systems. He blogs at blog.springsource.org or joshlong.com and can be found on Twitter at @starbuxman.

More About Josh »

Spring Data GemFire 1.3.0 Released

Engineering | David Turanski | March 14, 2013 | ...

I am pleased to announce the GA release of Spring Data GemFire 1.3.0. In addition to many minor bug fixes and enhancements, this release includes some notable new features to make writing Java applications with GemFire even easier:

Annotation Support For Functions

GemFire provides the ability to "bring the code to the data" by providing a framework for remote function execution. In keeping with Spring's core values, Spring Data GemFire hides the boilerplate code necessary to register and execute remote functions, allowing you to write POJOs and focus on application logic. See the Annotation Support for Function Execution chapter in the Spring Data GemFire Reference Guide for details.

Simplified Connection to a GemFire Datasource

GemFire exposes a lot of options for tuning the performance of it's connection pool, and to configure how local data is managed an synchronized. The Spring Data GemFire namespace supports all of these options, however many applications are clients that simply need read/write access to the GemFire data grid. For this class of applications, it is now possible to connect to GemFire as a client without explicitly configuring a pool or client regions:

 <gfe-data:datasource>
        <gfe-data:locator host="${host}" port="${port}"/>
 </gfe-data:datasource>

The above configuration will create a client cache, pool, and proxy client regions for all available regions on the server, with sensible defaults, and register them as Spring beans.

JSON Support

GemFire 7.0 provides the ability to store JSON with full query support. Typically this requires the application to use the JSONFormatter to convert GemFire's internal format to and from JSON Strings. Spring Data GemFire now provides an option to perform this conversion automatically for selected regions, as will as one way conversion from Object to JSON using Jackson's ObjectMapper. This feature uses Spring AOP to intercept appropriate operations on Region and GemFireTemplate. See the Spring Data GemFire Reference Guide for details.

Performance Improvements in STS 3.2.0

Engineering | Martin Lippert | March 12, 2013 | ...

The latest release of the Spring Tool Suite (3.2.0) contains a large number of performance improvements in many different areas. We are not only adopting the latest improvements from the Eclipse Juno SR2 maintenance release (which fixes a large number of performance issues with the new Eclipse 4 platform UI), we also worked on the performance of many of the STS internals, specifically targeting Java editing and build times for Spring projects.

To demonstrate the improvements, here is a quick screencast showing STS 3.1.0 and 3.2.0 side-by-side:

There is still more to do and we will continue to work on these areas for the STS 3.3.0 release, scheduled to arrive in July 2013. If you want to know more details, watch for further improvements, submit additional information, and/or report specific performance or memory issues, please watch/use this JIRA ticket: https://issuetracker.springsource.com/browse/STS-3054

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe