473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Advice on Architecture

I am starting my first C# project and have a design issue which I would appreciate some advice about. I am wondering whether to use dataset to pass information between components or if I should implement components and collections. I wondered what the advantages and disadvantages of both approaches were in .NET. I am at the start of the project and would like to make the right decision. My last project was VB and MTS and we used recordsets as a means of passing data between tiers. It has disadvantages but the filtering and sorting facilities were very useful.

The project will feature a rich GUI with drag and drop, a SQL server back end, plus real time access to Bloomberg, it will be mostly readonly database access and I am not expecting to update any database data.

Any advice gratefully received.
Jul 21 '05 #1
2 1537
You mention that you will read the data... you don't say how often.
However, in general, the dataset object was created as a disconnected
abstraction from the database. The methods on the dataset are VERY useful
for doing all sorts of tasks, from filling user interfaces, to querying on
subsets. It can be serialized across physical tiers, (which has it's
advantages on occasion but should be used carefully). It is a very good
object, that is a bit expensive to fill. If you aren't filling your
datasets every half-second, this is the way to go.

My recommendation: for all your lookup data (used to populate drop downs):
create a stored proc that returns every static lookup query under 1000
records as a series of individual SELECT statements all in one call. You
can load it up once, in a single dataset, and assign individual tables from
that to your GUI.

If you need to do a lookup against a dynamic table (list of customers) for
the sake of a dropdown, a generalized collection of rows will work. You
don't need to move the data from the DataRow that comes back from the Data
Reader. You can simply store the array of DataRow objects and pass it
around.

If you are going to make a connection, get data, fill some GUI, and not
update the database, and ever time you perform this operation, you will do
the exact same process again, always connecting, the SERIOUSLY consider
using the DataReader. It is a good bit faster than a DataSet without the
memory overhead. If you aren't going to use the capabilities of the
DataSet, it can be a waste of effort to fill it.

An excellent article to shed more light is:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Of course, if you want your DAL to always work in one way, and not two ways
(as I suggested), then you can create a Facade pattern object that embeds
either a DataSet or an array of DataRow objects, depending on the
constructor. You can then provide a single interface to your code, and only
allow the object itself know how the data representation in your code
actually manages the data. (That's the design tip).

I hope this helps,
--- Nick

"Andrew" <An****@discussions.microsoft.com> wrote in message
news:5C**********************************@microsof t.com...
I am starting my first C# project and have a design issue which I would appreciate some advice about. I am wondering whether to use dataset to pass
information between components or if I should implement components and
collections. I wondered what the advantages and disadvantages of both
approaches were in .NET. I am at the start of the project and would like to
make the right decision. My last project was VB and MTS and we used
recordsets as a means of passing data between tiers. It has disadvantages
but the filtering and sorting facilities were very useful.
The project will feature a rich GUI with drag and drop, a SQL server back end, plus real time access to Bloomberg, it will be mostly readonly database
access and I am not expecting to update any database data.
Any advice gratefully received.

Jul 21 '05 #2
Nick,

Many thanks, the basic data will be uploaded at start up with additional data be upload upon demand but still infrequently. The only exception will be a realtime price feed from Bloomberg which will cause the recalcution of some data presented in the GUI. The realtime feed I may limit to every five minutes and will be accessed via a COM component.

I do like the advantages of datasets, but feel the remove much of the OOP from a design. I also feel they limit reuse, but I guess it speed up development as well.

"Nick Malik" wrote:
You mention that you will read the data... you don't say how often.
However, in general, the dataset object was created as a disconnected
abstraction from the database. The methods on the dataset are VERY useful
for doing all sorts of tasks, from filling user interfaces, to querying on
subsets. It can be serialized across physical tiers, (which has it's
advantages on occasion but should be used carefully). It is a very good
object, that is a bit expensive to fill. If you aren't filling your
datasets every half-second, this is the way to go.

My recommendation: for all your lookup data (used to populate drop downs):
create a stored proc that returns every static lookup query under 1000
records as a series of individual SELECT statements all in one call. You
can load it up once, in a single dataset, and assign individual tables from
that to your GUI.

If you need to do a lookup against a dynamic table (list of customers) for
the sake of a dropdown, a generalized collection of rows will work. You
don't need to move the data from the DataRow that comes back from the Data
Reader. You can simply store the array of DataRow objects and pass it
around.

If you are going to make a connection, get data, fill some GUI, and not
update the database, and ever time you perform this operation, you will do
the exact same process again, always connecting, the SERIOUSLY consider
using the DataReader. It is a good bit faster than a DataSet without the
memory overhead. If you aren't going to use the capabilities of the
DataSet, it can be a waste of effort to fill it.

An excellent article to shed more light is:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Of course, if you want your DAL to always work in one way, and not two ways
(as I suggested), then you can create a Facade pattern object that embeds
either a DataSet or an array of DataRow objects, depending on the
constructor. You can then provide a single interface to your code, and only
allow the object itself know how the data representation in your code
actually manages the data. (That's the design tip).

I hope this helps,
--- Nick

"Andrew" <An****@discussions.microsoft.com> wrote in message
news:5C**********************************@microsof t.com...
I am starting my first C# project and have a design issue which I would

appreciate some advice about. I am wondering whether to use dataset to pass
information between components or if I should implement components and
collections. I wondered what the advantages and disadvantages of both
approaches were in .NET. I am at the start of the project and would like to
make the right decision. My last project was VB and MTS and we used
recordsets as a means of passing data between tiers. It has disadvantages
but the filtering and sorting facilities were very useful.

The project will feature a rich GUI with drag and drop, a SQL server back

end, plus real time access to Bloomberg, it will be mostly readonly database
access and I am not expecting to update any database data.

Any advice gratefully received.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

75
by: Howard Nease | last post by:
Hello, everyone. I would appreciate any advice that someone could give me on my future career path. Here is my situation: I am a bright Junior in a very well-respected private high school, taking...
5
by: Martin Piper | last post by:
Hi all. I've recently landed myself the position of trainee C++ programmer which I'm extremely pleased about, but also nervous. According to the feedback from the interview, I have a good...
5
by: Nick Malik | last post by:
reposting to a wider audience "Nick Malik" <nickmalik@hotmail.nospam.com> wrote in message news:WYONc.203854$XM6.119642@attbi_s53... > My turn to ask a question > > I am working on a plug-in...
4
by: Nick Malik | last post by:
My turn to ask a question I am working on a plug-in for Sharepoint that will allow a developer to add workflow rules. One of the rules will inform the adapter that it should load a DLL that the...
4
by: Heath Kelly | last post by:
I need advice on correct usage of ADO.NET in an ASP.Net environment. I have an ASP.Net application that accesses data through a referenced class library. Things start to break down when multiple...
6
by: V. Jenks | last post by:
I apologize if this is the wrong forum for this, I could not locate one that was exactly appropriate for this topic. Over the last couple of years I've been doing a lot of reading on design...
0
by: CodeMonkey | last post by:
Hi, I was wondering if anybody could give me some advice on how to structure an application that I am about to start work on. The vague requirements will be: 1) Always-On monitoring of data...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
7
by: melton9 | last post by:
I have a web service that I believe needs to implement threading. I have a timer setup to fire 3 requests and have them do some calculations and send the info to the mainform. I also need the...
0
by: onegative | last post by:
G'day Y'all, I was hoping to get some expert feedback on a proposal I am considering regarding a new internal application to help fill some gaps in our IT department. I have some configuration...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.