Appication Design Idea

D

DotNet

hi
I am currently developing an Access DB driven windows application in c#. I
need some help on design ideas. There are two ideas I am considering.
1. Use dataset.
2. Have a middle layer. Map each table in database as object(for example,
Table customers would be mapped to Customer object). Use datareader to read
database and return an arraylist of customers.(public ArrayList
GetAllCustomers() which return an arraylist of customer objects.) OR (public
bool UpdateCustomer(Customer cus) which takes a customer object).
I am a java programmer before starting programming c#. I prefer the second
OOP idea. However I have tested that an arraylist of 3000 customer object in
my application would boost memory usage from 800KB to 100MB and drag the
performance down dramatically!!! Sometime I do need an arrayList of 3000
customers for customer listing.

Can anybody please point me at the right direction please?

Thanks in advance
 
J

Jerry Negrelli

I would use a mix of both approaches. Use an ADO object
(DataSet, DataTable) for those large retrieval processes
& use the middle layer when manipulating one Customer at
a time. So your middle layer could have a
static "GetList" method that returns an ADO object of all
customers but also all the OO joys you were looking for
separately.
 

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

Top