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

An Architect's View

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

An Architect's View

Search Results for Real World Clojure

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!

4 CommentsTags: clojure

Speaking about "Boring Stuff" at Clojure/West

January 11, 2012 · 2 Comments

I was very pleased to get an email last night notifying me that my session proposal has been accepted for Clojure/West in March! Due to the number of high-quality submissions, I'll get a 25 minute slot instead of a 50 minute slot so that'll be quite a challenge and I'll have to narrow the focus of my talk to make it fit. Here's the original title and description - the talk will be a subset of this, yet to be decided:

Real World Clojure - Doing Boring Stuff With An Exciting Language

Clojure is often praised for its ability to tackle complex data problems and the glory goes to pattern matching, logic programming and massive scale (Storm, Cascalog etc) but what about real world problems? Is Clojure really only useful for hard problems?

In this session we'll take a look at using Clojure as a general purpose scripting language. World Singles has a multi-lingual, multi-tenant web platform for Internet Dating and we've adopted Clojure as our primary back end language. We'll look at solving real world problems - persistence, email, internationalization, configuration and environment control - ordinary problems, in ordinary applications, to see how Clojure can help you in your day-to-day life.

Given my association with clojure.java.jdbc, I'll probably focus mostly on that part of our usage but I hope to at least give a flavor of the other stuff we're doing with Clojure.

2 CommentsTags: clojure

Real World Clojure - email status tracking

November 02, 2011 · 3 Comments

We track the current status of an email as: updated, valid, bouncing or invalid. An email address can be updated by a member, validated (when a member is known to have viewed an email we send them or click on a link) or bounce (detected by PowerMTA). So we have a series of email "events" and we need to handle changes of state, based on those events. Clojure makes that sort of state machine very easy.

[Read more →]

3 CommentsTags: clojure

Real World Clojure - logging

November 01, 2011 · 5 Comments

Clojure provides a nice, consistent interface for logging via clojure.tools.logging (one of the new, modular contrib libraries). It automatically wraps slf4j, commons logging, log4j and java.util.logging but you can override the implementation, if needed.

[Read more →]

5 CommentsTags: clojure

Real World Clojure - i18n resources

October 31, 2011 · 2 Comments

With a name like World Singles, you won't be surprised to know that our dating platform supports several different languages so our (non-Clojure) code is littered with calls like i18n.getResource( keyText, user.getPreferredLocale() ) and i18n.formatRBString( translation, [ arg1, arg2, arg3 ]). The former returns the localized translation for the keyText and the latter replaces substitution patterns like {1}, {2}, {3} with the matching argument from the supplied list.

[Read more →]

2 CommentsTags: clojure

Real World Clojure - SQL and noSQL

October 30, 2011 · 10 Comments

Persistence is core to pretty much every real world application.

[Read more →]

10 CommentsTags: clojure

Real World Clojure - Tooling

October 29, 2011 · 5 Comments

The easiest starting point is to get Clojure up and running with Leiningen. Leiningen is an essential Clojure tool that can create projects, resolve library dependencies, compile your code, run your tests, fire up a REPL and a whole lot more.

[Read more →]

5 CommentsTags: clojure

Real World Clojure - HTML email generation

October 28, 2011 · No Comments

Like many companies, we send HTML emails. This has always been extremely easy in CFML because it has a cfmail tag built-in which allows you to put HTML directly inline inside it - which in turn can include CFML code so the HTML can be dynamically generated on the fly. As we unravel parts of our application model and make them reusable from both CFML and Clojure code, we have to replace low-level CFML code with Clojure because, right now, CFML cannot be easily called from Java code, especially outside the Servlet in which CFML runs.

[Read more →]

No CommentsTags: clojure

Real World Clojure - XML generation

October 27, 2011 · No Comments

As mentioned earlier in this series, we have a process written in Clojure that reads updated member profiles from our MySQL database, converts them to XML and posts them to our search engine. XML generation in Clojure is made very easy by using a library called hiccup.

[Read more →]

No CommentsTags: clojure

Real World Clojure - environment control

October 26, 2011 · 2 Comments

Our platform uses some minimal per-environment configuration to determine on which tier it is running: dev, CI, QA, production. We have a fairly large number of application settings which vary by tier, such as data sources, ports and hostnames for external services, email addresses to be used for error reporting and so on.

[Read more →]

2 CommentsTags: clojure