Simple Data Access Layer

后端 未结 9 580
野趣味
野趣味 2021-02-06 17:33

Can anyone suggest a simple Data Access Layer (C# .NET)? Not keen on using the Microsoft Application Data Access block, seems very bloated and overkill. Also don\'t want to use

9条回答
  •  囚心锁ツ
    2021-02-06 18:04

    Other individuals and organizations have spent months or years developing their own ORMs and technologies -- many of which you listed -- and many are free to use. You should devote your resources toward your core application logic instead of trying to build another whole beast called ORM. There are enough offerings out there to satisfy all kinds of applications.

    You said you've never been involved in building your down DAL. It's a classic starting error to try to roll your own resulting ORM (as far as time and resources, not necessarily knowledge), for those reasons stated above. If you think some of the existing offerings seem overkill, just wait until you get into the intricacies of building your own.

    However if you want to compete in the ORM market and that IS your product, then go right ahead. That's my 2 cents.

    Edit: If you have concerns about being bound to a certain ORM product or offering in your project, you can simply hide away whatever software you choose behind an interface and swap in other ORMs as needed...

    public interface IBusinessDataOperations {
       // hides any ORM of choice
    }
    

    And if someday you have some free cycles and want to build your own ORM, even after trying other products, you can just slip it in behind this interface too.

提交回复
热议问题