Results 1 to 7 of 7

Thread: EXE & DLL : Best Approach??

  1. #1

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    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.

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    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.

  4. #4

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    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.

  5. #5
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    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.

  6. #6

    Thread Starter
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    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.

  7. #7
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    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
  •  



Click Here to Expand Forum to Full Width