可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
In my shop we currently develop what I would consider small to medium sized projects. We have been investigating the Enterprise Library and how it may be able to help us in development. I have particularly been looking at the Logging block and comparing it with Log4Net. It seems to me that the Enterprise Library blocks would be an extremely over-engineered solution for something like simple application logging.
That being said. Are you using the Enterprise Library and on what size projects? What are your thoughts on the Enterprise Library as a whole?
Thanks
回答1:
It's my opinion that the enterprise library is over engineered for most things. No, we don't use it, but most of our projects are short term high volume web sites of a promotional nature.
回答2:
+1 for over-engineered. We use log4net instead of the logging or exception handling blocks. We use the native .NET System.Security namespace instead of entlib encryption blocks. Some of the tracing tools are nice, but we don't have anything in production that uses them.
回答3:
No, we do not use it. In fact I am a big opponent of the Enterprise Library blocks because I have seen too many backward compatability problems with new releases of the blocks.
回答4:
We use it (specifically, Unity, Logging and Validation), and I can't say I'm a big fan of it.
The logging block is definitely over-engineered, and ironically still lacks a lot of flexibility. I was amazed at how much code I had to rip out and replace if I wanted to write more structured logging messages to a DB rather than just a single table with generic messages. The documentation is sketchy, and it's really hard to follow what actually happens in your logger.
Unity actually works ok though. Personally, I'd rather avoid DI containers entirely, but if you have to use one, Unity seems fine.
I haven't really been involved in the code that uses the Validation block, so I can't tell you how that works out.
But in general, I'd say that yes, it is overengineered, and unless it does exactly what you need out of the box, you're probably better off without it.
回答5:
Enterprise Library is an overkill. It is too complex and inflexible. So we don't use.
In our projects (including those that target distributed computation scenarios over Windows Azure) we use Lokad Shared Libraries as a lightweight replacement. It plugs to log4net for logging, Autofac IoC for configuration, provides custom business rules, validation and exception handling (with reliability) application blocks, while packing all the required assemblies in a few dll files.
回答6:
I like the old Application Data Block that was separate from Enterprise Library. It's very simple and saves you a lot of time. We tried moving to the Enterprise block but it wasn't worth the heft.
We use log4Net for logging and that works ok.
回答7:
I like using it, ESPECIALLY for small projects, because it's a "I don't care, this stuff simply works and provides everything I need without hassles".
Overengineered? How so?
回答8:
it is all said in the name I believe.. "Enterprise Library"
Enterprise being significantly big (Yes I know, great defintion... but hey I am tipsy at the moment!)
回答9:
I have been using it for some time, but now I've turned to more agile and simple solutions, such as log4net for logging, EF or Linq2sql for data access and so on.
回答10:
Having worked on a number of med-large web projects I can recommend the caching block from ent library as it allows you to use nCache or similar with a simple config change. This allows the dev team to use TDD without the need for nCache (or similar) to be installed everywhere.
Log4Net is far superior to the ent lib logging block IMHO.
Security / Crytography blocks I have used a few times and generally find that they do what they say on the tin without being too onerous or complicated.
The rest of the framework is beaten hands down by other simpler and (IMHO) better solutions
Data access - nHibernate, ActiveRecord, Tarantino
Unity - windsor, spring etc
Validation - I use the castle stack