Re: The wisdom of the object mentors (Was: Searching OO Associations with RDBMS Persistence Models)

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Wed, 31 May 2006 09:21:13 -0500
Message-ID: <2006053109211382327-unclebob_at_objectmentorcom>


On 2006-05-30 17:31:10 -0500, Bob Badour <bbadour_at_pei.sympatico.ca> said:

> Joe Van Dyk wrote:

>> 
>> Hm, I take it you're not a big fan of the Active Record pattern?

>
> Only a complete idiot would be. "Let's take something with the full
> power of predicate logic and leave it with, um, restriction. Yeah,
> that'll bring it down to the level we want!"

I have no idea why you say that. The Active Record pattern (http://www.martinfowler.com/eaaCatalog/activeRecord.html) is just a way to organize some application code in a way that provides access to the database beneath. It does not restrict predicate logic in any way.

I'm not a big fan of this pattern for most applications because it couples the database logic and the business logic into a single class. I prefer Table Data Gateway structures that allow me to put the DB related code into one class, and the business rules in another. However, for some simple applications I have used Active Record.

It does not take a "complete idiot" to value these design patterns.

-- 
Robert C. Martin (Uncle Bob)  | email: unclebob_at_objectmentor.com
Object Mentor Inc.            | blog:  www.butunclebob.com
The Agile Transition Experts  | web:   www.objectmentor.com
800-338-6716                  |
Received on Wed May 31 2006 - 16:21:13 CEST

Original text of this message