Re: No knowledge of the database?
From: Calum (calum.bulk_at_ntlworld.com)
Date: 01/06/04
- Previous message: S Perryman: "Re: Unix and OO Avoidance"
- In reply to: Fredrik Bertilsson: "No knowledge of the database?"
- Next in thread: Universe: "Re: No knowledge of the database?"
- Reply: Universe: "Re: No knowledge of the database?"
- Reply: Fredrik Bertilsson: "Re: No knowledge of the database?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 06 Jan 2004 11:37:26 +0000
Fredrik Bertilsson wrote:
> When I look at different forums about object oriented programming I
> often finds statements like this:
> "I see databases as a commodity that should be swappable."
> "...such that developers (computer programmers) can write
> object-oriented applications using those object classes without any
> explicit reference to or knowledge of the underlying database or its
> structure."
>
> I have worked with many information systems (production control,
> logistics, human resouce etc) with java and VB as programming
> languages. But in all cases a good knowledge of the (relational)
> database structure is absolutely necessary for every programmer (even
> client programmers). Are there anybody here on this forum that develop
> information systems and don't know about the database structure? If
> yes, how do you do if you have a system failure due to wrong data, and
> the data in the database has to be corrected. Do you call someone else
> that knows about the database structure?
>
> My second question is: Are there anybody on this forum that have
> experience from changing the database structure without major changes
> in the source code, not just the data access layer? If yes, I would
> really know how to do?
>
> /Fredrik
The way I look at it is to try to seperate the coupling between client
code and the database as far as possible. At the bottom, you have the
database. On top of this sits an API. Above that sits some classes
that call SQL to manipulate the database tables. The client code
interacts with your classes rather than the database itself.
Your classes should be as independent of the database as possible.
Changing the table structure or database vendor should have little or no
impact on the client code or the external interface to your module.
Inevitable, you will need to restructure your tables. But because you
have isolated the database access to a small number of classes, the
change is easy to make. If SQL statements and direct API calls are
riddled throughout your application, this will be much harder to change.
Also your compiler can't verify the validity of embedded SQL
statements, so you need a thorough test suite.
Calum
- Previous message: S Perryman: "Re: Unix and OO Avoidance"
- In reply to: Fredrik Bertilsson: "No knowledge of the database?"
- Next in thread: Universe: "Re: No knowledge of the database?"
- Reply: Universe: "Re: No knowledge of the database?"
- Reply: Fredrik Bertilsson: "Re: No knowledge of the database?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|