<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>LifeCycle Solutions, LLC - Weblog - Patterns and Practices</title>
    <link>http://blog.lifecycle-solutions.com/</link>
    <description>Technical Writing</description>
    <language>en-us</language>
    <copyright>LifeCycle Solutions, LLC</copyright>
    <lastBuildDate>Thu, 14 Feb 2008 18:36:31 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>info@lifecycle-solutions.com</managingEditor>
    <webMaster>info@lifecycle-solutions.com</webMaster>
    <item>
      <trackback:ping>http://blog.lifecycle-solutions.com/Trackback.aspx?guid=c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0</trackback:ping>
      <pingback:server>http://blog.lifecycle-solutions.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.lifecycle-solutions.com/PermaLink,guid,c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0.aspx</pingback:target>
      <dc:creator>Yohan Pamudji</dc:creator>
      <wfw:comment>http://blog.lifecycle-solutions.com/CommentView,guid,c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0.aspx</wfw:comment>
      <wfw:commentRss>http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
For one of our clients, I've been working on converting printed forms into web forms,
and in the process have been dealing with a lot of tables that need to fit within
a fixed width.  These tables are in a FormView in a User Control, which are
then placed on webpages as needed.  I was finding that Visual Studio 2008's
design mode was happy enough to accept my fixed-width columns and tables settings
in my CSS stylesheet when working on the User Control, but once that User Control
is placed on an actual page the fixed-width settings are no longer respected in both
design mode and in debug mode displayed through a browser.  What to do? 
After much frustration I found the embarrasingly simple answer: I wasn't putting "px"
at the end of pixel measurements for table/column widths.  For whatever reason
the Visual Studio 2008 FormView designer was content without the "px" but nothing
else was.  In my rush to get things working I was leaving off the "px" figuring
that I could go back later and add them on after the fact.  So lesson learned:
be standards compliant, even if your development tool of choice lets you get away
with not being standards compliant.
</p>
        <p>
Still on the topic of fixed-width tables and columns, have you ever wanted to figure
out exactly how many pixels wide/tall something is on a webpage, be it a table row,
table column, header graphic, etc.?  Enter <a href="http://www.mioplanet.com/products/pixelruler/index.htm">Pixel
Ruler</a>--a free app that displays a rotatable ruler on your screen and even tracks
your mouse cursor and keeps a running measurement of how many pixels away you are
from the zero mark on the ruler (in one dimension of course--it doesn't do diagonal
measurements).  This app will save me countless hours of eyeballing and hoping
for the best, instead providing me with precise measurements to the pixel.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0" />
      </body>
      <title>Having trouble with fixed-width tables?  Two helpful hints.</title>
      <guid isPermaLink="false">http://blog.lifecycle-solutions.com/PermaLink,guid,c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0.aspx</guid>
      <link>http://blog.lifecycle-solutions.com/2008/02/14/HavingTroubleWithFixedwidthTablesTwoHelpfulHints.aspx</link>
      <pubDate>Thu, 14 Feb 2008 18:36:31 GMT</pubDate>
      <description>&lt;p&gt;
