DotNet windows application data Layer Class Design

Hi All,

I have a question.Is it a good practice to have separate data layer classes for insert,update and delete operations in dot net 2.0 windows applications

Please throw some light on this.

Appreciate if i could able to get the light at the earliest.

Thanks&Regards,

Arun




Answer this question

DotNet windows application data Layer Class Design

  • Aleniko29139

    One of the benefits of doing OO is to minimize the complexity of an application. It seems to me that this type of design adds tremendously to the complexity. And when you think about it, it seems much more procedural than OO!

    It would make sense to have an Equipment class with methods to perform each of these operations.

    In our applications, we have stored procedures for each of these functions. Our common (generalized) data access layer then calls the appropriate stored procedure to perform the delete, insert, retrieve, etc. Our business layer then has a Retrieve and Save method. The Retrieve method knows whether to call the Retrieve or the RetrieveAll based on an overload. The Save method knows whether to update, delete, or insert based on the status of the equipment object.

    Hope this helps.


  • Gurpreet Singh Gill

    Hi Deborahk,

    Really thanks for your valuable information which i was expecting.

    Even i too had the same thought which you shared now.Now im clear with the doubt.

    Once again thanks Deborahk.

    Regards,

    Arun



  • startlet

    Yes, its usually appropriate. If you are looking for a simple layer, look into the Enterprise Library. Go here.

    If you are looking for a data abstration layer that takes care of data manipulation for you, you'll probably have to build your own. It's not easy and often times, slow.

    Hope this helps.



  • une

    Hi axshon,

    Thanks for the inforrmation but im looking more information on this.

    Let me explain u in detail.

    I have a design doc which is having a separate separate class for all of its DML operations.Like

    EquipmentDelete class for deleting equipment

    EquipmentInsert class for inserting equipment

    EquipmentUpdate class for updating equipment

    EquipmentRetrieve class for retrieving a single equipment

    EquipmentRetrieveAll class for retrieving all equipments

    I dont see a good reason to have separate separate classes for all these DML operations.

    I feel all these should be catered in a single class and not in a separate separate classes.

    Please help me in letting me know whether im right or wrong.

    Appreciate if you can give more inputs on this.

    Tnx in advance.

    Arun



  • DotNet windows application data Layer Class Design