Re: Mixing OO and DB

From: topmind <topmind_at_technologist.com>
Date: Mon, 11 Feb 2008 10:44:28 -0800 (PST)
Message-ID: <49b000ec-a17d-4171-9d59-981dea0a3076_at_s12g2000prg.googlegroups.com>


Robert Martin wrote:
> On 2008-02-09 23:58:27 -0600, topmind <topmind_at_technologist.com> said:
>
> > But OOP and relational often don't compliment each other, but instead
> > fight over territory. Unless clear and logical rules form that tell us
> > when to stop one and start the other, this problem is not small.
>
> ANOTHER INTELLIGENT POINT BY BRYCE! That's two in one day!
>
> I agree, there is conflict at the borders.
>
> Do we create a stored procedure to calculate the pay of the employee?
> Or should we query for the data and write a suite of algorithms in Java?
>
> Which you choose depends on a whole suite of factors.
>
> - How much will the business rules change?
> - Do the business rules need to be independently deployed?
> - How complex are the business rules?
> - What kind of throughput are we going to need?
> - Is the operation atomic?
>
> etc. etc.

I think there is more too it than stored-procedures versus Java methods. A stored procedure is often just a subroutine written in Oracle's app language.

A bigger issue is how to manage "variations on a theme". OOP tends to use polymorphism and object pointers, while a data-centric approach tends to use set theory and attributes (meta data). I much prefer the second. I won't claim it objectively better, but to my mind it is a lot nicer, more flexible, and easier to report/study/sift via query and table browsers. And more cross-app-language-friendly. It is just easier to get my head around sets than graphs of object pointers. Sets are a higher-level abstraction than graphs of object pointers IMO. (Data-centric approaches are almost like building a domain-specific interpreter.)

Another way of saying almost the same thing is that managing relationships BETWEEN objects is a dark-grey art, while in datacentric  approaches relationship management is a light-grey art because it was invented for mass relationship managment.

>
>
> --
> Robert C. Martin (Uncle Bob)��| email: unclebob_at_objectmentor.com

-T- Received on Mon Feb 11 2008 - 19:44:28 CET

Original text of this message