For one of our clients, I've been working on converting printed forms into web forms,
and in the process have been dealing with a lot of tables that need to fit within
a fixed width.&amp;nbsp; These tables are in a FormView in a User Control, which&amp;nbsp;are
then placed&amp;nbsp;on webpages as needed.&amp;nbsp; I was finding that Visual Studio 2008's
design mode was happy enough to accept my fixed-width columns and tables settings
in my CSS stylesheet when working on the User Control, but once that User Control
is placed on an actual page the fixed-width settings are no longer respected in both
design mode and in debug mode displayed through a browser.&amp;nbsp; What to do?&amp;nbsp;
After much frustration I found the embarrasingly simple answer: I wasn't putting "px"
at the end of pixel measurements for table/column widths.&amp;nbsp; For whatever reason
the Visual Studio 2008 FormView designer was content without the "px" but nothing
else was.&amp;nbsp; In my rush to get things working I was leaving off the "px" figuring
that I could go back later and add them on after the fact.&amp;nbsp; So lesson learned:
be standards compliant, even if your development tool of choice lets you get away
with not being standards compliant.
&lt;/p&gt;
&lt;p&gt;
Still on the topic of fixed-width tables and columns, have you ever wanted to figure
out exactly how many pixels wide/tall something is on a webpage, be it a table row,
table column, header graphic, etc.?&amp;nbsp; Enter &lt;a href="http://www.mioplanet.com/products/pixelruler/index.htm"&gt;Pixel
Ruler&lt;/a&gt;--a free app that displays a rotatable ruler on your screen and even tracks
your mouse cursor and keeps a running measurement of how many pixels away you are
from the zero mark on the ruler (in one dimension of course--it doesn't do diagonal
measurements).&amp;nbsp; This app will save me countless hours of eyeballing and hoping
for the best, instead providing me with precise measurements to the pixel.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0" /&gt;</description>
      <comments>http://blog.lifecycle-solutions.com/CommentView,guid,c2a3cfa6-65b1-41bd-ad00-c928e9d55ec0.aspx</comments>
      <category>Patterns and Practices</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://blog.lifecycle-solutions.com/Trackback.aspx?guid=edf487ce-f3ce-4ba0-b455-764241eb2653</trackback:ping>
      <pingback:server>http://blog.lifecycle-solutions.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.lifecycle-solutions.com/PermaLink,guid,edf487ce-f3ce-4ba0-b455-764241eb2653.aspx</pingback:target>
      <dc:creator>Brian Parks</dc:creator>
      <wfw:comment>http://blog.lifecycle-solutions.com/CommentView,guid,edf487ce-f3ce-4ba0-b455-764241eb2653.aspx</wfw:comment>
      <wfw:commentRss>http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetEntryCommentsRss?guid=edf487ce-f3ce-4ba0-b455-764241eb2653</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The Patterns &amp; Practices team at Microsoft recently released the 3.0 version of
the ever-useful <a href="http://www.microsoft.com/downloads/details.aspx?familyid=62ef5f79-daf2-43af-9897-d926f03b9e60&amp;displaylang=en">Enterprise
Library.</a>  Among the changes in the current iteration of the library is the
addition of a new application block - the Policy Injection Application Block ("PIAB").
</p>
        <p>
The purpose of the PIAB is to provide developers a way to define "policies" that can
be applied selectively throughout an application.  Imagine that you're building
a human resources application and one of the requirements is that the application
provide an audit trail for all changes made to an employee's personnel record. 
The PIAB allows you to define this requirement as a "policy" and configure its behavior
external to your application.
</p>
        <p>
Here's how it works:
</p>
        <ul>
          <li>
Using the Enterprise Library Configuration tool, you define a policy (in this case
we'll name it "Audit Policy") 
</li>
          <li>
Each policy can have any number of associated "matching rules"; these rules define
how/when the policy is applied.  The PIAB provides the following rules out-of-the-box: 
<ul><li>
Assembly Matching Rule 
</li><li>
Custom Attribute Matching Rule 
</li><li>
Member Name Matching Rule 
</li><li>
Method Signature Matching Rule 
</li><li>
Namespace Matching Rule 
</li><li>
Parameter Type Matching Rule 
</li><li>
Property Matching Rule 
</li><li>
Return Type Matching Rule 
</li><li><strong>Tag Attribute Matching Rule</strong></li><li>
Type Matching Rule</li></ul></li>
          <li>
Each policy can also have any number of "handlers"; handlers determine what happens
when a policy is executed.  The PIAB provides the following handlers, which utilize
other Enterprise Library application blocks, out-of-the-box: 
<ul><li>
Authorization Handler 
</li><li>
Caching Handler 
</li><li>
Exception Handling Handler 
</li><li><strong>Logging Handler</strong></li><li>
Performance Counters Handler 
</li><li>
Validation Handler</li></ul></li>
          <li>
In our HR application example, we'll elect to use a "Tag Attribute Matching Rule"
that allows us to mark methods in our business tier classes as requiring audit functionality;
in addition, we'll choose to apply the Enterprise Library's Logging Application Block
as our policy's handler.<br /><br />
 The resulting XML in our application's configuration file looks like this (the
Logging Application Block section has been omitted for brevity):<br /></li>
        </ul>
        <p>
          <font face="Courier New" size="1">&lt;policyInjection&gt;<br />
&lt;policies&gt;<br />
&lt;add name="AuditPolicy"&gt;<br />
&lt;matchingRules&gt;<br />
&lt;add match="Audit" ignoreCase="false" <br /></font>
          <font face="Courier New" size="1">  type=<br />
  "Microsoft.Practices.EnterpriseLibrary.PolicyInjection.MatchingRules.TagAttributeMatchingRule, 
<br />
  Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=3.0.0.0, 
<br />
  Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"<br />
  name="Tag Attribute Matching Rule" /&gt;<br />
&lt;/matchingRules&gt;<br />
&lt;handlers&gt;<br />
&lt;add logBehavior="After" beforeMessage="" afterMessage="" eventId="0"<br />
  includeParameterValues="true" includeCallStack="false" includeCallTime="true"<br />
  priority="-1" severity="Information" 
<br />
  type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.LogCallHandler, 
<br />
  Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers, 
<br />
  Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"<br />
  name="Logging Handler"&gt;<br />
&lt;categories&gt;<br />
&lt;add name="General" /&gt;<br />
&lt;/categories&gt;<br />
&lt;/add&gt;<br />
&lt;/handlers&gt;<br />
&lt;/add&gt;<br />
&lt;/policies&gt;<br />
&lt;/policyInjection&gt;</font>
        </p>
        <p>
          <br />
        </p>
        <ul>
          <li>
In our application, we're going to mark each method that requires an audit trail with
a "Tag" attribute...notice that "Audit" corresponds to our matching rule defined above:<br /><div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:00315cfe-0034-4949-870e-9229c8fd4c8f" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #000000"></span><span style="COLOR: #808080">///</span><span style="COLOR: #008000"></span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000"></span><span style="COLOR: #808080">///</span><span style="COLOR: #008000"> Note:
class must inherit MarshalByRefObject </span><span style="COLOR: #808080">///</span><span style="COLOR: #008000"> for
use with the PIAB </span><span style="COLOR: #808080">///</span><span style="COLOR: #008000"></span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #808080"></span><span style="COLOR: #000000"></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Employee
: MarshalByRefObject { [Tag(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Audit</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)] </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> Save()
{ </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">write
employee to data store</span><span style="COLOR: #008000"></span><span style="COLOR: #000000"> }
[Tag(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Audit</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)] </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> Delete()
{ </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">remove
employee from data store</span><span style="COLOR: #008000"></span><span style="COLOR: #000000"> }
}</span></div></pre></div></li>
          <li>
The "policy injection magic" performed by the PIAB will occur as a result
of the way we create an instance of our Employee class: <br /><br /><div class="wlWriterSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:739bcc93-e779-4b7d-a42a-7317bd2df50c" contenteditable="false" style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 406px; PADDING-TOP: 0px"><pre style="BACKGROUND-COLOR: white"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="COLOR: #000000">Employee
ourEmployee </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> PolicyInjection.Create</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">Employee</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">();
ourEmployee.Save();</span></div></pre></div><br />
The Create() factory method actually builds and returns a "proxy class" -- in this
example, the proxy class intercepts our call to the Save() method, evaluates the matching
criteria and determines that the handler should be executed because of the "Audit"
tag match.  The result in this case is that an entry is written to the Windows
event log as defined by our Logging Application Block configuration.<br /></li>
        </ul>
        <p>
The "policy injection" pattern is worth a look if you have common functionality that
needs to be applied throughout your application, and you want to do so in a declarative,
transparent way.
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=edf487ce-f3ce-4ba0-b455-764241eb2653" />
      </body>
      <title>The Policy Injection Application Block</title>
      <guid isPermaLink="false">http://blog.lifecycle-solutions.com/PermaLink,guid,edf487ce-f3ce-4ba0-b455-764241eb2653.aspx</guid>
      <link>http://blog.lifecycle-solutions.com/2007/04/14/ThePolicyInjectionApplicationBlock.aspx</link>
      <pubDate>Sat, 14 Apr 2007 23:30:02 GMT</pubDate>
      <description>&lt;p&gt;
The Patterns &amp;amp; Practices team at Microsoft recently released the 3.0 version of
the ever-useful &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=62ef5f79-daf2-43af-9897-d926f03b9e60&amp;amp;displaylang=en"&gt;Enterprise
Library.&lt;/a&gt;&amp;nbsp; Among the changes in the current iteration of the library is the
addition of a new application block - the Policy Injection Application Block ("PIAB").
&lt;/p&gt;
&lt;p&gt;
The purpose of the PIAB is to provide developers a way to define "policies" that can
be applied selectively throughout&amp;nbsp;an application.&amp;nbsp; Imagine that you're building
a human resources application and one of the requirements is that the application
provide an audit trail for all changes made to an employee's personnel record.&amp;nbsp;
The PIAB allows you to define this requirement as a "policy" and configure its behavior
external to your application.
&lt;/p&gt;
&lt;p&gt;
Here's how it works:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Using the Enterprise Library Configuration tool, you define a policy (in this case
we'll&amp;nbsp;name it "Audit Policy") 
&lt;li&gt;
Each policy can have any number of associated "matching rules"; these rules define
how/when the policy is applied.&amp;nbsp; The PIAB provides the following rules out-of-the-box: 
&lt;ul&gt;
&lt;li&gt;
Assembly Matching Rule 
&lt;li&gt;
Custom Attribute Matching Rule 
&lt;li&gt;
Member Name Matching Rule 
&lt;li&gt;
Method Signature Matching Rule 
&lt;li&gt;
Namespace Matching Rule 
&lt;li&gt;
Parameter Type Matching Rule 
&lt;li&gt;
Property Matching Rule 
&lt;li&gt;
Return Type Matching Rule 
&lt;li&gt;
&lt;strong&gt;Tag Attribute Matching Rule&lt;/strong&gt; 
&lt;li&gt;
Type Matching Rule&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
Each policy can also have any number of "handlers"; handlers determine what happens
when a policy is executed.&amp;nbsp; The PIAB provides the following handlers, which utilize
other&amp;nbsp;Enterprise Library&amp;nbsp;application blocks, out-of-the-box: 
&lt;ul&gt;
&lt;li&gt;
Authorization Handler 
&lt;li&gt;
Caching Handler 
&lt;li&gt;
Exception Handling Handler 
&lt;li&gt;
&lt;strong&gt;Logging Handler&lt;/strong&gt; 
&lt;li&gt;
Performance Counters Handler 
&lt;li&gt;
Validation Handler&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;
In our HR application example, we'll elect to use a "Tag Attribute Matching Rule"
that allows us to mark methods in our business tier classes as requiring audit functionality;
in addition, we'll choose to apply the Enterprise Library's Logging Application Block
as our policy's handler.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;The resulting XML in our application's configuration file looks like this (the
Logging Application Block section has been&amp;nbsp;omitted for brevity):&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="Courier New" size=1&gt;&amp;lt;policyInjection&amp;gt;&lt;br&gt;
&amp;lt;policies&amp;gt;&lt;br&gt;
&amp;lt;add name="AuditPolicy"&amp;gt;&lt;br&gt;
&amp;lt;matchingRules&amp;gt;&lt;br&gt;
&amp;lt;add match="Audit" ignoreCase="false"&amp;nbsp;&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New" size=1&gt;&amp;nbsp; type=&lt;br&gt;
&amp;nbsp; "Microsoft.Practices.EnterpriseLibrary.PolicyInjection.MatchingRules.TagAttributeMatchingRule, 
&lt;br&gt;
&amp;nbsp; Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=3.0.0.0, 
&lt;br&gt;
&amp;nbsp; Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br&gt;
&amp;nbsp; name="Tag Attribute Matching Rule" /&amp;gt;&lt;br&gt;
&amp;lt;/matchingRules&amp;gt;&lt;br&gt;
&amp;lt;handlers&amp;gt;&lt;br&gt;
&amp;lt;add logBehavior="After" beforeMessage="" afterMessage="" eventId="0"&lt;br&gt;
&amp;nbsp; includeParameterValues="true" includeCallStack="false" includeCallTime="true"&lt;br&gt;
&amp;nbsp; priority="-1" severity="Information" 
&lt;br&gt;
&amp;nbsp; type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.LogCallHandler, 
&lt;br&gt;
&amp;nbsp; Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers, 
&lt;br&gt;
&amp;nbsp; Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br&gt;
&amp;nbsp; name="Logging Handler"&amp;gt;&lt;br&gt;
&amp;lt;categories&amp;gt;&lt;br&gt;
&amp;lt;add name="General" /&amp;gt;&lt;br&gt;
&amp;lt;/categories&amp;gt;&lt;br&gt;
&amp;lt;/add&amp;gt;&lt;br&gt;
&amp;lt;/handlers&amp;gt;&lt;br&gt;
&amp;lt;/add&amp;gt;&lt;br&gt;
&amp;lt;/policies&amp;gt;&lt;br&gt;
&amp;lt;/policyInjection&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
In our application, we're going to mark each method that requires an audit trail with
a "Tag" attribute...notice that "Audit" corresponds to our matching rule defined above:&lt;br&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:00315cfe-0034-4949-870e-9229c8fd4c8f contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #808080"&gt;///&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; &lt;/span&gt;&lt;span style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; &lt;/span&gt;&lt;span style="COLOR: #808080"&gt;///&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Note:
class must inherit MarshalByRefObject &lt;/span&gt;&lt;span style="COLOR: #808080"&gt;///&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; for
use with the PIAB &lt;/span&gt;&lt;span style="COLOR: #808080"&gt;///&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; &lt;/span&gt;&lt;span style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #808080"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;class&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Employee
: MarshalByRefObject { [Tag(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Audit&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)] &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Save()
{ &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;write
employee to data store&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; }
[Tag(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Audit&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;)] &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Delete()
{ &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;remove
employee from data store&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; &lt;/span&gt;&lt;span style="COLOR: #000000"&gt; }
}&lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;li&gt;
The "policy injection magic" performed by the PIAB&amp;nbsp;will occur as a&amp;nbsp;result
of the way we create an instance of our Employee class:&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&lt;div class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:739bcc93-e779-4b7d-a42a-7317bd2df50c contenteditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; WIDTH: 406px; PADDING-TOP: 0px"&gt;&lt;pre style="BACKGROUND-COLOR: white"&gt;
&lt;div&gt;
&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="COLOR: #000000"&gt;Employee
ourEmployee &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; PolicyInjection.Create&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;Employee&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;();
ourEmployee.Save();&lt;/span&gt;
&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br&gt;
The Create() factory method actually builds and returns a "proxy class" -- in this
example, the proxy class intercepts our call to the Save() method, evaluates the matching
criteria and determines that the handler should be executed because of the "Audit"
tag match.&amp;nbsp; The result in this case is that an entry is written to the Windows
event log as defined by our Logging Application Block configuration.&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The "policy injection" pattern is worth a look if you have common functionality that
needs to be applied throughout your application, and you want to do so in a declarative,
transparent way.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=edf487ce-f3ce-4ba0-b455-764241eb2653" /&gt;</description>
      <comments>http://blog.lifecycle-solutions.com/CommentView,guid,edf487ce-f3ce-4ba0-b455-764241eb2653.aspx</comments>
      <category>Patterns and Practices</category>
    </item>
    <item>
      <trackback:ping>http://blog.lifecycle-solutions.com/Trackback.aspx?guid=1361aace-70fe-4499-a78e-b9d2b67eb582</trackback:ping>
      <pingback:server>http://blog.lifecycle-solutions.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.lifecycle-solutions.com/PermaLink,guid,1361aace-70fe-4499-a78e-b9d2b67eb582.aspx</pingback:target>
      <dc:creator>Daniel Root</dc:creator>
      <wfw:comment>http://blog.lifecycle-solutions.com/CommentView,guid,1361aace-70fe-4499-a78e-b9d2b67eb582.aspx</wfw:comment>
      <wfw:commentRss>http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetEntryCommentsRss?guid=1361aace-70fe-4499-a78e-b9d2b67eb582</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the slides from <a href="http://weblogs.asp.net/scottgu/archive/2007/03/30/slides-from-my-asp-net-connections-talks-wpf-e-linq-and-asp-net-tips-tricks.aspx">Scott
