Professional Web Applications Themes

Why do we do double work? - Microsoft SQL / MS SQL Server

When we develop a package using front end like Visual Basic etc. then we can write code to validate what kind of data the user can enter, save, update or delete. For example, if we want the Name should not be greater than 20 characters, we can write code for this validation. If we want that EmpID should be unique, we can write code for this. If we want that Salary should always be a positive number. I mean we can write code to completely manage how the data should be delete/saved/updated in our database. Now my questions is then ...

  1. #1

    Default Why do we do double work?

    When we develop a package using front end like Visual Basic etc. then we can
    write code to validate what kind of data the user can enter, save, update or
    delete. For example, if we want the Name should not be greater than 20
    characters, we can write code for this validation. If we want that EmpID
    should be unique, we can write code for this. If we want that Salary should
    always be a positive number. I mean we can write code to completely manage
    how the data should be delete/saved/updated in our database.

    Now my questions is then why do we have to the double work. Then where is
    the need to define the constraints (column level or table level) in the
    database tables if everything we can do in the Front-end development
    language. Also, even we if we define the constraints in the database tables
    still to check whether there is any violation of those constraints we have
    do write code in front-end application at least to trap the error to know
    constraint failed?


    Sender Guest

  2. #2

    Default Re: Why do we do double work?

    sender:

    as a general rule, the closer the restrictions (checks, sizes, etc) are
    to the data, the cleaner your data will remain over time.

    so, after your basic program evolves into your visual basic program
    evolves into your visual basic.net program evolves into the next
    language program, the data usually remains constant. imagine the amount
    of bugs possibly introduced by re-writing the same logic over and over
    again.

    however, if you put as much of the checking that is possible in at that
    database level, those checks remain constant (and virtually bug free)
    through all iterations of changes to the front end database application.


    jeff
    sourcegear corporation


    ps. i didn't even open the can of worms of other front end applications
    using the database. whose to say they have the same restrictions built
    in as your front end application.



    "Sender" <userdomain.com> wrote in
    news:#myoZGWRDHA.2144TK2MSFTNGP11.phx.gbl:
    > When we develop a package using front end like Visual Basic etc. then
    > we can write code to validate what kind of data the user can enter,
    > save, update or delete. For example, if we want the Name should not be
    > greater than 20 characters, we can write code for this validation. If
    > we want that EmpID should be unique, we can write code for this. If we
    > want that Salary should always be a positive number. I mean we can
    > write code to completely manage how the data should be
    > delete/saved/updated in our database.
    >
    > Now my questions is then why do we have to the double work. Then where
    > is the need to define the constraints (column level or table level) in
    > the database tables if everything we can do in the Front-end
    > development language. Also, even we if we define the constraints in
    > the database tables still to check whether there is any violation of
    > those constraints we have do write code in front-end application at
    > least to trap the error to know constraint failed?
    >
    >
    Jeff Clausius Guest

Similar Threads

  1. Links don't work in Shockwave movie but work in p
    By rokarege in forum Macromedia Director Basics
    Replies: 1
    Last Post: May 3rd, 02:02 AM
  2. Double-Clicking TIF's From Widnows Wxplorer doesn't work in PS701
    By bashman in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 0
    Last Post: August 14th, 02:28 AM
  3. Why we do double work?
    By sender in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: July 8th, 11:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139