Welcome to JoshLong.com, home of my personal blog
<< Last | Next >>
January 24, 2011

And We're Off! 2011's Moving Way too Quick!

And we're off! The new year has been moving exceedingly quickly (I can't beleive we're already almost done with the first month! "Stop the world, I want off!") I don't know if you guys noticed, but SpringSource has been putting out new educational content (and a corresponding amount of code that quickly overwhelms any attempt at providing educational content..) on the SpringSource.org web site. I have been trying to publish two weekly-ish (we may miss a day or two or a column or two) "columns." One is called "This Week in Spring," which details all the new stuff in the community related to Spring and/ or SpringSource. If you've written a cool Spring tutorial or read a blog post that had what you needed to get going with Spring, let me know! Here's an example of last week's "This Week in Spring." The other "series" I've been working on (with occasional guest-scribes) is our series of educational, back-to-basics posts called "Green Beans."

At SpringSource R&D, we've been racing like crazy with new stuff! Spring Data for NoSQL support, Spring Hadoop (which provides integration with Hadoop), Spring Integration point releases, Spring Batch, Activiti support, Spring AMQP, Spring Mobile (which, at the simplest level is Spring MVC support for mobile device content negotiation), Spring Android (support for consuming RESTful services from Android devices using Spring's RestTemplate) etc., are all in active development! I've missed a lot, of course, and this doesn't even include the very impressive Spring core 3.1 changes that are fast nearing completion! We've got so much code we don't even know where to keep it all! We have a presence on github.com/SpringSource, on our own git.SpringSource.org and of course the older (http://src.springsource.org) Subversion tree where Spring classic (among others) is still hosted. Users are, of course, always encourage to contribute and feedback.

So, this is why I'm not doing a good job at keeping this blog current. Come visit me at on the forums or in the blog posts!

January 2, 2011

Springing Forward

I can't believe how quickly things have come and gone. I thought 2009 was great, but 2010 year no doubt takes the cake! Now that we're all on the other side of the new year, I thought I'd take a quick look at my year (and my decade) and talk about the Spring framework.

Last decade started strangely for a lot of us here in the United States. We saw a very strange election, the source of much discord in the political world. Scandalous though that might have seemed, it would all seem so fleeting when two planes crashed into the twin towers in New York City, New York. The reactions of a panicked country seemingly under siege would change the landscape over the next several years. The ramifications are still very pronounced and felt, I fear, in every corner of this tiny little planet.

I started the decade, and my professional career, wading through the dot-com boom and subsequent bust. I've been fortunate to have worked with a lot of startups over the years. I've also worked in stodgy, established corporations. I feel like working at a bank is the easiest way to fall through the cracks in life. It never ceases to amaze me that there are projects in some banks being started this very day, January 1, 2011 (1/1/11..!) using Struts 1.

It has been my experience that startups have the blessing - and burden - of having no room for failure. I have spent a lot of time making things work that just shouldn't work. While I've always been best-practices-oriented, I was leery of any gospel according to the vendors. I once had a manager utterly terrorize me because I was using EJBs when he had PHP script kiddies that purported to be able to deliver a huge function of the project done by "just downloading a script!" This taught me a valuable lesson. Looking back, I suspect the manager's claim was probably genuine, and I feel like such a heel for blindly relying on the vendors' claims that EJBs were the way forward, the future. I never could convince myself that the PHP way was the way, but there was no denying the obvious productivity gains for many common tasks. There was a time when I was looking pretty seriously at moving to .NET because it promised radically improved turnaround times. One of my main reservations about the then-nascent .NET ecosystem was the lack of open-source. I've always worked hard to use open-source if I could.

The Spring framework came along just in time. Engineers that survive in startups tend to be scrappy engineers who are interested in results, not process, and who aren't in it for the 9-5 shift, but for results. The Spring framework is open source; it closed the gap between .NET and Java by providing niceties like declarative remoting, declarative transactions, etc; it also helps further best-practices, not hinder them. I've been a true believer in the Spring framework from day one.

In early 2005, I moved to Tempe, Arizona to help start a company. The venture was a victim of the wayward economy when the housing bust hit. While I made some great friends and met my wife there, I was glad to return to Los Angeles in March of 2009.

Early in 2010 I had the fantastic good fortune to join a company here in Los Angeles called Shopzilla - they're the group behind BizRate.com, BeSo.com, Shopzilla.com, and tada.com, each of which gets a staggering amount of traffic. They use the Spring framework extensively and feature an excellent engineering environment as well as one of the best workplace environments in the business (arcade, lounge, free lunch, great perks, gym, etc., etc.). There are many brilliant people at Shopzilla. I think it is our natural tendency to approach strange codebases with trepidation and a sense of, "well, I could do this better!" and a lot of times, unfortunately, that instinct is on the money. I never felt that way with the large swaths of code I encountered in Shopzilla's codebase.

I've been in the unfortunate position in my life of having to work at places where engineers were begrudged unit tests; where code and projects were wildly inconsistent, or antiquated across projects; where there was a strong, undue sense of code ownership and code was walled off to all but two engineers (who had twelve weeks off yearly and were busy planning their retirements). Shopzilla was the antithesis. It was... wonderful to be completely unencumbered by management and bureaucrats.

I loved Shopzilla's earnest maximization of the Spring framework.

Let me try to explain. If you'll permit a generalization, engineers at startups can't afford to trust, anything. No time, after all. You hope that people already appreciate the benefits of code reuse, of course. I wonder if those people also realize the responsibility that comes with reuse. If something breaks in that code, its up to you to see it gets fixed. Keeping a stack as open-source centric as possible facilitates fixes. Broken code in a server is bad, but try proving it, let alone fixing it, without the source code! Support contracts might help there, but rarely as quickly as you need it to. It takes courage to use other people's code, and it takes courage to trust and verify promises extended by that code. It takes skill to integrate - and to care - about the big picture system, and not just the individual moving parts, too.

That is my conceptual framework when approaching projects. I use the Spring framework because it integrates with many different technologies and insulates users from the idiosyncrasies between various technologies through a unified component model. It levels the playing field. Depending on the stack, there are any number of places one might have to tailor a project 's behavior to the requirements of a system. Logging frameworks, service tiers, web service tiers, caching frameworks, web (including core APIs like Servlets), workflow engines, integration engines, processing grids, batch processing frameworks, job scheduling frameworks, etc., all have their own notion of a "component" in that domain, and each one of them expects you to work in terms of that component model, ignoring the uniformity and conventions you'd hoped to establish across your code base.

Spring opens the doors to all these technologies (and untold many others) and lets you work in terms of your domain model. The engineers behind the Spring framework have plumbed the depths of these various frameworks and done the legwork to make it easy for you to integrate them in a manner consistent with your codebase. Where they've had to, they've fixed parts of these projects, and provided less risky paths for integration. Often, this process is as simple as dismantling the custom component model in place and letting people think in terms of plain 'ol Java objects (POJOs), avoiding the inconsistent, ever-varying, project-specific configuration files.

Spring's power - and the reason why I personally find the very notion of some other pure play IoC container like CDI as a "competitor" to Spring to be laughable at best - is its rich, unified libraries and the platform that it provides through its integrations. Spring provides a clean, consistent metaphor for approaching problems. It provides libraries that are idiomatic and that work wonderfully together, and it provides services that can be weaved in a clean way across an application. These libraries are often layered. They present the 90% case solution first, but provide hooks through the use of things like strategy interfaces and callback methods should you need to tailor the behavior.

The Spring framework is a very good example of the open/closed principle. It is telling that very few people even know about all of the Spring framework's extension points; most people don't need them. For 90% of the use cases, Spring makes the impossible easy, and provides the flexibility to tackle the other 10%. Where possible, Spring makes facets of an application invisible - things that used to require an API. Where there is still an API dependency, Spring typically ships with a cleaner API that insulates you from it or simplifies it.

I mention all of this because Shopzilla's architecture and applications - as much as possible - lived in the 90%; things were as simple as possible thanks to Spring and the incredible diligence of the engineering team. Shopzilla really excelled in all the little 10% spots, too. They used or extended everything, taking nothing for granted. Shopzilla had a custom Spring MVC view resolver and view templating format, for example. They have a custom JMS message listener container that was geared to batching in the style of the Spring framework's message listener container. They made ingenious use of monitoring, Spring's amazing AOP support, JMX, and various open source projects to handle terabytes of logging. The entire federated architecture across several different teams used REST and a standard, Maven controlled archetype to keep projects standardized. In essence, as part of a engineering-wide culture of consistency, and code reuse, Shopzilla had built upon and extended the Spring framework, and it underpinned everything they did. Shopzilla integrated technologies and published reusable solutions for common problems so that everybody benefited in the same way that the Spring framework itself does.

Shopzilla's amazing, and I would recommend it to anybody if you're looking for an amazing company to work for.

So, when I was approached to join SpringSource as the Spring developer advocate, I was at once sad to leave Shopzilla, but elated at the prospect of playing a part in this technology that had so well served me for the better part of the last 8 years. Leaving Shopzilla was painful, of course, but I had to see this opportunity through. I have a deep respect for SpringSource and the committed engineers there who - even as I write this, on the last Saturday on New Year's weekend - are sending emails about developments in the projects! I've been with SpringSource since August. SpringSource is a worldwide organization, so no matter what time of day it is, there is somebody committing something awesome, somewhere, in plain view of the world. If I'm not careful, I forget to leave my desk trying to keep up with all the exciting stuff!

Spring's made my decade much more pleasant than it might've otherwise been. If you'd told me we'd have something like the Spring framework in 2000, and that I'd be privileged enough to work with the people behind it, I would have dropped my CORBA and EJB books on your feet. It would have seemed so cruel to joke about something like that.

It's been a fantastic decade, and a particularly fantastic 2010, and I can't wait to see what comes next.

I hope you had a safe, joyous New Years, and I wish you a fantastic new year, and a new decade.

November 23, 2010

The H2 Embedded Database

I've been making heavy use of the H2 database of late. H2 represents the next big idea from the mind of the gentleman who created HSQL, so, of course, it's a rock-solid alternative to that.

I used it for my sample code in my blog post on the SpringSource blog Green Beans: Putting the Spring in Your Step (and Application) a few weeks ago and it worked really well. Ultimately, the example demonstrated Spring's fantastic support for creating embedded databases through the jdbc namespace. Using the namespace, you can create an in-memory, embedded database instance, feed it setup SQL scripts, and then reference it as a datasource, all in the following 3 tidy little lines:

<jdbc:embedded-database id="ds" type="H2">
  <jdbc:script location="classpath:setup.sql"/>
</jdbc:embedded-database>

I mention this all because it'd be easy to think of H2 as only an embedded database. But it's not. I've not used it in anger myself yet, but recently I've seen it used in several places I wouldn't have imagined at first. H2 itself bills itself as the most advanced open-source database out there (not just of the Java, or embedded databases, but all of them!)

I'm a big believer in the power of a good workflow / business process managment system, and support and use Activiti which is an Apache 2 licensed open-source BPMN 2.0 implementation. I'm also a committer to the project on the SpringSource side, along with the unnaturally brilliant Mr. Dave Syer, but my knowledge of it is mainly from using it as a consumer. Activiti stores process state in a database (this is how it's able to passivate processes over long expanses of time). The first several milestone releases of Activiti featured exclusive support for persisting process state in H2, and H2 alone. As the project nears 5.0 GA, support for PostgreSQL and MySQL have also been added, but it's pretty telling that initially H2 was and they weren't.

If you spend time spelunking git.springsource.org (and why wouldn't you?), you'll know that it's a veritable treasure trove of code - many of the SpringSource open-source projects are there. Users are also free to create accounts, and clone and manipulate repositories as they like, in very much the same fashion as one might with Github. One particularly interesting project is Greenhouse, which is a reference application out of which many different, great little projects have emerged like Spring Social, Spring Mobile and Spring Android. The application is an event manager for conferences. Most conferences have something like it to let you build a session schedule and be notified of changes, usually from the convenience of your mobile device, like Greenhouse. It too is built on top of H2 which is already in production and available to a non-trivial userbase.

The reason I use it is because I tend to do a lot of things in the interest of exhibition, and nothing beats a readily available, easily installed database. With H2, you simply download it, unzip it, cd bin, and then run h2.sh. Boom, up pops a browser which prompts you to login and off you go! You can introspect your schemas, run queries (the query editor has auto complete and is ridiculously intuitive, and keyboard friendly!) and do basic administrative tasks all from your browser.

So, what's my point? I didn't know much about this handy little database until a year ago and now, increasingly, I find myself reaching for it all the time! Give it a go if you have a moment, as that's all you need. As I've never sat down and done a comparison against my RDBMS-of-choice, PostgreSQL, I don't really know where H2 stands as an alternative, but my cursory sort of uses thus far give me the impression that it'd handily give MySQL a run for its money.

Devoxx 2010

I've just returned from Devoxx 2010 where I manned the SpringSource booth and talked to members from the community and gave a talk on the latest and greatest in the wide world of Spring. It was a lot of fun, but I'm glad to be home! There's a bit of downtown for those of us in the states as we celebrate Thanksgiving. Looking forward to catching up on some work!

Then, I'm off to speak at the Salesforce.com Dreamforce conference. I'll be giving an intro to Spring for the busy Force.com developer with my friend Quinton Wall, the SalesForce.com evangelist. This talk will be useful for developers interested in moving to the VMforce cloud, coming from a Force.com background. The event looks to be very interesting (beyond the incredibly cool technical sessions, I hear Bill Clinton's giving a keynote, and Stevie Wonder's the musical talent... not too shabby!), so don't miss it!

October 30, 2010

Adobe MAX 2010

What a whirlwind month! First, Java2Days, then SpringOne, and then Adobe MAX.

I just spoke at Adobe MAX 2010 with my colleague Jeremy Grelle on high productivity Flex applications using Spring Roo. Reception seemed to be very, very good (I'm attributing this to Jeremy, of course). Jeremy's the main contributor and founder of the Spring BlazeDS project from SpringSource. He's also the sponsor for the Spring ActionScript project. Spring BlazeDS brings enterprise messaging and services to Flex and Flash clients. Spring ActionScript provides a clean way of describing IOC in your client-side ActionScript code - it even provides the ActionScript equivalent of the @Autowired annotation on components that are added to the stage.

This year was a very good year to be an attendee. They gave attendees new Droid 2 Android-based phones (I finally made the switch from an iPhone 3GS to an Android device! Yay! The Droid 2 is not the most impressive Android offering, by far, but represents a marked improvement over the iPhone. I was glad to get it. Attendees also received a Logitech Revue, which is a Google TV-based device.

As you might expect from a good conference, there were plenty of great hallway conversations. Look forward to it next year!

Now, however. I'm going to enjoy this beautiful Southern California weekend and look forward to Devoxx

October 18, 2010

SpringOne2GX 2010

I'll be speaking at SpringOne2GX this week along with a raft of supremely awesome speakers from the Spring and Grails communities. I'll be delivering a talk about building custom components (mostly, custom adapters) for Spring Integration. There are other talks happening concurrently that, if I weren't giving a talk, I'd want to attend. :-) This year is poised to continue last year's agressive growth in attendance. Besides my talk, I'll be there taking in the talks and chatting with people in the hallways. I hope to see you there!

October 4, 2010

Ubuntu 10.10 (Maverick Meerkat) on a MacBook Pro

I have long used rEFIt to install Ubuntu on a MacBook Pro. Simply install rEFIt as instructed on the site and then install Ubuntu on the newly created partition. No weirdness. Depending on your hardware, you may need to make sure that the Ubuntu installer program uses nomemset. This wasn't the case for me.

This setup lets me have my favorite operating system on (admittedly) fairly nice (albeit overpriced) Intel x86 machines. However, the latest generation of MacBook Pros have caused me no end of grief with Ubuntu 10.04. Ubuntu 10.10, Maverick Meerkat, remies everthing and I'm happy to report I'm running the release candidate of Ubuntu 10.10 on my Macbook Pro as I type this.

Everything seems to be working fairly well. I put this post out to confirm it can work for you on a Mac, and to also point people to this page if they're having trouble getting VMware's excellent VMware Player product working on 10.10.

Java2Days 2010

I'll be speaking (again) in Sofia, Bulgaria at the Java2Days conference on the 7th and 8th of October. I was there last year and quite enjoyed the conference. What a wonderful group! I'll be copresenting two talks with Oleg Zhurakousky (we'll be talking about Spring Integration 2 as well as RabbitMQ and AMQP), and another with James Ward (we'll be talking about Spring BlazeDS and Flex, naturally). Finally, I'll be giving another presentation on using Spring and the Apache 2 licensed BPMN 2 solution Activiti (simialar to the talk I gave at JavaZone recently). Java2Days is the only conference of its kind in the Balkans and I sincerely hope to see you there!

September 3, 2010

Spring for Force.com Developers

I did a webinar with Quinton Wall, the Developer Evangelist for Salesforce.com and specifically on the VMforce collaboration. The talk went very well (thanks for all the questions and good feedback, guys!) and we have the recorded webinar, code and slides up here. This first webinar was more about introducing developers to the Spring framework, and establishing basic skills to enable developers to use VMforce.com. Stay tuned for the next webinar, coming Sept 9, that will expand on the details of VMForce.com as an opportunity for Spring developers.

Spring and the Activiti BPMN2 engine at JavaZone 2010

I'll be speaking at JavaZone in Oslo, Norway on using Spring and Activiti together. If you want to learn a bit about Business Process Management using Activiti in conjunction with the Spring framework, then this talk is for you! We'll explore using Spring from Activiti's BPMN 2 engine, and we'll explore connecting your business processes to other interesting systems and offloading work using Spring Integration, SpringSource's framework for building event driven applications and connecting your applications to your data and services.

We'll talk a little bit about Spring Integration, but you won't want to miss Spring Integration lead Mark Fisher's talk on Spring Integration either! If you're new to the wide of world of Java configuration in Spring 3, then be sure to check out Costin Leau's talk on Spring 3 Java Config.

People may know about JavaZone from their excellent Java 4-Ever trailer or their Lady Java video. If you haven't seen these, then check them out!

<< Last | Next >>