Guthrie's 'ASP.NET Tips and Tricks' TechEd Presentation</a>, I ran across this gem. 
You can turn off debugging server-wide by adding the following to &lt;system.web&gt;
section in the server's machine.config file (typically located in C:\windows\Microsoft.NET\Framework\v&lt;version&gt;\Config):<br /><br />
       &lt;deployment retail="true"/&gt;
</p>
        <p>
This is a great backup in case developers forget to turn it off in the application
using &lt;compilation debug="false"/&gt;.  Scott also mentions a few of the negative
results of forgetting this little setting:
</p>
        <ul>
          <li>
Slower performance due to debug code</li>
          <li>
App uses much more memory</li>
          <li>
Client-side scripts are not cached</li>
        </ul>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=1361aace-70fe-4499-a78e-b9d2b67eb582" />
      </body>
      <title>How To: Disable deployment debug=true for entire server</title>
      <guid isPermaLink="false">http://blog.lifecycle-solutions.com/PermaLink,guid,1361aace-70fe-4499-a78e-b9d2b67eb582.aspx</guid>
      <link>http://blog.lifecycle-solutions.com/2007/04/02/HowToDisableDeploymentDebugtrueForEntireServer.aspx</link>
      <pubDate>Mon, 02 Apr 2007 14:09:25 GMT</pubDate>
      <description>&lt;p&gt;
In the slides from &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/03/30/slides-from-my-asp-net-connections-talks-wpf-e-linq-and-asp-net-tips-tricks.aspx"&gt;Scott
Guthrie's 'ASP.NET Tips and Tricks' TechEd Presentation&lt;/a&gt;, I ran across this gem.&amp;nbsp;
You can turn off debugging server-wide by adding the following to &amp;lt;system.web&amp;gt;
section in the server's machine.config file (typically located in C:\windows\Microsoft.NET\Framework\v&amp;lt;version&amp;gt;\Config):&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;deployment retail="true"/&amp;gt;
&lt;/p&gt;
&lt;p&gt;
This is a&amp;nbsp;great backup in case developers forget to turn it off in the application
using &amp;lt;compilation debug="false"/&amp;gt;.&amp;nbsp; Scott also mentions a few of the negative
results of forgetting this little setting:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Slower performance due to debug code&lt;/li&gt;
&lt;li&gt;
App uses much more memory&lt;/li&gt;
&lt;li&gt;
Client-side scripts are not cached&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=1361aace-70fe-4499-a78e-b9d2b67eb582" /&gt;</description>
      <comments>http://blog.lifecycle-solutions.com/CommentView,guid,1361aace-70fe-4499-a78e-b9d2b67eb582.aspx</comments>
      <category>ASP.NET</category>
      <category>Patterns and Practices</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://blog.lifecycle-solutions.com/Trackback.aspx?guid=5589150e-e518-45ff-a0a3-b74e8ddba757</trackback:ping>
      <pingback:server>http://blog.lifecycle-solutions.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.lifecycle-solutions.com/PermaLink,guid,5589150e-e518-45ff-a0a3-b74e8ddba757.aspx</pingback:target>
      <dc:creator>Daniel Root</dc:creator>
      <wfw:comment>http://blog.lifecycle-solutions.com/CommentView,guid,5589150e-e518-45ff-a0a3-b74e8ddba757.aspx</wfw:comment>
      <wfw:commentRss>http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetEntryCommentsRss?guid=5589150e-e518-45ff-a0a3-b74e8ddba757</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img style="FLOAT: right; MARGIN: 1em" src="http://blog.lifecycle-solutions.com/content/binary/ReflectorScreenshot.png" border="0" />
        <p>
One of the most useful tools for .NET development is <a href="http://www.aisto.com/roeder/dotnet/">Lutz
Roeder's .NET Reflector</a>, now in version 5.  It uses reflection to peek inside
.NET assemblies and disassembles the IL back into C# or VB code for those times that
you need an in-depth look into <em>any</em> .NET library.  Ever wonder what
the code for System.String looked like? This release adds some really nice
features:
</p>
        <ul>
          <li>
Formatted code comments- doubles as a documentation browser for XML code-commented
members 
</li>
          <li>
'Expand members' in disassembler lets you see code for an entire class at once-
previously you had to look at each method separately. 
</li>
          <li>
New analyzer features shows where classes are instantiated and exposed. 
</li>
          <li>
Search Google or MSDN for a member</li>
        </ul>
        <p>
In addition to helping you debug code, this is also a great learning tool.  What
better way to understand framework development than to peek inside The Framework itself?
</p>
        <p>
 
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=5589150e-e518-45ff-a0a3-b74e8ddba757" />
      </body>
      <title>Essential Tool: Lutz Roeder's .NET Reflector v5</title>
      <guid isPermaLink="false">http://blog.lifecycle-solutions.com/PermaLink,guid,5589150e-e518-45ff-a0a3-b74e8ddba757.aspx</guid>
      <link>http://blog.lifecycle-solutions.com/2007/02/20/EssentialToolLutzRoedersNETReflectorV5.aspx</link>
      <pubDate>Tue, 20 Feb 2007 14:49:16 GMT</pubDate>
      <description>&lt;img style="FLOAT: right; MARGIN: 1em" src="http://blog.lifecycle-solutions.com/content/binary/ReflectorScreenshot.png" border=0&gt; 
&lt;p&gt;
One of the most useful tools for .NET development is&amp;nbsp;&lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;Lutz
Roeder's .NET Reflector&lt;/a&gt;, now in version 5.&amp;nbsp; It uses reflection to peek inside
.NET assemblies and disassembles the IL back into C# or VB code for those times that
you need an in-depth look into &lt;em&gt;any&lt;/em&gt;&amp;nbsp;.NET library.&amp;nbsp; Ever wonder&amp;nbsp;what
the code for System.String looked like?&amp;nbsp;This&amp;nbsp;release adds some really&amp;nbsp;nice
features:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Formatted code comments- doubles as a documentation browser for XML code-commented
members 
&lt;li&gt;
'Expand members' in disassembler lets you see code for&amp;nbsp;an entire class at once-
previously you had to look at each method separately. 
&lt;li&gt;
New analyzer features shows where classes are instantiated and exposed. 
&lt;li&gt;
Search Google or MSDN for a member&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
In addition to helping you debug code, this is also a great learning tool.&amp;nbsp; What
better way to understand framework development than to peek inside The Framework itself?
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=5589150e-e518-45ff-a0a3-b74e8ddba757" /&gt;</description>
      <comments>http://blog.lifecycle-solutions.com/CommentView,guid,5589150e-e518-45ff-a0a3-b74e8ddba757.aspx</comments>
      <category>ASP.NET</category>
      <category>C#</category>
      <category>Documentation</category>
      <category>Patterns and Practices</category>
      <category>Training</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://blog.lifecycle-solutions.com/Trackback.aspx?guid=e0abb29b-997d-4b06-be56-7af26676d63d</trackback:ping>
      <pingback:server>http://blog.lifecycle-solutions.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.lifecycle-solutions.com/PermaLink,guid,e0abb29b-997d-4b06-be56-7af26676d63d.aspx</pingback:target>
      <dc:creator>Daniel Root</dc:creator>
      <wfw:comment>http://blog.lifecycle-solutions.com/CommentView,guid,e0abb29b-997d-4b06-be56-7af26676d63d.aspx</wfw:comment>
      <wfw:commentRss>http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetEntryCommentsRss?guid=e0abb29b-997d-4b06-be56-7af26676d63d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ever wondered what a secure ASP.NET 2.0 application should look like?  The <a href="http://blogs.msdn.com/jmeier/archive/2006/07/20/672959.aspx">ASP.NET
Internet Security Reference Implementation</a> rolls all of the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/SecurityGuidanceIndex.asp">Patterns
and Practices Security Guidance</a> into real-world sample application, complete with
full documentation about all of the security features, why and how they were
implemented, and the drawbacks to doing so.
</p>
        <p>
If you are doing ASP.NET 1.1 or 2.0 web design, you should download this, read through
it, and check out the code.  While the code is 2.0, all of the security concepts-
and some of the solutions- map to 1.1 apps as well.
</p>
        <p>
One note: it installs into C:\Program Files\Microsoft\Internet Security Reference
Implementation by default.  It took me forever to find it!
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=e0abb29b-997d-4b06-be56-7af26676d63d" />
      </body>
      <title>ASP.NET 2.0 Internet Security Reference Implementation</title>
      <guid isPermaLink="false">http://blog.lifecycle-solutions.com/PermaLink,guid,e0abb29b-997d-4b06-be56-7af26676d63d.aspx</guid>
      <link>http://blog.lifecycle-solutions.com/2006/08/23/ASPNET20InternetSecurityReferenceImplementation.aspx</link>
      <pubDate>Wed, 23 Aug 2006 21:51:30 GMT</pubDate>
      <description>&lt;p&gt;
Ever wondered what a secure ASP.NET 2.0 application should look like?&amp;nbsp; The &lt;a href="http://blogs.msdn.com/jmeier/archive/2006/07/20/672959.aspx"&gt;ASP.NET
Internet Security Reference Implementation&lt;/a&gt; rolls all of the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/SecurityGuidanceIndex.asp"&gt;Patterns
and Practices Security Guidance&lt;/a&gt; into real-world sample application, complete with
full documentation about all of the security features, why and how&amp;nbsp;they were
implemented, and the drawbacks to doing so.
&lt;/p&gt;
&lt;p&gt;
If you are doing ASP.NET 1.1 or 2.0 web design, you should download this, read through
it, and check out the code.&amp;nbsp; While the code is 2.0, all of the security concepts-
and some of the solutions-&amp;nbsp;map to 1.1 apps as well.
&lt;/p&gt;
&lt;p&gt;
One note: it installs into C:\Program Files\Microsoft\Internet Security Reference
Implementation by default.&amp;nbsp; It took me forever to find it!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=e0abb29b-997d-4b06-be56-7af26676d63d" /&gt;</description>
      <comments>http://blog.lifecycle-solutions.com/CommentView,guid,e0abb29b-997d-4b06-be56-7af26676d63d.aspx</comments>
      <category>ASP.NET</category>
      <category>Documentation</category>
      <category>Patterns and Practices</category>
    </item>
    <item>
      <trackback:ping>http://blog.lifecycle-solutions.com/Trackback.aspx?guid=2aa7cc0b-eced-4cbe-87cf-1e3b3473425e</trackback:ping>
      <pingback:server>http://blog.lifecycle-solutions.com/pingback.aspx</pingback:server>
      <pingback:target>http://blog.lifecycle-solutions.com/PermaLink,guid,2aa7cc0b-eced-4cbe-87cf-1e3b3473425e.aspx</pingback:target>
      <dc:creator>Brian Parks</dc:creator>
      <wfw:comment>http://blog.lifecycle-solutions.com/CommentView,guid,2aa7cc0b-eced-4cbe-87cf-1e3b3473425e.aspx</wfw:comment>
      <wfw:commentRss>http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetEntryCommentsRss?guid=2aa7cc0b-eced-4cbe-87cf-1e3b3473425e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Craig Utley presented a <a href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032293566&amp;EventCategory=5&amp;culture=en-US&amp;CountryCode=US">very
useful Microsoft Webcast </a>a few months back on three common OO design
patterns (Singleton, Factory, and Observer).  In addition to describing
practical coding techniques to solve particular problems, Craig also shows
two methods for implementing each pattern -- a "traditional" approach that uses coding
constructs available in most languages, and a more elegant ".NET" approach that takes
advantage of features of the .NET framework to achieve the same goal; for example,
his .NET implementation of an "Observer" pattern uses delegates/events to communicate
between publisher and subscriber objects, rather than having the publisher aggregate
references to the subscribers.  
<br /><br />
There is also a good reference to various patterns, with sample implementations, <a href="http://www.dofactory.com/Patterns/Patterns.aspx">here</a>. 
</p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=2aa7cc0b-eced-4cbe-87cf-1e3b3473425e" />
      </body>
      <title>Webcast: Design Patterns in .NET</title>
      <guid isPermaLink="false">http://blog.lifecycle-solutions.com/PermaLink,guid,2aa7cc0b-eced-4cbe-87cf-1e3b3473425e.aspx</guid>
      <link>http://blog.lifecycle-solutions.com/2006/07/24/WebcastDesignPatternsInNET.aspx</link>
      <pubDate>Mon, 24 Jul 2006 01:09:45 GMT</pubDate>
      <description>&lt;p&gt;
Craig Utley presented a &lt;a href="http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?EventID=1032293566&amp;amp;EventCategory=5&amp;amp;culture=en-US&amp;amp;CountryCode=US"&gt;very
useful Microsoft Webcast &lt;/a&gt;a few months back&amp;nbsp;on&amp;nbsp;three common OO design
patterns (Singleton, Factory, and Observer).&amp;nbsp;&amp;nbsp;In addition&amp;nbsp;to&amp;nbsp;describing
practical&amp;nbsp;coding&amp;nbsp;techniques to solve particular problems, Craig also&amp;nbsp;shows
two methods for implementing each pattern -- a "traditional" approach that uses coding
constructs available in most languages, and a more elegant ".NET" approach that takes
advantage of features of the .NET framework to achieve the same goal; for example,
his&amp;nbsp;.NET implementation of an "Observer" pattern uses delegates/events to&amp;nbsp;communicate
between publisher and subscriber objects, rather than&amp;nbsp;having the publisher aggregate
references to the subscribers.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
There is also a good reference to various patterns, with sample implementations, &lt;a href="http://www.dofactory.com/Patterns/Patterns.aspx"&gt;here&lt;/a&gt;.&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=2aa7cc0b-eced-4cbe-87cf-1e3b3473425e" /&gt;</description>
      <comments>http://blog.lifecycle-solutions.com/CommentView,guid,2aa7cc0b-eced-4cbe-87cf-1e3b3473425e.aspx</comments>
      <category>Patterns and Practices</category>
    </item>
  </channel>
</rss>