locked
creation of DAL methodologies? RRS feed

  • Question

  • Hi friend,

    I fund out there are two main techniques of creating DAL
    1. using the wizard as a stronly typed dataset
    2. creating the Dataset by code


    1. IN the industrying which is the most prefered? is it the use of wizard or code? (i hope this is not like a programming religiouse warfare lol)
    2. If i was asked to desigin a DAL in a job interview, which technique that i should use?

    thanks





    Tuesday, December 15, 2009 6:24 AM

Answers

All replies

  • There are also other options such as using Linq to SQL or entity framework.

    Personally, I create my datasets in code because it gives me the most flexibility.

    I have examples here:

    http://msmvps.com/blogs/deborahk/archive/2009/07/07/dal-data-access-layer.aspx

    Hope this helps.
    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
    • Proposed as answer by syntaxeater Tuesday, December 15, 2009 4:36 PM
    • Marked as answer by liurong luo Friday, December 18, 2009 8:51 AM
    Tuesday, December 15, 2009 4:10 PM
  • My 2 cents...


    1. IN the industrying which is the most prefered? is it the use of wizard or code?

    Whatever suits your needs.  The way I see it - Datasets are your starting point.  Using the wizard to generate a typed dataset removes a level of data abstraction by allowing you to work against your schema.  However, you are still working with raw data items.  Doing this by code lets you create a well-defined, purpose driven DAL that can directly populate your BLL with little transformation needed.

    Long story short, I agree with Deb (including the LINQ to SQL method instead of typed datasets).


    2. If i was asked to desigin a DAL in a job interview, which technique that i should use?
    Code - most deffinitely.  During the interview process, a general rule of thumb is to avoid the use of any wizards unless they specifically say to use one.
    Tuesday, December 15, 2009 4:36 PM
  • I disagree.  There are many great tools with thousands of person hours invested in them that you can use to generate your DAL.  In an interview if you told me that you would write one by hand I would thank you for your time and cut the interview short.


    jon.stromer.galley
    Tuesday, December 15, 2009 8:44 PM
  • I agree with jgalley, it all depends on the application. If you have a project where the bottleneck isn't going to be in the DAL, use something like the entity framework to save time. I would only suggest doing everything in code if you need to do something the automated tools can't, or if efficiency is a big concern. Keep in mind I suggest creating a DAL which uses the tool, not just using the tool as your DAL.
    Tuesday, December 15, 2009 8:49 PM