Recommendations for replacing the Entity Framework Data Access Block in a corporate library

A few years ago, we developed a large ASP.Net application (C # /. Net 3.5), which was supposed to be a “Database Engine” independent (which means that this application can use SQL Server, Oracle, MySQL ... as a database engine ) For this, we used a data access unit for corporate libraries.

But now that we are at the stage of improving performance / scalability, we are thinking about upgrading or refining the technology of our applications.

So the question is: are there any advantages to switching to the Entity Framework? Does EF retain our independent Database Engine criteria? Or should we keep the EntLib DAAB implementation, but upgrade to the latest version (5.0)?

thanks

+7
source share
3 answers

The biggest problem that arises between them is not the independence of the database, but that the usage pattern is fundamentally different. The data access unit (DAAB) is primarily a convenient wrapper around ADO.NET. This makes it easier / less annoying to call stored procedures, but you are still dealing with datasets or data readers. This does not actually affect how you interact with the database, it just makes it less annoying.

Entity Framework, on the other hand, deals with data modeling and object-relational mapping. It works at a higher level than DAAB; You write your code in terms of your objects, not using a DataSet or DataReaders. It automates the "materialization" of objects from the database, so you do not need to write this code, maintain relationships between them, etc. This is a much more fully functional, but completely different way to work with the database.

You need to think about whether you want to go first to the data access ORM style. From there, you can decide whether EF or one of many other ORMs in the .NET space is suitable.

There are many providers for EF (see Devart's answer for a list), but they are all external / optional. The only one in the box for Sql Server. Although I will add that DAAB does not actually completely overlap “database independence” - if you have any actual SQL in your DAAB calls, this will not help you with differences in SQL dialects. EF will be.

+12
source

There are many EF providers for Oracle ( Devart dotConnect for Oracle , DataDirect ) and MySQL ( Devart dotConnect for MySQL , MySQL Connector / NET ), and Microsoft provides the Entity Framework provider for SQL Server, so there should be no problem with database independence.

0
source

Is there any advantage to migrating to the Entity Framework?

As a rule, it’s faster to work with data. Linq syntax is great and can query sql.

Will EF support our independent Database Engine criteria?

Not without the support of third-party support . Although I have not come across ANY developers who actually adopted a live application and switched database technologies to or from sql.

Or should we keep our ADAB implementation, but upgrade to the latest version (5.0)?

DAAB is awesome !! I wrote performance code. Another thing you need to know with EF is the conflict merge when two people are updated separately. This can be confusing.

0
source

All Articles