Re: OOP - a question about database access

From: Bob Badour <bbadour_at_golden.net>
Date: Fri, 7 Nov 2003 10:06:25 -0500
Message-ID: <Oc6dndwnMeGNKDaiRVn-iQ_at_golden.net>


"Steve Haigh" <steve_a_haigh_at_hotmail.com> wrote in message news:zt6dnbx_MvfsOjaiRVn-gw_at_giganews.com...
> Alfredo Novoa wrote:
>
> > "Uncle Bob (Robert C. Martin)" <u.n.c.l.e.b.o.b_at_objectmentor.com> wrote
in message news:<ig2lqvsfbjjhcniov8lskbdpogkd2oagvb_at_4ax.com>...
> >
> >>>Objects like Employee, Customer, etc are completely unnecessary
> >>>because that entities are already managed by the DBMS. You only need
> >>>to map the database tables to visual controls like grids, edits, etc.
> >>
> >>This might be true if the database application does absolutely not
> >>processing of the data. If there are no business rules, and the
> >>system does nothing more than add, display, modify, and delete
> >>records, then having entity objects may not be very useful. On the
> >>other hand, as soon as you add any business rules, such as field
> >>validation, or summary reporting, etc. you need a way to separate
> >>those rules from the database. That's one very useful application for
> >>OO.
> >
> >
> > What a pearl!
> >
> > Sorry for the crossposting again, but I find things like this
> > interesting in order to understand the current state of the IT
> > industry.
> The state of the IT industry is hardly represented by a set of usenet
> postings, no matter how self important the posters feel.
>
> >
> > If recognized OO writers show this "understanding" of the data
> > management issues, imagine the rest.
> The above comments from Bob do not have any relation to "data management
> issues". Why would a database be a good place to validate text from an
> input field

Because managing integrity is managing data. Duh!

>, wouldn't it make everyone's life a lot easier if data were
> validated before making a write to a DB?

Since the dbms must enforce the integrity of the data anyway, it would not make any difference to anyone's life.

> I have found that business
> rules are easier to code in a language like Java or C++ rather than
> through the use of constraints and queries.

You are joking, right?

> It does not mean I ignore
> the functionality of a database, but I choose to write my intensive
> numeric algorithms, for example, in C++. Such code would typically take
> in user input, eternal interface input and data from a database. So,
> what it wrong with this "understanding"?

It is hard to decide where to begin. What is right about it? Why? Received on Fri Nov 07 2003 - 16:06:25 CET

Original text of this message