Rails vs Grails vs Django models

Coming back to Rails after being away from some time in Django land I discovered a huge difference in how Rails, Grails and Django treats your models. In Django and Grails you can look at a model class and see all the properties it has: [python] class Organization(models.Model): name = models.CharField(max_length=255) url = models.URLField(verify_exists=False) orgtype = models.ForeignKey(OrgType) [/python] The same model class in Rails typically looks like this: [ruby] class Organization < ActiveRecord::Base belongs_to :OrgType end [/ruby]...

June 24, 2009 · Peter Krantz

Software architects as management deadwood

Two interesting quotes from Dietrich Kappe: So no, we don’t hire architects. We hire developers. In a small team, there is no room for management deadwood. I agree completely. My view is that the title “Software architect” is a misnomer for what most architects in the software industry do, or at least what they should be doing. It is part of the weird trend that career advancement means getting away from actual programming for some reason....

February 2, 2008 · Peter Krantz

Will Rails ever run on IronRuby?

I met Ola Bini at the local Geeknight the other day and we had a brief chat about platforms, Ruby and RDF among other things. Ola mentioned that he wasn’t sure that Rails wuld run on IronRuby - Microsoft’s implementation of Ruby for the CLR. I have been following what John Lam has been writing about their progress (and I correctly predicted him joining Microsoft:-) and it appears that running Rails is a goal of the IronRuby project....

January 28, 2008 · Peter Krantz

Prism - web apps as desktop apps

When people started making applications available in the browser a number of interaction challenges appeared. How do you launch a web app compared to a desktop app? How do you prevent people from navigating away from your app? The Mozilla people have been hard t work with Prism - basically a customized version of Firefox, which lets you create desktop apps pre-configured to load a certain URL at startup. The desktop app is launched like any other application....

December 24, 2007 · Peter Krantz

When PHP makes sense

I have been looking into development frameworks for a web based software product. I want the product to be able to be installed on a variety of platforms, including Windows server with IIS. First I was looking at creating the app in ASP.NET and make it run under Mono. Unfortunately I can’t find an MVC framework for ASP.NET that works the way I want. Ruby on Rails has really lowered the threshold of what I can put up with in the form of configuration and learning curve....

September 8, 2007 · Peter Krantz

Looking for ASP.NET MVC Frameworks...

I have been looking for an open source alternative to the default way of buildig web sites in ASP.NET with Visual Studio. After having build a couple of applications with Ruby on Rails it hard to go back to the Page Controller pattern that Microsoft introduced in ASP.NET. Coming back to the ASP.NET page event model makes it clear that they created it for VB6 application developers that were used to Windows forms-centered development....

August 18, 2007 · Peter Krantz

Checking for Model Classes Before Using Them in Rails Migrations

If you are using model objects in migrations (e.g. for inserting data) you should make sure that the migration works even if that model class is removed. I discovered this when setting up a new development environment and running all migrations in an empty database. Let’s say you have the following migration code: [source:ruby] class InsertCounties < ActiveRecord::Migration def self.up County.create :code => ‘10’, :name => ‘Blekinge’ County.create :code => ‘20’, :name => ‘Dalarna’ end end [/source]...

June 7, 2007 · Peter Krantz

Bringing Ruby to the .NET environment

Things are heating up in the Ruby-as-a-dotnet-language area. Martin Fowler voiced his concerns on Microsoft not being able to look at source code and therefore having trouble implementing Ruby properly. Microsoft, with John Lam in the cockpit, is implementting Ruby for the .net platform (if you have been reading my previous blog posts I predicted way back in february 2006 that John Lam would get scooped up my Microsoft:-). Ola Bini is also concerned about Microsoft not letting ther developers look at the Ruby implementation....

June 5, 2007 · Peter Krantz

Working with UTF-8 in PDF::Writer and Ruby on Rails

Googling for information on how to use PDF::Writer shows that there are many european developers frustrated with the lack of UTF-8 support in PDF::Writer. As Ruby on Rails works great with UTF-8 these days this can be a bit of an issue. Part of the problem lies in the fact that the PDF specification (at least up to 1.6) does not support UTF-8 (you can use UTF-16 if you like). I had the misfortune of plowing thorugh it a couple of years ago when developing a PDF form filler library for a customer (don’t ask)....

May 31, 2007 · Peter Krantz

Enterprise Rails Deployment Getting Closer (thanks to Ola Bini and the JRuby team)...

Let’s forget about that for a while. Ola Bini and the JRuby team is quickly moving forward with something I would consider a breakthrough in Rails deployment options. In fact, it could well mean a breakthrough in Rails adoption in many organizations. Why (some) IT-managers like Rails but don’t like deploying it When I was a consultant I talked to many IT-managers that had heard about Ruby on Rails. They were intrigued by the fact that Ruby and Rails were created for developers rather than machines....

May 7, 2007 · Peter Krantz