Re: Mixing OO and DB

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Tue, 4 Mar 2008 16:35:45 -0600
Message-ID: <2008030416354577633-unclebob_at_objectmentorcom>


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.

-- 
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 Tue Mar 04 2008 - 23:35:45 CET

Original text of this message