logo

Journal.ntf on Rails

Anyway, back to Rails. Remember when I went through the phase of talking about PHP loads? It culminated in a series of articles called PHP for Domino Developers, where I tried to introduce the LAMP platform in a way us Domino-heads could understand. Well, I'm thinking of doing the same thing for Ruby on Rails.

With the LAMP set I created a PHP version of Journal.nsf, which is a familiar Notes template for most of us. It's only right then that I do the same thing in Rails. And here it is - Rails version of Journal.nsf (I bought myself some Rails hosting over the weekend).

Now, I'll admit that writing that (unfinished website) in PHP took a lot longer than it would have done in Notes. I can't say the same with Rails though. Rails is quick. Like Domino, you can have a vanilla shell of an application running in the web and ready for basic data input in no time at all. In fact I'd say Rails was quicker! In Rails we can even add server-side input validation in a flash - one more line of code is all that's needed.

Without further ado here's the Rails Journal I've built. It's rough, but it works. Have a play.

It took no time at all to build this Journal in Rails. I already had the SQL for the Journal entries table so the hard part was already done. With the SQL table in place you simply tell Rails to build the "scaffold" around it. It then creates everything you need for the M(odel) V(iew) C(ontroller) framework. After typing in one command you have a working website ready for input in to the backend SQL table.

Building a site with the default scaffold might not look great but at least it looks better than Domino's and its$$Template Defaults. To change the code Rails gave us we simply edit the .rhtml files that make up the V(iew).

Note: The View in MVC is not like a Notes view. The View part of MVC refers to anything the user sees.

Rails uses templating like Smarty and so customising the view of the whole app to look like the Journal I've created is straight-forward and a doddle. Rails follows the DRY philosophy of don't repeat yourself.

Be warned: I'll be talking more about Rails. I love it. It's what I've been searching for all this time. There'll be a more in-depth discussion of creating Rails code when I get round to writing an article about it.

Maybe I should do a screengrab video of building the same simple web application in both Domino and Rails and see which one takes less time. Anybody interested in the result? What's the best software to use for making these kind of videos?

Comments

  1. Very interesting Jake. I would be interested to see a comparison like that. I have used Camtasia Studio for that type of thing or Robo Demo (now Macromedia Captivate) both of these are fairly expensive products by my standards. Both of these save as .swf for better web presentation vs. an avi file.

    • avatar
    • Jake
    • Wed 1 Mar 2006 05:35 AM

    Thanks Curt. I'll look in to them. Was hoping for something cheap though.

    I suppose first I should test the theory. Although, naturally, I'm not going at it hoping Domino takes longer. Well, ok, maybe a bit of me is ;o)

  2. For demos, I use wink (www.debugmode.com). It's free and I'm cheap.

  3. Without taking any risks you might take a look at Wink

    {Link}

    It is neither Camtasia nor Captivate but it is free as in beer). Captivate has a 30 days free trial too, do not know about Camtasia.

  4. And when I began to respond Tims posting was not there. So now everyone knows what a lame duck I am. Sorry for that.

    • avatar
    • Doug Cohen
    • Wed 1 Mar 2006 07:53 AM

    Jake: I am extrememly interested in the Domino/Rails comparison.

    Like the others mentioned, you have a few options but Camtasia and Captivate are probably the best out there. Wink is free and really good, and our organization used it until we bought Captivate.

  5. Rails was alot of fun to play with, but when I thought hard about how it would fit into an enterpirse app strategy, it comes up a little short and this point in time. Yet considering how far it has come in the last year, it will warrant another look later this year.

    When you start getting into security with Rails, the amount of work required is equal to that of PHP. When RoR easily integrates with Apache, and has a respectable LDAP security container, it stands a good chance of being one of the "next big things".

    I still say that the scaffolding feature is the coolest thing since sliced bread!

    • avatar
    • Spug
    • Wed 1 Mar 2006 01:28 PM

    Yes it all looks fab. The only bit that bugged me was that the hosting looked a bit fiddly and there wasn't much choice at the moment compared to php and java. Given the ground swell of support for rails this is certain to change, my hosters are thinking about launching a ruby package in a month or two.

    I have spent the last six months doing heavy j2ee dev and can testify on how slow and cumbersome it is. Framework on framework all glued together by piles of xml. Ruby's "Golden Path" looks very attractive I can tell you.

    • avatar
    • jm
    • Wed 1 Mar 2006 01:52 PM

    ror is nice but hosting is not so easy ...

    i prefer python frameworks like :

    - django : {Link}

    - turbogears : {Link}

  6. J2EE gets slow and cumbersome only if you get roped into using something nasty like Struts/Tiles. Once you use them for a bit you start understanding what parts of the framework you truly need and you can cobble together your own.

    I ended up writing a basic controller framework and some struts-like JSP tags to do what I wanted; no hairy XML, no bloat and it only took 30-60 days. I'm developing stuff as fast or faster than I was in the Domino days.

    Cheers!

  7. It's all well and good for "web startups" and hobby sites, but chances are you're not going to be able to use it in an "enterprise" environment. It's not really designed for interfacing with "legacy" data (like mainframes or existing database schemas), nor (as far as I am aware) with the "big" databases like Oracle, DB2 or SQL Server.

    You could probably use it for "standalone" Intranet type applications, and do any integration via web services, but it would be difficult to convince management to allow another environment in these days of standard architectures and integration. Shame really.

  8. Vince has been bugging me for a while to create a simple Tornado application. Seeing your blog today gave me the impetus to write a Tornado verison of the rails app: {Link}

    By writing the app for a number of different platforms, should show programmers how things get done in other languages, while maintaining a common reference point.

    Jake - you've skipped over the database part of Ruby. As Marcin asks: how will it stack up in an enterprise? What dbs will ruby work with?

    • avatar
    • Jake
    • Thu 2 Mar 2006 02:17 AM

    Hi Brendon. Nice work. How long did that take? Fancy making a video of it to compare to Domino and RoR? I'll be makig mine shortly after some vocal coaching and a test run-though.

    I know a man who could write Journal.ntf in .Net as well.

    As for databases, according to Wikipedia, "Several different RDBMS systems are supported, including MySQL, PostgreSQL, SQLite, IBM DB2, Oracle and Microsoft SQL Server." {Link}

  9. But Jake, you haven't finished your RoR Journal yet. The search didn't work - in Domino it works hardly any effort at all. When you are doing your time conparison, be sure to include building your database schema/tables for RoR as well, something that is included (well, not needed) in Domino. There are several features like FT search, security, etc. that you get for free from Domino.

    The Journal app isn't much of a workout however; maybe the real test would be the Pet Store app. That was a popular benchmark for Java, .Net, and others:

    {Link}

    {Link}

    {Link}

    {Link}

    • avatar
    • Jake
    • Fri 3 Mar 2006 02:43 AM

    Good point Jerry and something I aim to cover at some point. The reason my RoR app has no search is that I don't know how yet.

    • avatar
    • wlpeak
    • Fri 3 Mar 2006 02:59 PM

    Excellent. I'm about to convert my Domino server into a LAMP server, put it on rails, and learn something new. So this comes at the perfect time for me. I'll be glued to this site from now on.

    Thanks Jake!

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Wed 1 Mar 2006

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

More Content