An Architect's View

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

An Architect's View

Entries Tagged as cfmljure

Railo 4.2, Tomcat 7, Clojure - how simple could it be?

June 01, 2013 ·

Thanks to Shantanu Kumar, if you have Leiningen installed for Clojure development, creating a skeleton web application based on Railo 4.2.0 and Tomcat 7 that blends CFML and Clojure is as simple as running these commands:

  • lein new lein-servlet railo myapp
  • cd myapp
  • lein servlet run

At this point you have a mixed CFML/Clojure web application running on port 3000 and you'll be seeing the home page in your browser!

The first time you run the application, it will take a while to download all of the libraries, but once those are cached locally, it will start up pretty quickly.

Shantanu's Leiningen plugin doesn't use cfmljure so Clojure integration into CFML is fairly low-level but as a way to get a mixed CFML/Clojure environment up and running on the latest Railo release, this really can't be beat!

If you want to see these commands in action, here's a short screencast I recorded [requires Safari - but it will play on iPhone / iPad as well as Windows and Mac with Safari!] showing the whole process end-to-end (including my inability to type 'cd' correctly!). This is a 'first run' so you see the full download of all the Railo / Tomcat libraries but it will give you a flavor of the simplicity involved.

Tags: cfmljure · coldfusion · railo

New FW/1 - Framework One - Organization on Github

April 06, 2013 ·

To make it easier to manage collaboration on FW/1-related projects in future, several projects have now moved under a new FW/1 - Framework One - organization on Github. Your forks and watches should have been updated but if you have local clones of the old repos under my personal Github account, you'll want to update those. Here's the full list of Framework One projects:

If you were a collaborator on one of these projects before, you will no longer have commit access (because you were a collaborator directly on my repo). If you'd like to become a collaborating team member on one of these projects as part of the new organization, contact me directly to discuss that. I'd certainly like to see some of the regular contributors in the past become official "Team Framework One" members in the new organization!

Thank you to all the contributors who've helped get these projects to where they are now!

Tags: cfmljure · clojure · coldfusion · di1 · fw1

cfmljure updated

August 07, 2011 ·

Even tho' it's far from a 1.0 release, I've updated the cfmljure project on github to contain the latest version that we're using at World Singles and update the examples so they work again, along with updated instructions - mainly that the Clojure code needs to be in WEB-INF/classes/ so that it can be picked up dynamically. This is a fundamental piece of our infrastructure at World Singles, since we rely heavily on Clojure for the Model of our application, with our View-Controller in CFML. It's not intended to be general purpose code but if you want to play around with calling Clojure from CFML, it should get you started.

Don't forget the cfmljure mailing list if you need assistance!

Tags: cfmljure · clojure · coldfusion · oss

FW/1 Roadmap, DI/1 etc

March 19, 2011 ·

Last year I'd talked about getting at least an alpha of FW/1 2.0 out the door by year end. It didn't happen. I was reminded of this on the FW/1 mailing list the other day and I provided a fairly detailed response on the plans for FW/1. I figured, since I haven't blogged about FW/1 in a while, I should post that roadmap response on my blog as well.

Is the 1.x version outdated?

