Results 1 to 4 of 4

Thread: Should I use collections ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Should I use collections ?

    I'm about to start writing my first 'useful' application, the project is some service management software which will enable the user to maintain a customer database along with their associated contract details. The main funtion of the application is to manage the equipment faults for theses contracts, it will be able to raise new faults and allocate them to one of the engineering staff as well as maintain a complete fault history for each customer.

    I'm going to use a SQL database, the question is should I create collections for the customer , contract, fault etc to hold the data or just use a data table for each. I know this question is a bit vauge but I'm thinking of just using datasets and data tables but this would put everythig into one big class, is this good practice ?

  2. #2
    Hyperactive Member The_Duck's Avatar
    Join Date
    May 2005
    Location
    Leamington, UK
    Posts
    351

    Re: Should I use collections ?

    It is fine to put multiple tables inside a dataset. I tend to group logical items together. For example I would have a customers dataset, and a faults dataset. Thus you mught have a table

    Customer
    CustomerID
    Customer

    CustomerDocument
    DocumentID
    CustomerID
    Document

    etc

    and a faults table

    FaultType
    FaultTypeID
    FaultType

    CustomerFaults
    FaultID
    FaultTypeID
    CustomerID

    hope this helps!

  3. #3
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Should I use collections ?

    If your not using objects and collections in your business layer you do lose a lot of the advantages of O-O programming (keeping your data and related methods for each "thing" in one place) and lose some flexibility.

    There is a code example I have posted for serialising objects and collections to/from SQL tables that might help you..

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: Should I use collections ?

    Thanks for your input on this, I'll check out your code sample.

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