Behavior-based modeling is a good fit for application-level data modeling. Behaviors and their supporting nouns tend to be consistent within an application, regardless of varying ways the data may be persisted. For system or cross-application data modeling, a more abstract, noun-first (object-based) approach may be better. This way, the data structure doesn't have to change from application to application.
I'm at RailsConf.
Portland, Oregon is, well, Portland (overcast and wet). Got in late last night and walked over to Stanford's. The service was friendly, even at 10:30 PM. Everything about the burger was above average. And it came with hot, crispy, slightly salty fries. It was all devoured with sips of a local wheat bear that I forget the name of.
So far, having been away from Ruby and Rails for over a year, it feels like going back to a place you used to live. Some things are still the same. In other ways, I hardly recognize the place. New techniques like elastic computing (and plenty of competing commercial hosting options), new tools such as git, tarantula, and hobo, etc. Good stuff.
I'll pretend I blog and let you know how it all goes.
If you're new or semi-new to TextMate and you're collaborating with someone on the same development project, file change collisions are inevitable. Textmate has nice support for resolving file conflicts when they show up after updating to the latest SVN depot revision.
Note: This post assumes you are on a Mac :^).
Continue reading "Resolving Files with TextMate, Subversion, and FileMerge" »
As a former Java developer and new to the concept of blocks, these API options seem perplexing at first. They're not. All three take a block. How they use the block is what distinguishes them. You should read the RDoc for yourself but, if you want a quick a dirty summary, continue reading this post.
Continue reading "Ruby Arrays: select(), collect(), and map()" »
Introducing Ruby refactoring pattern called "Forward with Default Params." This applies to any language that supports parameter defaulting, actually. And, this pattern may already be documented somewhere for all I know - I haven't looked into it. If someone can point this out, I'll be happy to defer all credit. In the meantime...
Problem: You keep creating new methods, each calling the same helper or 'core' method (we'll call it 'method_a'), but with different params. You can't change the required params of the core method because spagetti-legacy code relies on method_a, without params, such as with Rails controllers. You should fix the spagetti code but time dictates otherwise. However, you feel dirty violating DRY in your controller. What to do?
Continue reading "Ruby Refactoring Pattern: "Forward with Default Params"" »
In this post and the two that follow, I highlight interesting talks at The Rails Edge, 2006. I do it for Google searching posterity and for my admittedly selfish desire to reinforce key concepts presented.
Nothing ground breaking in this post. I write it only because the existing documentation for this behavior is weak or nonexistent.
Have you ever seen the following message while testing your Rails app?
NameError: uninitialized constant ... blah, blah
Several people I know have asked me this recently. Without just pointing straight to Bruce Tate, here's what I've come up with.
<short_answer>
* Ruby is an order of magnitude more powerful and less bloated than Java
* Ruby has Rails and an explosion of new libraries being built with or for Ruby
* Ruby will make you look good to your customers by developing more efficiently, making you more money
* Ruby is hot
</short_answer>