Why Railo 3.3?
It's been over two and a half years since my last "why railo" post, and - despite Railo "only" being 0.3 versions on - there's been a lot of improvements!
In fact, because it's been so long, a few of the things here are not new with v3.3 (though they are all new since the previous article), but are still great features that deserve mentioning!
So, what are my ten favourite new features?
1. Custom Built-in Tags, Functions, and Objects.
With Railo, you can create a CFML custom tag, drop the file in a particular folder, and you've created a new built-in tag. This isn't just a handy side-effect, it is deliberate and supported functionality, and you can also create built-in functions too.
To use it, you simply put your custom tag in /WEB-INF/railo/library/tag or your UDF inside /WEB-INF/railo/library/function and you're done - you can then use your tag or function just as if it was built-in. In fact, you can override the existing built-in tags and functions with this method, if you have a special case when you need them to perform different behaviour.
Another handy feature is that you can also create new built-in objects, by
simply placing a CFC inside /WEB-INF/railo/components directory, and
you can then call it from any file with the new
keyword.
All of this is using regular everyday CFML - nothing special is needed. The only thing to note is that, for performance reasons, code placed in these directories is compiled and cached for the life of the server, so you need to restart Railo if you have made changes that need to be picked up.
2. Railo Extensions, Extension Manager, and Extension Store.
There's really three features here, but they're all related so we'll count them as one.
First up: Railo Extensions. An extension is simply some CFML code with an installer - it might be a built-in tag, a particular framework, an admin plugin, or whatever - you can easily install an Extension by stepping through an installation process that helps configure relevant settings and place the code in the appropriate places, without depending on the user to read a "how to install" section in the readme.
Then there's the Railo Extension Manager. A place where you can manage extensions - either from the pre-defined Railo Extension Provider, from a third-party Extension Provider, or (if you want to create one) from your own local Extension Provider.
This provides a handy way of deploying code onto multiple servers - you simply create an extension to install/upgrade the code, create a simple web service for the provider, and then you can easily point multiple servers at your Extension Provider and tell it to install the software.
Finally, the Railo Extension Store takes this a step further, by provides a central place where developers can upload Extensions they have created, and they are categorised in the public Railo Store, which also allows others to rate and review them.
3. Railo Source available on GitHub.
Whilst extensions and built-in tags can do a lot, some things can only be changed at a source level - but that's not a problem, since it is available under the LGPL license you have full access to Railo's source code.
Using GitHub you can create your own fork and modify it as required, to build your own customised version of Railo to work exactly as you need, or perhaps to fix something and submit a patch back to the project.
Even if you don't care about changing anything, you might still find GitHub handy for double-checking the way something works, simply by searching the code to see exactly how it is implemented.
GitHub also provides access over SVN, for those not yet familiar with Git, as well as zip/tgz snapshots.
4. Event Gateways
Event Gateways are a feature for when you're not dealing with the traditional request/response cycle, but instead you have a something that listens for and responds to particular events.
Railo currently comes with two pre-defined event gateway types - a directory watcher, which listens for any filesystem changes in the target directory, and an email/SMTP watcher, which does the same for emails. You can install others, and you can also create your own types.
To use an event gateway, you configure an instance of a type in the admin, point it at a Listener CFC (which will responds to the events which the Event Gateway raises), specify any relevant settings (e.g. directory to watch, how often to check, etc), and that's it. You can start the event gateway and it will watch for relevant events and execute the relevant CFML code each time.
5. Tracing variable changes
Whilst trace is not a new tag/function, in Railo 3.3 it has been extended with the follow attribute, to make it even more helpful than before!
By using either <cftrace follow var="varname" />
or
trace(var="varname",follow=true)
you can automatically log all changes to the
specified variable, and the file/line they occur on.
Even better, you can trace a component and see when its functions are called - without needing to modify the CFC itself. This can be a great help to debugging complex code!
6. Gzip output
There is now a setting in the Railo Administrator which lets you enable gzip compression for all requests handled by Railo.
Previously this is something you would need to implement manually, for example using cfcontent in onRequestEnd, but now all you need is to enable a checkbox.
7. Extensive Caching Options
This is one of the features added quite a while ago - and whilst it's not new in Railo 3.3 it is definitely worth knowing about.
Railo lets you add different caches in a similar way to how you add datasources, allowing you to select the type of cache, and configure various settings. You can configure different caches to be used for Templates, Queries, Resources, and Objects, as well as creating named caches for ad-hoc use.
For acting upon these caches there are a dozen different functions which can be used, for complete flexibility with how things work.
For further details there are three blog entries you can read: Part 1; Part 2; Part 3.
8. Easy to Use Installers
Created by Jordan Michaels and Bilal Soylu, there are now installers for Linux, Windows, and Mac OS, to take you through installing Tomcat and Railo and integrating with Apache or IIS.
Whilst it's always useful to know how to set things up yourself, you can now let the installer handle the config files for you.
9. Improved Documentation
For a while, documentation was a weak point for Railo, however since Railo 3.1 it has been continuously updating and there are now plenty of useful pages on the website and the wiki explaining how to use the features unique to Railo.
There is also now a "Community Documentation Coordinator" (that'll be me) to help ensure the docs continue to improve and that you find explanations for everything you would expect.
10. Railo Book
If you're new to Railo and CFML, the Railo 3 Beginner's Guide is the perfect book for you.
The book will guide you through everything you need to know to quickly and easily create advanced websites using Railo CFML.
It will be available in both paper and virtual form, and if you pre-order now you can receive a 50% discount on the combined price, so what are you waiting for?
Bonus Features
It would be wrong to list these two as favourite features - as I don't actually use either of them myself - however, they are both significant enough to be mentioned regardless.
11. Full cfscript support
Some crazy people don't like coding with tags, and whilst there's probably something wrong with their brains, they no longer need to be treated as second-class citizens - you can now write CFML applications entirely using script syntax, components included.
12. Hibernate ORM integration
Hibernate is the industry standard Object-Relational Mapping package, for connecting Object Oriented code with Relational database systems - and now it's integrated with Railo. So if you need ORM functionality, you've got it built-in.
There have been a lot of other cool features added and bugs fixed - you can see a list on the Railo Wiki detailing what the issues fixed in the latest release.
Of course, now that Railo 3.3 is released, this also means that the next version - Railo 4.0 - is under way, and there are some really awesome things on the roadmap for that. I'm very much looking forward to when I can write my "Why Railo 4?" post!
But if you're not yet a Railo user, don't wait any longer to jump on-board. Download Railo Express and you'll be up and running in seconds - just unzip, run the start script, and go Railo!