BT

Talking with Ivan Porto Carrero about IronNails

| by Robert Bazinet Follow 0 Followers on Aug 07, 2008. Estimated reading time: 6 minutes |

A new project has been created for developers using IronRuby to write applications with a Ruby on Rails like experience.  The project is called IronNails and is ready for developers to give it a go today.

IronNails is developed by Ivan Porto Carrero, developer, writer and Ruby fan.  Ivan has opened the source for other developers to use and develop further.  He describes IronNails as a "Rails like development for IronRuby and WPF/Silverlight".  InfoQ had the chance to catch up with Ivan and talk to him a bit about IronNails.

We asked Ivan to describe what IronNails is to him:

IronNails should become an IronRuby specific gem that brings the Rails style of development to WPF and Silverlight. That means it should have generators, similar scripts to start the console, a plug-in framework and so on.  At the same time I would like it to be able to take advantage of the existing tools like Blend or Illustrator for doing the layout. Blend is a tool specifically designed for designers to design GUI's and add interactivity to them. That being said it should also be possible to just use arbitrary XAML files or maybe even a XAML DSL for creating views.


The vision is that by predefining a bunch of behaviors designers can drag and drop that behavior in tools like Blend. A behavior can be left click, right click, hover (enter/leave), ...  The developer that continues the work can then link that behavior to a named command which links to a controller action.  This can all be achieved in WPF with attached properties (dependency objects) it will just be a lot of work :).

The project is very interesting and is written to be used with IronRuby, which is yet to be released, we wanted to know why the framework was created in the first place:

Currently I'm working on the book IronRuby in Action for Manning and this came up while I was exploring possible ways to use IronRuby and WPF together and it seemed like a great idea to me.


I experimented a little with interface builder and ruby cocoa on the mac and liked the flow the project Rucola presented. Rucola aims to do the same thing as IronNails but for cocoa. The way cocoa thinks about views is different from Microsoft that's why the concepts that are being used in IronNails are also different. But if Eloy reads this, he's the one that showed me the path.  One of the things it should do is allow you to develop efficiently with e-editor/Textmate or any editor of your liking. It should get good integration with Test::Unit and RSpec and aim to solve the same problems that the Rails framework solves for web development. 


I like the MVC pattern for doing web development and I've found it to be a good fit for most of my projects, so I wanted to create a way to do this for WPF and Silverlight development.

Any new tool or framework is often defined by the creator and the community may see the tool as something different entirely, so when asked to define IronNails intended usage:

However you see fit :) But I guess it should enable you to use the best tool for the job at hand if it's design and layout IMHO you're better off doing that in a tool that is specifically designed to work with visual elements. If the job at hand is coding then an editor would be sufficient for some people or a more heavyweight IDE. In the end you should be able to do IronNails < >, which will give you an application skeleton. After that you can generate controllers, models and even views with a command-line generate command. A newly generated view will be added to the csproj file for the design tool so that designers can start adding content to it.  As I've mentioned, the designer can define behaviors on any element, which the developer can redirect to a named action. And the designers can generate the story boards etc. with their tool of choice.


The framework has some predefined folders in which it will look for skins. A skin contains the templates for the application. The views contain databound controls and the general layout but the idea is that you separate contents into the templates and out to skins files (resource dictionaries). That way you get a nice separation between content and layout and you can easily create new skins or visualize data differently.

IronNails is a tool which gives additional functionality to IronRuby and WPF/Silverlight, regarding the type of value add:

It implements the Model - ViewModel - View - Controller pattern that seems to be popular in WPF. It is built on some of the concepts that are seen as best practices for decoupling your code from the XAML. In virtually all cases you shouldn't need to do anything in the code behind because the ViewModel takes care of providing the commands and linking between the view and the controller.


It does all this by providing a familiar experience to Rails developers. It uses metaprogramming to generate the view model and allow you to bind to the objects you define in your controller. You can define a view model yourself to add customized behavior but you don't need to. There are some naming conventions to be followed but it should just work after that.  It enables a very testable way of development and has tight integration with popular Ruby testing frameworks.

Microsoft has said IronRuby will be released in the first quarter of 2009 and with so much more work needing to be completed, IronNails has to wait before it can be completed.  Ivan's thoughts on the future IronNails:

At this moment I cannot take IronNails as far as I want to take it because of missing features in IronRuby. As more features get implemented in IronRuby we can move more and more stuff away from C# into a Ruby code base. At the moment it's not possible to bind to a pure DLR object in XAML but in the future that will be possible. Currently there are some hacks and workarounds in the code base but they will also be replaced as support for those things is added to IronRuby.


As said earlier I wrote it for my book on IronRuby but it seemed to good to let go, so if there is some interest from the community this project can continue to evolve and keep up with the language and frameworks.

Being an open-source project, there is always room for outside developers to lend a hand and Ivan has said he is ready for help:

IronNails is hosted on GitHub.  They could get involved by just submitting patches through the GitHub system of forking and pushing. Or they can email me with their GitHub username and I can add them to the project. There is also a Lighthouse project for it where people can submit tickets. I accept all kinds of help like code, documentation, tests, ...


I expect that I can't be actively involved to code more in the project until I've finished my book. I may be able to spend only a couple of hours per month on it which isn't a lot so I'm counting a little bit on the community to keep it alive until I can dedicate more time to the project too.

More information about IronNails can be found on Ivan's blog and can also be downloaded from GitHub.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Cool stuff but... by Rob Eisenberg

After browsing the source code, I've seen plenty of things that will not compile in Silverlight. So, for the moment, this looks like a WPF only framework.

Re: Cool stuff but... by Ivan Porto Carrero

Hi,


So far there is not much that needs to compile in the application. There might have been some confusion around some of the classes I had in IronNails.Library but I removed them yesterday.
Furthermore I'm developing this using WPF because my chapter in my book is about WPF. I've had a talk with Jimmy Schementi and he will be helping to get the silverlight integration going when the framework stabilizes somewhat.



IMHO Silverlight is like a baby WPF. It supports attached properties and that should be enough for us to solve the problem. At the moment the Silverlight version (2) I'm really interested in is still in Beta and IronRuby still has a lot of chunks to implement. So I don't want to spend too much time on working around missing or broken features in anything else than IronRuby. For me to start supporting silverlight at this moment would give me too much of a moving target.

I've been seriously bitten in the past by relying on a go live license for a beta where MS then later decided they had to redesign that particular framework from the ground up. I hope you understand that while eventually Silverligh support will be added at this moment for me WPF is the most interesting to program against.



That being said, it's open source, go ahead fork it. Make sure it compiles for silverlight and send me a push request. I'll surely accept your patch.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

2 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT