Patterns & Practices
The Patterns & Practices team at Microsoft are a very busy bunch and it can be difficult to keep up with what they're working on. To help get the word out, Ron Jacobs, Tom Hollander, Eugenio Pace and Don Smith yesterday conducted the first of what will be quarterly "What are we up to?" webcasts.
You can now view the webcast at your leisure by visiting http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?culture=en-us&EventID=1032282437&CountryCode=US
Some nuggets of information from the webcast include the Enterprise Library 2.0 status:
- The current CTP (August) is available from http://practices.gotdotnet.com/projects/entlib
- It runs with VS2005 Beta 2, but not currently wit the later RC builds
- It is missing a few key features and is good for prototyping, but is not recommended for production purposes
- Next release slated to coincide with the November 7th VS2005 launch.
- Expected to be a feature-complete "high-quality preview" release
- Full, final release planned for one month later (early December)
Keep your eyes out for other interesting projects like the Line-of-Business Application Toolkit (expected Mid-2006) and the Web User Interface Process application block. I'm especially interested in the WUIP because it is an updated web-app-only version of the UIP block intended to address the need for web applications to support Model/View/Controller (MVC) pattern. P&P have also indicated it may be based on the Windows Workflow Foundation, recently announced at PDC.
Good stuff! Keep it coming, guys!
-Chris
As announced by Tom Hollander, the 1.1 version of Enterprise Library is available.
Tim Shakarian, involved with the original Enterprise Library (and who gave a great talk on EntLib that I blogged about last year), has posted commentary
about the recently released 1.1 version of Enterprise Library. In
particular, Tim questions the wisdom of advertising to potential users
that EntLib 1.1 "works" with Whidbey:
"The number one consequence of this release is customer
confusion over how to solve a particular problem on the platform,
something that EntLib is supposed to alleviate. Since Whidbey
deprecates a lot of EntLib's features, there can be multiple ways to
solve a given problem."
"The message from PAG should have been, "We do not recommend
Enterprise Library 1.1 for Whidbey development. We will not alter 1.1
to support Whidbey. We will release Enterprise Library 2.0 which will
provide guidance Whidbey development"."
This is of course a valid point and I agree with the spirit of what
Tim is saying. Unfortunately, to a large extent the PAG team
can't win if they do or don't on this one. Enabling support of
1.1 with Whidbey prompts the complaints such as Tim's that EntLib is
for gaps between the current framework and enterprise needs.
Those gaps are certainly different with 2.0, so why confuse users by
offering 1.x solutions for them? If they don't support 1.1 with
Whidbey, the customers who have come to rely on existing EntLib
bits will complain that they don't have the resources to switch from
their existing dependencies on EntLib 1.x to EntLib 2.0, but need to
make a platform shift to Whidbey.
As a member of the PAG's Customer Advisory Board, I do see that Tom
and company are very concerned about getting the proper
message out to the development community. However, they are also
faced with the challenge of not interfering with customers' needs to
migrate to Whidbey. They are working very hard on content and
messaging for the Whidbey timeframe and more information will be
coming.
There is a definite challenge in determining what the scope,
timeframes and intentions of EntLib should be in relation to Whidbey,
so comments like Tim's that question the status quo really do help
shape that strategy.
In fact, Tim's post prompted Darron to post his thoughts on the matter:
"Tom Hollander's 'What's the Deal' post made it
apparent to me that the group understands that the gap got smaller with
Whidbey, so they are trying to figure out the areas that the gap will
be. This is very difficult, and I don't expect them to know all. I just
think that they could have released this, and have it work with
Whidbey, but not declare it to be for Whidbey. In other words, say "for
1.1, use EntLib, for 2.0, wait for the release bits.""
Are you concerned about what choices to make moving forward to
Whidbey? Will you be taking advantage of the option to use
1.1, if only temporarily, as you migrate to Whidbey? Can you
recommend actions for PAG team to address your needs?
-Chris
As announced on the Enterprise Library workspace home, the long wait is now over. You can download the Enterprise Library (aka EntLib) 1.0 from:
http://msdn.microsoft.com/library/en-us/dnpag2/html/entlib.asp
If you haven't already heard, Enterprise Library is basically the next generation of the Application Blocks concept from the Patterns & Practices group. Microsoft and Avanade focused on integrating what used to be isolated blocks into a consistent library of features which can be used, ignored or extended as necessary in your particular environment.
You should definitely take the time to download and look through what there is to offer in this release. The package includes all of the code (and unit tests!), so even if you don't plan on using the EntLib, you could certainly gain ideas from the documentation and code for your own implementations.
-Chris
I'm pleased to announce that I am now a member of the Microsoft Patterns & Practices Customer Advisory Board.
As you hopefully know, the Patterns & Practices group has been consistently publishing great stuff - patterns, guides, reference implementations (like ERDA/Shadowfax), webcasts, application blocks, etc. And of course, the Enterprise Library (coming soon!)
The Customer Advisory Board is a group of architects and technology leaders from a diverse set of companies. We will work with the P&P team, providing feedback and offering guidance to help them set priorities.
I will enjoy working more closely with the people in PAG like Ron Jacobs and Tom Hollander to help ensure that their work continues to be relevant, useful and directly applicable to customer needs.
-Chris
As luck would have it, I happened to be at Microsoft in Redmond this week while the local user group, Dot Net Users, was hosting Avanade's Tim Shakarian. Tim gave a very interesting talk about the upcoming Enterprise Library and dove into detail on the Exception Handling Application Block. Tom Hollander (PM on the Microsoft PAG team) was also present to help answer questions.
Here is a summary of my notes from the session:
Enterprise Library
Enterprise Library (EntLib) is a redevelopment of the Application Blocks currently hosted by the Patterns & Practices team at Microsoft. The blocks are “reusable software components designed to assist developers with common enterprise development challenges.” The EntLib is not currently available to the public, as they are now available only to Avanade, Microsoft and select partners (via the Enterprise Library Partner Program.) They are setting expectations that the EntLib will be available no sooner than January. During the intervening months, Avanade is rebuilding their Avanade Connected Architecture for .NET (ACA.NET) framework upon the services of the EntLib. (Note that the two are distinct efforts - EntLib are the free/community-based/open utilities, ACA.NET is a proprietary, more fully-featured framework which Avanade will use on client projects.)
When released, they will be part of the Microsoft Patterns & Practices library, free for use and will include all of the associated unit tests (current count is 1,900+) and documentation/samples in C# and VB.NET.
There is quite a bit of documentation available at GotDotNet. As Tim happily pointed out, the workspace is so popular that you can just go to the main GotDotNet Workspaces directory page and see it there. But here is the link.
The blocks include:
- Caching - It's for, uh, caching
- Security - Authentication, authorization, basic profile management, etc.
- Data Access - SQL Server, DB2 and Oracle will be supported out of the box
- Crypto - Easy-to-use but extensible encryption
- Exception Handling - (Described in detail below)
- Logging - Used individually or by other blocks to log messages to configured targets
- Configuration - Leveraged by the other blocks (see below)
They are all fully extensible, featuring pluggable providers, replaceable block implementations and guidelines on writing new blocks.
They are designed to work together (e.g. the Exception Handling leverages Logging, Security leverages Crypto, etc.), but they can be used individually.
Tim demonstrated the use of a windows-based Enterprise Library Configuration Console, which drives all EntLib settings for an app and modifies the appropriate .config file for the application to work with the proper EntLib settings. The Console can be extended to add your own custom creations.
Two additional versions are in the pipeline for EntLib. Version 2 will include more blocks for AOP and SOA, more community participation and an expanded Partner Program. Version 3 (release to coincide with Whidbey) will ensure the EntLib is compliant will all of the new platform's recommended practices.
Exception Handling Application Block
After the overview of the EntLib, Tim spent the remainder of the session giving an overview of the Exception Handling Application Block.
Here's an example invocation:
if (ExceptionPolicy.HandleException(ex, "MyPolicy"))
throw;
That's it. The power and flexibility lie in the configuration settings.
Basically, you define one or more Exception Policies. A Policy contains one or more Exception Types (e.g. “System.ArgumentException“.) And each Type contains one or more Exception Handlers.
Exception Handlers tell the system what to do when an Exception of the designated Type is received by the Policy. There will be three Handlers shipped with V1:
- LoggingExceptionHandler
- Uses Logging Application Block, but others could be plugged in (e.g. Log4Net)
- Defaults to event log.
- WrapHandler
- Wraps the original exception with a new Exception type, as specified in configuration
- The original Exception will remain available through the InnerExeption property
- ReplaceExceptionHandler
- Drops the original Exception and places a new Exception in its place (as configured)
Handlers always execute in a configured order. Each Handler has the opportunity to take some action upon the Exception (e.g. wrapping it) and the current exception is then passed along to the next Handler in the chain.
Once the configured Handlers have executed, there is a post-handling action which you can specify as one of the following:
- RethrowAction.None - No rethrow should occur
- RethrowAction.Notify - Tells the calling application that the Policy recommends the Exception should be rethrown.
- RethrowAction.Throw - Throws the resulting Exception to the calling application after all Handlers in the chain have executed. (Again, this may or may not be the original Exception.)
This explains why the (simple) code example above is based on an expression, not a fire-and-forget metaphor used with the current Exception Management Application Block.
The Block ships with two Formatters for logging or displaying Exception details: TextExceptionFormatter and XmlExceptionFormatter. The formatters use Reflection to iterate over any members of the Exception and create and output either in Text or XML. This is very similar to what the current Exception Management Application Block does. Note that the use of Reflection helps to automatically log any custom properties of your own Exception types.
You can easily create custom Handlers. Your class simply implements the very small IExceptionHandler interface. If you wish to have your Handler read settings from the configuration, it should also implement the IConfigurationProvider interface. Tim showed an example of this and it seemed very straightforward.
Being an active user of several of the current Application Blocks, I enthusiastically look forward to working with this new suite next year. Many thanks to Tim for a great presentation. I hope Tim will consider giving a similar talk to the Boston .NET User Group should he be in the area in the coming months!
-Chris
One of the people on my team, Tim Weaver, just pointed out to me that we are now famous!*
We're both listed in the "Contributors and Reviewers" section of the newly published Improving .NET Application Performance and Scalability guide from the Microsoft Patterns & Practices group (aka the PAG team.)
I'll be expecting throngs of people waving their copies of the book - er, PDF - at me during TechEd demanding autographs.
The guide is definitely worth a read if you're concerned about scalability/performance of your .NET applications. One of my favorite chapters was 15, “Measuring .NET Application Performance” which features an excellent summary of performance counters, their meanings and critical thresholds.
Thanks to the PAG team for making such excellent content freely available.
-Chris
* Okay, not capital "F" Famous, but more of a tiny, barely perceptible fame - akin to "I'm a distant friend of the person who wrote the theme song for the 1983 television show Whiz Kids" fame.