Using class collections in the asp:grid control

Discussion in 'ASP .Net Datagrid Control' started by Torp, Nov 17, 2003.

  1. Torp

    Torp Guest

    I believe I understand the concepts of OOP as far as how to set up the
    classes and how they use inheritance and other related topics, but I have to
    say I don't see how this works for us in our DB apps. All the examples I am
    going through on asp.net and msdn.microsoft.com don't use collection
    classes, they just create ADO datasets and bind to them in the form. The
    magazine samples I have been using don't use grids to connect to the
    objects. In addition I don't get why I would use a data collection over
    binding to the data. I guess I am just confused on how OOP should apply to
    my apps. I want to do this right and get better at this, but I can't seem
    to find any example code that takes advantage of OOP which I can relate to
    what I am doing.

    Does anyone know of any sample code locations where I can look at how this
    works for an e-commerce or even a simple DB app or a grid or something? I
    thought someone on this forum might have some good pointers on where to go.

    Sincerely,

    Scott
    Torp, Nov 17, 2003
    #1
    1. Advertising

  2. Torp

    Alvin Guest

    There are many approaches, magazines tend to use whatever is simplest to
    avoid blurring the explanation because it keeps the reader focussed on the
    concept and not the implementation details.

    For DB apps, your OOP layer might be a dll which returns a datareader or a
    dataset. Your application code calls into this layer when it wants a
    dataset. This layer knows how to talk to the database (3-tier approach). The
    idea behind it is if the database changes for any reason, code only needs to
    change in this layer (tier 2). It will always return a dataset and so your
    application code doesn't need to change. For small applications, this really
    isn't worth the price of admission which is why you see most code just
    querying and binding straight to the database but for larger enterprise
    applications it is priceless. Getting into this habit early can only bring
    fruitfull results.

    regards

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Torp" <> wrote in message
    news:...
    > I believe I understand the concepts of OOP as far as how to set up the
    > classes and how they use inheritance and other related topics, but I have

    to
    > say I don't see how this works for us in our DB apps. All the examples I

    am
    > going through on asp.net and msdn.microsoft.com don't use collection
    > classes, they just create ADO datasets and bind to them in the form. The
    > magazine samples I have been using don't use grids to connect to the
    > objects. In addition I don't get why I would use a data collection over
    > binding to the data. I guess I am just confused on how OOP should apply

    to
    > my apps. I want to do this right and get better at this, but I can't seem
    > to find any example code that takes advantage of OOP which I can relate to
    > what I am doing.
    >
    > Does anyone know of any sample code locations where I can look at how this
    > works for an e-commerce or even a simple DB app or a grid or something? I
    > thought someone on this forum might have some good pointers on where to

    go.
    >
    > Sincerely,
    >
    > Scott
    >
    >
    Alvin, Nov 17, 2003
    #2
    1. Advertising

  3. Torp

    Torp Guest

    I agree with you and I thought I was familiar with n-tier architecture, but
    my understanding was that n-tier can mean passing a dataset through dlls,
    or passing collections back
    to the client and then using them and passing them back when the user is
    done with them. That would seem to make sense, I just don't see a lot of
    good examples that show that happening. I will stay with the OOP lessons
    and work it into my coding practice as much as I can. Thanks for the
    comment! :)

    Scott

    "Alvin" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in message
    news:...
    > There are many approaches, magazines tend to use whatever is simplest to
    > avoid blurring the explanation because it keeps the reader focussed on the
    > concept and not the implementation details.
    >
    > For DB apps, your OOP layer might be a dll which returns a datareader or a
    > dataset. Your application code calls into this layer when it wants a
    > dataset. This layer knows how to talk to the database (3-tier approach).

    The
    > idea behind it is if the database changes for any reason, code only needs

    to
    > change in this layer (tier 2). It will always return a dataset and so your
    > application code doesn't need to change. For small applications, this

    really
    > isn't worth the price of admission which is why you see most code just
    > querying and binding straight to the database but for larger enterprise
    > applications it is priceless. Getting into this habit early can only bring
    > fruitfull results.
    >
    > regards
    >
    > --
    >
    >
    > -----------
    > Got TidBits?
    > Get it here: www.networkip.net/tidbits
    > "Torp" <> wrote in message
    > news:...
    > > I believe I understand the concepts of OOP as far as how to set up the
    > > classes and how they use inheritance and other related topics, but I

    have
    > to
    > > say I don't see how this works for us in our DB apps. All the examples

    I
    > am
    > > going through on asp.net and msdn.microsoft.com don't use collection
    > > classes, they just create ADO datasets and bind to them in the form.

    The
    > > magazine samples I have been using don't use grids to connect to the
    > > objects. In addition I don't get why I would use a data collection over
    > > binding to the data. I guess I am just confused on how OOP should apply

    > to
    > > my apps. I want to do this right and get better at this, but I can't

    seem
    > > to find any example code that takes advantage of OOP which I can relate

    to
    > > what I am doing.
    > >
    > > Does anyone know of any sample code locations where I can look at how

    this
    > > works for an e-commerce or even a simple DB app or a grid or something?

    I
    > > thought someone on this forum might have some good pointers on where to

    > go.
    > >
    > > Sincerely,
    > >
    > > Scott
    > >
    > >

    >
    >
    Torp, Nov 17, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alexandru Nedelcu
    Replies:
    1
    Views:
    1,633
    John Saunders
    Jun 16, 2004
  2. Girish
    Replies:
    4
    Views:
    641
    Patrick.O.Ige
    Jul 19, 2005
  3. Doug Poland
    Replies:
    9
    Views:
    705
    VisionSet
    Sep 27, 2003
  4. E11
    Replies:
    1
    Views:
    4,684
    Thomas Weidenfeller
    Oct 12, 2005
  5. mutex
    Replies:
    0
    Views:
    193
    mutex
    Jul 27, 2003
Loading...

Share This Page