Professional Web Applications Themes

Why 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 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 we do double work?

    "good" question.

    perhaps you don't even need sql server. Some earlier version of MS Access
    will do.

    DB design and programming has nothing to do with front-end programming.

    I usually work hard on DB design and coding. Enforcing relationships, etc..
    Then I can simply raise error to the client and do sloppy work on
    client-side :-)

    But seriously, when integrating different systems, creating different
    front-ends, etc.. properly designed DB is
    the best testing tool for front-end developers :-)



    "sender" <userdomain.com> wrote in message
    news:0eed01c34593$162e2da0$a001280aphx.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?
    >
    >
    >
    >

    Ivan Demkovitch Guest

  3. #3

    Default Re: Why we do double work?

    Sender,

    The validation at the front end overlaps the database, but I would dispute
    the "completely" e.g. len(Name) < 20 might be checked / enforced twice,
    but unique EmpID is a bit of a stretch.

    The concept of any system (and I would include the front-end app and database
    as seperate systems) checking it's inputs for errors is reasonable and prudent.

    If your front-end app and database are so tightly ( and irrevokably ) coupled
    that you consider them one system, then by all means only check/enforce integrity
    in one location. Just don't expect a whole lot of sympathy when it fails.

    Regards
    AJ

    "sender" <userdomain.com> wrote in message news:0eed01c34593$162e2da0$a001280aphx.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?
    >
    >
    >
    >

    Andrew John Guest

  4. #4

    Default Why we do double work?

    I don't know about your app(s), but my databases have all
    had to be integrated with multiple front ends, i.e., web,
    VB, Access. etc. Unfortunately, this means even more than
    double work, as I usually have to validate at the DB and
    at the front end. But not every front end is under my
    control, so I also set constraints at the DB level when
    this is true.

    This is only my opinion.

    Robert

    >-----Original Message-----
    >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?
    >
    >
    >
    >
    >.
    >
    Robert Taylor 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 do we do double work?
    By Sender in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 10th, 02:54 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