No, the 1.x stream will continue to be supported. It will get bug fixes but it will not get new feature - except where I want to provide a migration path for people moving to 2.0 (for example, if I remove certain things marked deprecated in the docs, I'll provide the new API in a 1.x build to make it easier for folks to transition to 2.0). Expect at least a 1.3 version, possibly more. These versions will continue to support CFMX7+ as well as the older versions of Railo and OpenBD that 1.2 currently runs on.

Wasn't 2.0 imminent late last year?

Yes, FW/1 2.0 was very imminent at that point but work and then conference preparations overwhelmed me and it got put on the back burner for a while, along with DI/1.

Since a respite is coming in my day job (World Singles) - we're launching the second phase of our new platform soon - and I have a couple of months before the next conference, I expect to get back on top of FW/1 2.0 soon and once an alpha of that is available, I'll work on DI/1 to get an alpha of that out as well. And then I'll probably focus on cfmljure for a while, as we start to add Clojure to our production code base at work. And then it'll be beta versions of FW/1 2.0 and DI/1 and cfmljure, round and round, until they're all three "baked" and ready for official releases.

So DI/1 is coming?

Yes, DI/1 is still on my radar - I have plans for it at work so it will definitely happen! It's just been delayed (ironically, by the pressures of work). Since FW/1 2.0, DI/1 1.0 and cfmljure 1.0 will all be used in my production code at work, you can expect them to receive regular updates once I actually get to the alpha releases!

Tags: coldfusion · clojure · fw1 · di1 · cfmljure

cfmljure mailing list

September 21, 2010 ·

I mentioned it in passing in one of my early posts about using Clojure from CFML but, since only one person signed up, thought it was worth mentioning again: there is a mailing list for cfmljure where you can ask questions about the project and Clojure itself or, if you're new to CFML and coming from the Clojure world, you can ask questions about CFML!

I'm planning to add a couple of more involved examples to the project repo, one of which will use FW/1 and have the entire Model built in Clojure with the View-Controller portion written in CFML / cfscript - and I'm also planning to create a simple ready-to-run Jetty-based package so folks can simply download cfmljure and try it out without needing to worry about installing anything.

You can always get the latest version of cfmljure from RIAForge!

Tags: cfmljure · clojure · coldfusion · oss

cfmljure updated again

September 18, 2010 ·

I've updated cfmljure to version 0.3 and made a small API change to clean things up and better support access to Clojure variables from CFML - see the last section of the README on the github site.

The API change will break code that tries to use the old public data member .defn. Sorry (but that was an ugly way to implement it, wasn't it?).

In the next week or so, I plan to work up an example application that uses FW/1 and cfmljure together to implement the Model entirely in Clojure and the View-Controller portion in CFML - probably a little contact list manager that uses a database (so the SQL access will be done via Clojure).

Tags: cfmljure · coldfusion · fw1 · oss

cfmljure updated

September 13, 2010 ·

cfmljure has had a number of updates over the weekend and today to get to a fairly nice, stable API (in my opinion) so I've declared a 0.2 version number and documented as completely as I can for now. The next step is to create a full application example with the model entirely in Clojure that does something vaguely useful - or perhaps the DB access in CFML and the rest of the model in Clojure. Suggestions?

Tags: cfmljure · clojure · coldfusion · oss

cfmljure and Leiningen

September 04, 2010 ·

Leiningen is a build tool for Clojure that handles all of your project / library dependencies and makes it easy to work in a more test-driven development style. Once you've installed Leiningen, you can start a new project, on the command line, by typing lein new myproject and it will automatically create a project folder structure with a source tree (src/) and a test tree (test/). Leiningen will download and manage all of your library dependencies transparently, just by typing lein deps. Then you can develop you tests and your code and just type lein test to run all your tests to ensure your code is working. When you're ready, you can package up your project as a JAR file, with or without the Clojure runtime, with lein jar or lein uberjar. Leiningen does a lot more, but that's the basic outline.

Because Leiningen assumes a particular directory structure, I have updated cfmljure to work more easily with Leiningen projects and I have updated the examples that come with cfmljure to be a Leiningen project, complete with unit tests so you can see how things work. I've also updated the installation instructions in the cfmljure README on github to show you how to set things up via Leiningen.

Take cfmljure for a spin and let me know if the new installation process, with Leiningen, works for you!

Learn more about Leiningen on github.

Tags: cfmljure · clojure · coldfusion · oss

Online Clojure Documentation

September 03, 2010 ·

ClojureDocs - Not only will this be useful if you're learning Clojure but it is an awesome example of online documentation! Easy to navigate (drill into Clojure Core and scroll down - the ToC stays visible), everything is categorized, drilling into any function shows examples and you can click to expand the actual source code of the function!

Tags: cfmljure · clojure · coldfusion · oss

Thinking in Clojure?

September 03, 2010 ·

There's a discussion on the Clojure mailing list about how to learn to "think in Clojure" (or think in Lisp or, really, think in functional programming terms). A prominent recommendation is The Joy Of Clojure by Michael Fogus and Chris Houser, which everyone says is a great book, but here are a couple of free online books that were also recommended:

  • Structure and Interpretation of Computer Programs by Abelson, Sussman, and Sussman. It's the "entry-level subject in computer science at the Massachusetts Institute of Technology" and it uses a dialect of Lisp called Scheme, not Clojure, but it provides a good grounding in both computer science and functional programming.
  • How to Design Programs by Felleisen, Findler, Flatt and Krishnamurthi. This is another introduction to programming / computer science style book that also uses Scheme for its examples.

Enjoy!


Update: videos of the Abelson and Sussman lectures, as given to Hewlett-Packard in 1986, are available for download and there are also versions optimized for the iPod etc!

Tags: cfmljure · clojure · coldfusion