http://seancorfield.github.io for newer blog posts." />

An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Real World Clojure at Clojure/West

July 30, 2012 · 4 Comments

Back at Clojure/West in March I gave a talk about World Singles' real world use of Clojure to do "boring stuff": general purpose web application programming. The recording of my talk is now available on InfoQ.

It's always a little odd to watch myself giving a talk, especially when it's the first time I've ever given a specific talk and, in this case, particularly when it's the first time I've ever had to give a 25 minute talk (instead of 40-60 minutes). It's a high-level talk. I show a couple of slides of code but I didn't have time to dig into how things really work at World Singles. I hope to get a chance to do that one day.

Apart from saying "Um" far too much, I think the talk went pretty well. Clojure is intended "to be a general-purpose language suitable in those areas where Java is suitable" according to the Clojure rationale and I think there needs to be more written - and spoken - about that general-purpose usage to show how approachable and productive Clojure can be. The big data / high scale stuff is very important, but I want people to realize Clojure can tackle everyday problems too, providing a concise (and FUN) way to solve those problems!

Tags: clojure

4 responses so far ↓

  • 1 Marc Esher // Jul 31, 2012 at 9:04 AM

    Congratulations again on the speaking engagement. I'm looking forward to watching the recording.
  • 2 David Murphy // Jul 31, 2012 at 3:11 PM

    i enjoyed the talk, not too many 'umms', was surprised how American you are becoming. The English sound was there, but definitely more pronounced American. Love to Jay and the cats.
  • 3 Dave // Aug 10, 2012 at 12:40 PM

    Really great talk, Sean. It's great to see how Clojure is being used in the real world and how common problems are being solved. I would be really interested in how you handle your environment control that you mentioned early in the slide. I'm struggling with that myself right now.
  • 4 Sean Corfield // Aug 10, 2012 at 7:32 PM

    @Dave, although I do it in Clojure, the process could easily be done in CFML too (I just needed code I could call from Java/Clojure as well as from CFML!).

    I'll blog about it when I get time because we've just added a pretty cool enhancement to allow our "environments" to inherit settings from common configuration items.

    The basics:

    We have an array of structs. The structs have name, hostnames (array of hostnames to match) and setting (struct of actual settings for each environment). We also have a struct of default settings.

    At startup, we get the machine hostname - using Java InetAddress.getLocalHost() - and walk thru the array looking for the first struct that has a matching (partial) hostname, then we merge that settings struct onto the default settings struct and - voila! - that's our per-environment settings.

    In addition now we have an extends key in the struct with an array of configuration items to "inherit" in order, we merge all the inherited settings, then the per-environment settings, then merge that onto the default settings.

    That allows us to have pieces of configuration specified just once, and reuse them across multiple environments, e.g., a local MongoDB instance (for each developer's environment), sandbox e-commerce credentials and live e-commerce credentials - reused in different environments as needed for testing.

Leave a Comment

Leave this field empty