Welcome to EMC Consulting Blogs Sign in | Join | Help

andyBlog [andy britcliffe]

My working life in an internet nutshell

So what does Rails give you?

Following on from this post both John and Julian posted interesting comments. I'd like to address John's comments in this post as I think he poses some very good points that certainly crossed my mind as I started looking at RoR.

In my day to day life as a .Net is I've found with .Net development is that there is generally 5 different ways to do something and while choice is a good thing, convention is something that is somewhat missing. Coming to a mid process .Net project can* (*not always) be a challenge to get upto speed with things such as directory structure, which ORM is used (if it all), which logging framework is being used (Ent Lib, Log4net), which Unit test software is being used, where the Unit tests live etc etc.

What I've found with Rails is a lot of that is just baked in. When you look at a rails directory structure it is consistent from application to application. If you needed logging in a rails app you know you can call

logger.info("log me").

Again the whole persitence framework, with Active Record you get you Data Access baked in. Testing is there and ready to go by simply typing rake from your application root.

Now with all this, then of course there are sacrifices. In my opinion Rails isn't a great choice if working with Legacy systems. Now I'm not saying it can't be done, however I do think you'll probably have to many sacrifices for it to be a worthwhile experience rather than going with something like .Net.

John also asked (q's in italics):

For instance, can you join a few database tables together in your query? 

Absolutely, using Has and belongs to many (HABTM) for Active Record, and you can always create you're own SQL and run that using Model.find_by_sql

And what about other data sources - can you manipulate a message queue or an Active Directory through code just as easily?

Active Record supports multiple database adapters,  and there are also solutions for querying AD although it's certainly not something you get out of the box.

And are you able to put your database access through stored procs instead of using dynamic SQL?  

A classic bone of contention, short answer - you can if you want. :)

How much control do you have over transaction boundaries?

Not something I've used massively but Active Record does support ATOMIC Database transactions providing obviously the database supports transactions.

Well I hope that's shed some more light onto Rails. 

Published 09 March 2007 18:48 by Andrew.Britcliffe

Comments

 

andyBlog [andy britcliffe] said:

Ok. It feels like I'm heading on something of anti .Net direction recently, but I'd like to assure

March 9, 2007 22:14
Anonymous comments are disabled

About Andrew.Britcliffe

Senior Technical Consultant.
Powered by Community Server (Personal Edition), by Telligent Systems