Boeing My Way?

September 22nd, 2006

This week I am consulting in Bellevue WA and staying downtown Seattle, only a few blocks from the Needle.

On my way from the airport, I passed a nearby airfield and saw the most enormous airplane I’ve ever seen [takeoff video]. It turns that there are only 3 of these planes in production and they are used to transport the fuselage and parts for the 787. Yes, this cargo plane carries.. another plane.

Tonight was my only “free” night for this trip. I got back to the hotel early, around 4pm, and spent a few frustrating hours trying to understand why Rails requires you to have a database to unit test Model classes… even if your entire website doesn’t use a database… very frustrating. I’ll post on this later. Tired of programming for the evening, I retired for a sushi dinner at Shiro. I had dinner here almost 3 years ago to-date for my 28th birthday. Though, in the past 3 years my palate for great sushi has become very discriminatory… and tonights dinner was a disappointing 7 out of 10. To date, my all-time favorite japanese/sushi restaurant is still Starfish in Chicago… yes, Chicago. I miss Chicago.

4 Responses to “Boeing My Way?”

  1. Shane Vitarana Says:

    How can you have a Model class without a database? Rails models follow the Active Record pattern by Martin Fowler, where a model encapsulates a database row. Remember, Rails is all about convention over configuration. Most web apps use a database, thus the Rails convention is to use one all the time. If your app isn’t using a database, then Rails is definitely not the right tool for the job. Most of the power of Rails lies in ActiveRecord, the O-R mapping layer named after the design pattern.

    I’m not sure if Toro sushi by Clark/Deming was around when you were here. Its the best sushi I’ve had in Chicago, but I will have to check out Starfish.

  2. fepus Says:

    Having model classes without a database is easy — if you have request-scope classes that represent the underlying conceptual “model” of your application, there is no requirement that they need be backed by storage. I have no need for persistence. Though, I do need MVC because I am connecting to a 3rd party data provider and need to present their information in a different (more intuitive) format. I also need templated view framework. So, rails *is* the right tool.

    One might suggest that my “model” classes that are view-agnostic should live in the ‘lib’ directory — but then I have no framework for testing and I really don’t want to convert my “model” classes into an effective 3rd party library that needs to be independently managed - ick. Thoughts?

  3. Shane Vitarana Says:

    I’m not sure if your models are extending ActiveRecord or not, but if they are, then this code might help:
    .

    It basically stubs out the connection to the DB and allows you to validate your model data, which might help in your unit tests if you have no DB.

  4. Shane Vitarana Says:

    Here is that link again: Rails Weenie

Leave a Reply