5/11/2007

MonoRails - .Net is cool after all

After two days of fighting with msbuild I thought that I was going to loose hope but along comes MonoRails. We all know that Rails rocks, we have loved tinkering with Grails and now we find that wherever we go someone is building another version of this idea.

For the uninitiated, go and learn Rails first, it's the granddaddy of them all. These are new ways to build web applications, they obey the idea that conventions can be more productive and just as flexible as configuration files so you type in the name of something and it magically gets extra powers just because you spelled it correctly. Don't be afraid of the magic, it is your friend.

So, MonoRails is more of the same but here are a couple of differences that I noticed on my first night at playing with it:

  1. It is normal statically typed C#. All these frameworks use dynamically typed languages to achieve much of the magic. Injecting methods, imbuing properties, you name it they do it. The static language approach is certainly going to offer some additional challenges and, some might say, reduce the benefit of this implementation of the new approach.
  2. Parameters posted from a form are dynamically mapped to a controller method and passed in as parameters. Perhaps not ideal for large forms but certainly the simpler ones can use this instead of having to deal with a property hash. They can also mangle the form names into an object like good old structs forms.
Ends up at the same place. After a couple of hours going through tutorials I have another tabled scaffolded.

5/10/2007

Tripping in .Net

It has been a few years now but I have another opportunity to play on a .Net project. Being so used to the Java way this is going to take a little getting used to. My colleges keep snickering at me. It has something to do with the audible sound I make when frustration sets in. "Oh but this is so easy with ant, what evil is this msbuild trying to foist on us", "This would be so much easier in Eclipse".

It's the little things. I want to copy a file and replace a string within it. A simple template replacement process or in java terms, ant copy filter. NAnt doesn't support it either so I feel the need to learn msbuild.

So I have a fred.msbuild file but you open it in VS and it gives you schema errors on all the property tags because msbuild uses the tag name as the property name. So where is the MSBuild editor? MS makes everything a dialog and thats too hard for build scripts. I just need an editor.

The script can now "Copy" a template file, then "FileUpdate" is to do string replaces in it. Oh I have a lot to learn.

I fully expect to be assimilated in another few weeks and will start extolling the beauty of this new world. Until then, it is painful while the new gadgets are being surgically implanted into my brain.

I am looking forward to the new C# language features.