Using class collections in the asp:grid control

T

Torp

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
 
A

Alvin

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
 
T

Torp

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top