Re: Mixing OO and DB

From: topmind <topmind_at_technologist.com>
Date: Tue, 4 Mar 2008 15:06:57 -0800 (PST)
Message-ID: <48682ffd-3e8f-4053-a711-974dfe77012a_at_e25g2000prg.googlegroups.com>


Robert Martin wrote:
> On 2008-03-03 12:13:08 -0600, topmind <topmind_at_technologist.com> said:
>
> > What OO designs often do is *funnel* the view a given app developer
> > has. (It can be done without OO also, but that's another topic.)
> > They'll have an Employee object/class and the rules of encapsulation
> > say: "These are the methods and the *only* methods you can use to
> > access the Employee object. All Employee operations must go through
> > them".
>
> That's true so far as it goes. What you are missing is that there is
> no restriction that other objects use the data from the employee_table.
> So while a class certainly defines the methods that can be used to
> access and manipulate the data within that class, there can be many
> different classes that use the same data in very different ways.

In other words, each class becomes a little roll-your-own database with a very custom interface. RDBMS instead factor common collectionhandling  and attribute-management idioms into a central tool. OO does not, making it primitive and tedious. RDBMS are a huge form of reuse of concepts. OO is shanty-town design versus modern civil planning. If one learns to leverage those idioms provided by the DB, then the code is simpler because it doesn't have to reinvent them.

> --
> Robert C. Martin (Uncle Bob)��| email: unclebob_at_objectmentor.com
> Object Mentor Inc.� � � � � ��| blog:��www.butunclebob.com

-T- Received on Wed Mar 05 2008 - 00:06:57 CET

Original text of this message