Re: No knowledge of the database?

From: Calum (calum.bulk_at_ntlworld.com)
Date: 01/06/04

  • Next message: Hans Aberg: "Re: Function object"
    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


  • Next message: Hans Aberg: "Re: Function object"

    Relevant Pages

    • Re: Theres got to be a better way
      ... I work with annoyingly complex database tables whose structure ... Programming is all about reinventing the wheel. ... But we're still writing code must like we did 40 years ago. ...
      (comp.lang.php)
    • Re: Theres got to be a better way
      ... I work with annoyingly complex database tables whose structure ... changes as my client changes their requirements, ... Instead of repeatedly writing code to format output from the DB, ... Programming is all about reinventing the wheel. ...
      (comp.lang.php)
    • Re: Theres got to be a better way
      ... I work with annoyingly complex database tables whose structure ... changes as my client changes their requirements, ... Instead of repeatedly writing code to format output from the DB, ... ALways with programming it's bread and butter, ...
      (comp.lang.php)
    • Re: What is .net
      ... software) for installing and running ASP.NET desktop applications and Web ... You just want to learn, and have no experience programming (nothing ... relational database design in general and SQL Server in particular. ... don't ignore the topic of "relational database design" - ...
      (microsoft.public.dotnet.faqs)
    • Re: What is .net
      ... software) for installing and running ASP.NET desktop applications and Web ... You just want to learn, and have no experience programming (nothing ... relational database design in general and SQL Server in particular. ... don't ignore the topic of "relational database design" - ...
      (microsoft.public.dotnet.framework.aspnet.buildingcontrols)