Microsoft.Practices.EnterpriseLibrary 的替代品。*
Alternatives to Microsoft.Practices.EnterpriseLibrary.*
我有一个项目是老开发者交给我的,需要升级。查看所有参考库(在 .Net C# 中)。我看到 Microsoft.Practices.EnterpriseLibrary.* 的集合正在使用中。
从他们的 Microsoft.Practices.EnterpriseLibrary 网站上,我看到它没有维护或更新,似乎已被淘汰/将在不久的将来删除。
我正在寻找以下库的替代品。请告知可用的最佳库是什么。
- Microsoft.Practices.EnterpriseLibrary. 缓存 ----> ?
- Microsoft.Practices.EnterpriseLibrary.常用----> ?
- Microsoft.Practices.EnterpriseLibrary.Common.Configuration ------> ?
- Microsoft.Practices.EnterpriseLibrary.数据 ------> ?
- Microsoft.Practices.EnterpriseLibrary.异常处理----> ?
- Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging ----> ?
- Microsoft.Practices.EnterpriseLibrary. 记录 ----> ?
- Microsoft.Practices.EnterpriseLibrary.Logging.Database ----> ?
来自维基:
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.
所以时代变了,上面的每个dll都没有一对一的解决方案。有很多方法可以解决每个单独的领域,这是企业库没有得到维护的主要原因。这在当时是一个很好的一体化解决方案,但它跟不上现代世界的多样化需求。
就 .net 项目而言,缓存是最简单的。尽管我建议您寻找将跨越 Web 服务器和应用程序的分布式缓存解决方案(不是单向解决方案)。
Microsoft.Practices.EnterpriseLibrary.Caching
-> System runtime caching
Microsoft.Practices.EnterpriseLibrary.Logging
-> 取决于框架。
例如.Net Core Net Core logging。在标准 .Net 中,我们最近为 dot net 迁移到了 NLog,我们将其用于 EventViewer 条目和应用程序洞察。有很多通用工具可供选择。
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
-> 取决于实现
在 WebApi 实现中,您可以使用 Filters
、Handlers
或 Middlewares
全局处理异常并应用策略。
在 WCF 世界中,尽管 EnterpriseLibrary 是处理异常的主要方式。 ExceptionShielding
除了编写您自己的自定义代码之外别无选择。
Microsoft.Practices.EnterpriseLibrary.Data
- 需要使用大量数据库访问 API 和框架之一进行认真的重构。
我有一个项目是老开发者交给我的,需要升级。查看所有参考库(在 .Net C# 中)。我看到 Microsoft.Practices.EnterpriseLibrary.* 的集合正在使用中。
从他们的 Microsoft.Practices.EnterpriseLibrary 网站上,我看到它没有维护或更新,似乎已被淘汰/将在不久的将来删除。
我正在寻找以下库的替代品。请告知可用的最佳库是什么。
- Microsoft.Practices.EnterpriseLibrary. 缓存 ----> ?
- Microsoft.Practices.EnterpriseLibrary.常用----> ?
- Microsoft.Practices.EnterpriseLibrary.Common.Configuration ------> ?
- Microsoft.Practices.EnterpriseLibrary.数据 ------> ?
- Microsoft.Practices.EnterpriseLibrary.异常处理----> ?
- Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging ----> ?
- Microsoft.Practices.EnterpriseLibrary. 记录 ----> ?
- Microsoft.Practices.EnterpriseLibrary.Logging.Database ----> ?
来自维基:
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.
所以时代变了,上面的每个dll都没有一对一的解决方案。有很多方法可以解决每个单独的领域,这是企业库没有得到维护的主要原因。这在当时是一个很好的一体化解决方案,但它跟不上现代世界的多样化需求。
就 .net 项目而言,缓存是最简单的。尽管我建议您寻找将跨越 Web 服务器和应用程序的分布式缓存解决方案(不是单向解决方案)。
Microsoft.Practices.EnterpriseLibrary.Caching
-> System runtime caching
Microsoft.Practices.EnterpriseLibrary.Logging
-> 取决于框架。
例如.Net Core Net Core logging。在标准 .Net 中,我们最近为 dot net 迁移到了 NLog,我们将其用于 EventViewer 条目和应用程序洞察。有很多通用工具可供选择。
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
-> 取决于实现
在 WebApi 实现中,您可以使用 Filters
、Handlers
或 Middlewares
全局处理异常并应用策略。
在 WCF 世界中,尽管 EnterpriseLibrary 是处理异常的主要方式。 ExceptionShielding
除了编写您自己的自定义代码之外别无选择。
Microsoft.Practices.EnterpriseLibrary.Data
- 需要使用大量数据库访问 API 和框架之一进行认真的重构。