locked
Dal Layer Approach RRS feed

  • Question

  • Hi, I joined this company 10 months ago. Originally we were developing customized Human Resource Management System (HRMS) using ASP.NET with Oracle as DB and now we are actually moving to make it a Product.

    Currently I'm doing RnD to finalize Data Access Layer (DAL) approach. Because we need to support multiple databases as well as we need to look for Software as a Service. In this regard, we have few options in mind.

    1) Use NHibernate to support Multiple databases and use of OO. But we concern related to NHibernate learning curve and any problem we faced.

    2) Make a generalized DAL which will continue working with Oracle using Sproc and use tool to convert it for other Databases such as Sql Server or MySql. But we have concern of maintaing multiple scripts etc.

    3) Provide Software as a Service and maintain the way we do things. However there can be a client who do not want or trust Cloud or services

    So here I want some thoughts based on your experiences and best approach.

    Thanks!


    Adil Mughal - http://AdilMughal.com
    Thursday, January 28, 2010 5:57 PM

All replies

  • Of these, option 3 is the easiest (since you already have it written).  It's always easier to support data access that you control, so if this is an option, it will be by far the simplest option.

    I personally prefer option 1 over option 2.  Writing your own, hand-written DAL layer is a lot of work, and much more difficult than using a good ORM.

    If NHibernate's learning curve is proving too difficult, you might want to consider a different ORM.  The Entity Framework is quite nice, and getting better with each release of the framework.  I'm personally using a commercial option in my current product - LightSpeed - and it's amazingly simple and works fantastically.  The cost involved in a commercial offering should be considered, but given the savings in terms of development (we were using nhibernate, and switched to lightspeed - the implementation time dropped to like 1/10th of what we expected...), it's often worth paying for a good, supported, commercial tool.
    Reed Copsey, Jr. - http://reedcopsey.com
    Thursday, January 28, 2010 6:10 PM
  • If you have to support multiple databases and build Software as a Service, building Data Access layer using Entity Framework v4 is something you should seriously consider.
    It has relatively low learning curve as compared to NHibernate and gels well in Microsoft stack. With every version release it is becoming stable.
    Regards
    Suds
     
    Friday, January 29, 2010 6:03 AM
  • If you have to support multiple databases and build Software as a Service, building Data Access layer using Entity Framework v4 is something you should seriously consider.
    It has relatively low learning curve as compared to NHibernate and gels well in Microsoft stack. With every version release it is becoming stable.
    Regards
    Suds
     

    Thank you, But if we are currently using Oracle as a DB, I personally feel that Entity Framework might not be good to work with Oracle. Any thoughts?
    Adil Mughal - http://AdilMughal.com
    Saturday, January 30, 2010 6:34 AM
  • Of these, option 3 is the easiest (since you already have it written).  It's always easier to support data access that you control, so if this is an option, it will be by far the simplest option.

    I personally prefer option 1 over option 2.  Writing your own, hand-written DAL layer is a lot of work, and much more difficult than using a good ORM.

    If NHibernate's learning curve is proving too difficult, you might want to consider a different ORM.  The Entity Framework is quite nice, and getting better with each release of the framework.  I'm personally using a commercial option in my current product - LightSpeed - and it's amazingly simple and works fantastically.  The cost involved in a commercial offering should be considered, but given the savings in terms of development (we were using nhibernate, and switched to lightspeed - the implementation time dropped to like 1/10th of what we expected...), it's often worth paying for a good, supported, commercial tool.
    Reed Copsey, Jr. - http://reedcopsey.com

    Thank you Reed.
    Adil Mughal - http://AdilMughal.com
    Saturday, January 30, 2010 6:39 AM
  • You can also use tools like codus,tierdeveloper,codesmith etc.These will generate automatically DAL for use.In this, you can also use stored procedures but ofcourse you will have to write stored procedure urself.

    Good part is that you will not landup tweaking and writing queries urself like in Nhibernate due to performance issue as i have witnessed in many projects.Also distributed caching will not be problem for you as in case of NHibernate.

    Do let me know if you need some more details.

    Cheers

    Bhaskar

    --------------------------

    Please mark  this as answer if it helps you

     

    Monday, February 1, 2010 6:07 AM
  • Entity Framework is meant to support multiple databases including ORACLE through Oracle provider.
    It supports host of other Databases through their respective providers.
    Regards
    Suds
    Wednesday, February 3, 2010 6:27 AM