|
-
Jul 8th, 2003, 04:31 AM
#1
Thread Starter
Fanatic Member
EXE & DLL : Best Approach??
I have a system which I am designing in the following format :
I have some Data Classes (which handle all my stored proc calls etc) which are used by multiple classes (which are each based on seperate tables) which are used by my forms.
All my previous apps have been in one exe, this is my first with seperate exe and dll's.
What I want to know is which is the best method to use (or is there a better way) :
* Pass data in the form of a DataReader/DataSet from the multiple classes to the forms.
* Pass data in the form of arrays (after populating them from the DataReader/DataSet's) from the mulitple classes to the forms.
* Hold the DataReader/DataSets in the multiple classes and reference them from the forms.
* Reference the controls to populate (on the forms) within the multiple classes, and populate them within the classes.
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Jul 8th, 2003, 09:38 AM
#2
Well first off, parameters. Use parameters to pass around data.
You can also make a public dataset variable in a class Shared to use it in other places
-
Jul 8th, 2003, 01:01 PM
#3
Fanatic Member
It is nice to see that you are breaking in to the N-Tier arena!
Firstly, your dll file should contain your classes that handle the loading of data.
The datasets should then represent a collection of objects, each record within the dataset representing an object.
A collection object should wrap the dataset object. The collection object should be returned to the forms classes.
To access a record (object) in the collection, the collection should read out the record and wrap that record in an object of the correct type. Each property should manage the reading and writing to the field in the record.
If binding is what you are after, you can include it into the collection object and each individual object too. This will provide solid OO way of manipulation data.
The first time you do this, it may seem like a lot of work. When it comes time to add constraints and other validation to the application, you will see the benefit in wrapping the dataset.
Take a look at the .net design patterns. This shows how to solve many common problems.
-
Jul 9th, 2003, 02:52 AM
#4
Thread Starter
Fanatic Member
Cander : I know I have to pass parameters around!! 
shunt : I'll take a look at the .net design patterns. They seem to show what I'm after.
Cheers
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Jul 10th, 2003, 01:54 PM
#5
Fanatic Member
I have the perfect article for you. If you have the msdn april 2003 then use the following link:
ms-help://MS.MSDNQTR.2003FEB.1033/dnbda/html/BOAGag.htm
alternatively use the following online url:
http://msdn.microsoft.com/library/en...asp?frame=true
This article is exactly what you need to read. It is not technical. It provides you with an architectural view of how you should code your application.
-
Jul 11th, 2003, 02:40 AM
#6
Thread Starter
Fanatic Member
Freaky 
I printed out that article last night, and read the first half of it on the way to work this morning.
You're right, it seems to be exactly what I'm after, and the best thing about it is after reading the first half, I seem to be doing everything the right way at the moment.
The second half of it is probably what I need to read up about.
Cheers again
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Jul 15th, 2003, 02:21 PM
#7
Fanatic Member
Glad to see this is helping you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|