locked
Design DAL/DataSet/Business Objects RRS feed

  • Question

  • Hello,

    I am currently designing an application (.Net WinForms) that needs to access a database (SQL Server).

    Using the datasource wizard, Visual Studio automatically creates the dataset, tables and classes for rows:

    For example if I have the Customers table the wizard will create “CustomersRow” class that inherits from Global.System.Data.DataRow with the corresponding fields as properties.

    In my application I need to implement other methods and attributes for the Customers class.

    How to deal with these generated classes, modify them by adding methods.. or ignoring them and implement my own business classes?

    A second question:

    How to populate my objects (eg list of customers?)

    Do you suggest using datatables / dataset and their methods or build my own data access layer and I meet the client list (of customers)?

    I found some patterns when searching the net but it is not precise.

    Thanks

    Saturday, September 24, 2011 1:27 PM

Answers

  • The problem wirh datasets is validation and business rules.  You're better off using entity framework because then youcan extend using partial classes and dataannotations.
    • Marked as answer by AmineTn Sunday, September 25, 2011 5:08 PM
    Sunday, September 25, 2011 5:06 PM