[dba-VB] MS Patterns & Practices: Entlib 5.0 and Unity2.0 - they made it finally - that's a real

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Mon Sep 13 13:50:23 CDT 2010


Yes, Gustav,

And they have rather well elaborated

Hands-On Labs for Microsoft Enterprise Library 5.0 
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4F8CD377-5522-4F
45-A024-44A6CA5111EC 

with sources and .pdf/.xps docs, which TOC can be used as "quick-links" on
real life cases when they will be needed in programming e.g. for Logging
this hands-on labs' TOC is:

? Lab 1: Add Logging to an Application
? Lab 2: Create and Use a Custom Trace Listener
? Lab 3: Create and Use a Custom Log Formatter

-- Shamil

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Monday, September 13, 2010 10:31 PM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] MS Patterns & Practices: Entlib 5.0 and Unity2.0 -they
made it finally - that's a real

Hi Shamil

Yes, thanks, that's a good and convincing example (the logging). I better
take a closer look!

/gustav


>>> shamil at smsconsulting.spb.ru 13-09-2010 19:09 >>>
Hi Gustav --

I suppose this is the case when one has to find 58 minutes as this time
investment promise to bring big savings in long run.
MS made it this time - I suppose...
I was always quite a bit skeptical about what they were doing in that area
because they were doing that at the beginning as an experiment not as "dog
food to themselves" - and it's now used like that ("dog food for
themselves") there - so this is a real stuff for sure. And one can just
analyze what is done in the most advanced and useful Instrumentation and
Dependency Injection frameworks by today and compare with Entlib5 and Unity
2.0 - and you'll find MS didn't reinvent the wheel MS way creating yet
another "behemoth" - the opposite is true - they have made a lightweight
framework where many parts can be replaced by custom stuff if needed or used
as it's - out of the box etc.

What is also important is that the tuning of used Enterprise Library
Block(s) (e.g. Logging) can be done directly on deployment site without any
programming but by using special config editing tool or within VS using
similar tool/editor:

http://smsconsulting.spb.ru/test/entlib5.jpg

And one can start using Unity 2.0 and, say, Logging block almost immediately
- as in the sample code in P.S. of this message - not the best possible
sample code I could have made - it's just to show how easy is to start with
that advanced Entlib 5 and Unit 2.0 stuff:

- using code in P.S. and tuning of config file you'll get in the log (and
log can be set for MS Windows Event Log, Flat File, Database,...  in config
file):

Message: Test Message 1
Message: Test Message 2

Or

Timestamp: 13/09/2010 16:38:17
Message: Test Message 1
Category: General
Priority: -1
EventId: 1
Severity: Information
Title:
Machine: NANT
App Domain: ConsoleApplication1.exe
ProcessId: 2728
Process Name: G:\Samples\Microsoft Enterprise Library 5.0 - Hands On
Labs\CS\Logging\exercises\ex01\begin\ConsoleApplication1\bin\Debug\ConsoleAp
plication1.exe
Thread Name: 
Win32 ThreadId:3012
Extended Properties:
...

Thank you.

-- Shamil

<<< snip >>>




More information about the dba-VB mailing list