Re: The wisdom of the object mentors (Was: Searching OO Associations with RDBMS Persistence Models)
Date: Wed, 31 May 2006 17:00:56 GMT
Message-ID: <cZjfg.15572$A26.362911_at_ursa-nb00s0.nbnet.nb.ca>
Robert Martin wrote:
> 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.
This is how you prove that you are not only ignorant but stupid as well. How do you join two active records? What does it mean to join them? How do you project an active record? What does it mean to project? Union? Intersection? Difference? Division? Closure?
> 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.
Here, you once again prove your ignorance. The database logic is necessarily the business logic, and predicate logic (ie. the relational model) is the best formalism we have for symbolic manipulation of logic statements. You prove your stupidity by choosing to throw away predicate logic in favor of an ad-hoc construct invented for creating large, unpredictable state machines.
> I prefer Table Data Gateway structures that allow me to put the DB
> related code into one class, and the business rules in another.
Here, again, you choose to forego the power of predicate logic for expressing business rules in favor of the ad-hoc construct invented for creating large, unpredictable state machines.
> However, for some simple applications I have used Active Record.
That's nice. [rolls eyes]
> It does not take a "complete idiot" to value these design patterns.
Okay, I exaggerated a little. Any sort of idiot might value these design patterns and not just a complete idiot. Even still, it does require a remarkable level of stupidity and ignorance to favor them over predicate logic for manipulating logic statements. Received on Wed May 31 2006 - 19:00:56 CEST