Re: Mixing OO and DB
Date: Mon, 03 Mar 2008 12:50:39 GMT
Message-ID: <zuSyj.3391$H%3.2809_at_trndny01>
"Robert Martin" <unclebob_at_objectmentor.com> wrote in message
news:2008030214431664440-unclebob_at_objectmentorcom...
> On 2008-03-01 12:15:34 -0600, topmind <topmind_at_technologist.com> said:
>
> >> Now you're just being a twit. It is very straightforward to
> >> decouple application logic from the mechanism used to maintain the
> >> persistent state of that system,
> >
> > Here you seem to be using the DB as *only* a dumb filing system.
>
> No. The DB is a powerful data management and query engine. The
> application code takes the greatest advantage of that engine. But the
> code that controls that engine on behalf of the application is isolated
> into modules that are polymorphically decoupled from the main
> application.
>
>
It seems to me that this comment captures in a nutshell the basic disconnect between the DB crowd and the OO crowd. I'll confess that my perspective puts me firmly in the DB camp. But I'm trying to understand what the other camp is thinking (above the din).
I think it's a matter of perspective: what you see depends on where you stand.
Robert's comment is a succinct summary of what you might see if you stand inside an application, but outside all of the objects that are components of that application. In that case, isolating the SQL code into a single module achieves several goals. The first goal is that it localizes the maintenance requirement when the application must be ported to an environment that no longer supports SQL, or is modified in several other ways. The second goal is that it helps people who don't understand the data by isolating the code that they won't be able to read into a single module. There are other goals, but these two will do for now.
Before I move on, I have to give an opinion based on my own data-centric world view. If you don't understand the data, then you don't know what you're talking about. In short, I completely fail to grasp how one can understand a system in terms of "behavior" without understanding the data that the behavior affects. This is something that it's going to take me years of lurking in comp.objects to grasp. And I suspect that, based on the experience of people like Marshall Spight, that I'm going to conclude, at the end of the day, that behavior is not the holy grail of computing.