Wapper around EntLib

Topics: Enterprise Library Core
Aug 25 at 9:49 AM
Hi,
structure of the simple wrapper for EntLib is the main question, what are the essentials?
Editor
Aug 27 at 3:36 AM
Are you talking about wrapping Enterprise Library behind your own facade interface/classes? In general, I would recommend against spending effort doing that. Enterprise Library is fairly large so you would spend a lot of effort trying to hide the details.

If you are thinking about wrapping the Logging Application Block then Common.Logging might be worth a look -- it provides a log4net type interface with various adapters for different logging implementations.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Aug 28 at 11:36 AM
Thanks for the reply.
Yeah, mostly about the Logging application block (wrapper to crate factory, initialize, configure (event log), and writing methods)?
Any sample implementation?
Editor
Aug 29 at 6:50 AM
I would say that since you want to wrap the Logging Application Block then you must have some requirements in mind on what API you want to expose through your wrapper. So, in that sense, how you wrap the block is up to you. If you are intent on wrapping the block then, as I mentioned, I would recommend using Common.Logging (you can read about it here) since it will let you switch between different logging approaches (NLog, log4net, etc.) without changing any code and save you from. (Usually, that is one major reason for wrapping a logging implementation.)

You could create your own Logger class that returned a Common.Logging.ILog instance based on configuration or some sensible defaults.

My unsolicited opinion is that logging is important but the less time you spend on it the more time you have to create the application functionality.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to