Re: OO and relation "impedance mismatch"

From: Fredrik Bertilsson <fredrik_bertilsson_at_passagen.se>
Date: 3 Oct 2004 07:35:41 -0700
Message-ID: <31f7e57d.0410030635.4d7b1f0_at_posting.google.com>


> > ... I would make (or generate) one class for each table
> > and use SQL queries for retrieving records/objects.
> > Why can't tables and records be considered as "objects"?
>
> They are different things, they serve different
> purposes. The tables hold data (meaningful in
> their own right)

Sorry, I don't follow you here. Every OO design I have seen have objects have been mapped to tables. If you have a class named "Customer", you will most likely also have table named "Customer".

> the objects behave, only need
> data to do what it is they are supposed to do.
> ...object only needs data necessary for
> its required behaviour.

It sound like you are talking about functions.

> Only when an object needs to be remembered
> after it dies (for a possible next incarnation),
> all data necessary for it's later revival must
> get out of the (object-context of) the running
> program into the database.

I disagree. In a multi-user environment, changes must be availible as soon as possible for the other users. If you are not using stuff like Entity EJB, this means that the changes has to be written to database as soon as possible.

Fredrik,
http://butler.sourceforge.net Received on Sun Oct 03 2004 - 16:35:41 CEST

Original text of this message