Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternatives to Microsoft.Practices.EnterpriseLibrary.*

Tags:

c#

.net

upgrade

I have a project that is handed over to me by old developer and is in need of upgrade. Looking over all the reference Library (in .Net C#). I see a collection of Microsoft.Practices.EnterpriseLibrary.* in use.

From their Microsoft.Practices.EnterpriseLibrary website, I see it is not maintained or updated and seems to be phased out/ will be removed in near future.

I am seeking an alternatives for the following Libraries. Please advise what are the available best libraries.

  • Microsoft.Practices.EnterpriseLibrary.Caching ----> ?
  • Microsoft.Practices.EnterpriseLibrary.Common ----> ?
  • Microsoft.Practices.EnterpriseLibrary.Common.Configuration ------> ?
  • Microsoft.Practices.EnterpriseLibrary.Data ------> ?
  • Microsoft.Practices.EnterpriseLibrary.ExceptionHandling ----> ?
  • Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging ----> ?
  • Microsoft.Practices.EnterpriseLibrary.Logging ----> ?
  • Microsoft.Practices.EnterpriseLibrary.Logging.Database ----> ?
like image 674
simpleorchid Avatar asked Dec 31 '22 03:12

simpleorchid


1 Answers

From Wiki:

The Microsoft Enterprise Library is a set of tools and programming libraries for the Microsoft .NET Framework. It provides APIs to facilitate proven practices in core areas of programming including data access, logging, exception handling and others. Enterprise Library is provided as pluggable binaries and source code, which can be freely used and customized by developers for their own purposes. It also ships with test cases and quickstarts.

So times have changed and there is no one-to-one solution for each of the above dlls. There are plenty of ways to tackle each individual area and that is the main reason that the Enterprise library is not maintained. It was a great one-fit solution back in the day, but it can't keep up with the versatile needs of the modern world.

Caching is the easiest in terms of .net items. Though I would suggest that you look for distributed caching solutions that will span web-servers and applications (not a one way solution). Microsoft.Practices.EnterpriseLibrary.Caching -> System runtime caching

Microsoft.Practices.EnterpriseLibrary.Logging -> Depends on the framework.

For example in .Net Core Net Core logging. In standard .Net we recently moved to NLog for dot net and we are using it for both EventViewer entries and application insights. There are plenty of versatile tools out there to choose from.

Microsoft.Practices.EnterpriseLibrary.ExceptionHandling -> Depends on the implementation

In a WebApi Implementation, you can use Filters, Handlers or Middlewares to globally handle exceptions and apply policies.

In the WCF world though the EnterpriseLibrary was the main way to handle Exceptions. Things like ExceptionShielding have no real alternative other than writing your own custom code.

Microsoft.Practices.EnterpriseLibrary.Data - Required serious refactoring with one of the plenty database access apis and frameworks our there.

like image 164
Athanasios Kataras Avatar answered Jan 11 '23 03:01

Athanasios Kataras