<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" 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/"><channel><title>ASP.NET</title><link>http://blogs.clearscreen.com/migs/category/68.aspx</link><description>web development and designing from the side of a .Net developer</description><managingEditor>Miguel Jiménez</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Miguel Jiménez</dc:creator><title>Provider Pattern: A practical guide to decoupling .NET 2.0 applications</title><link>http://blogs.clearscreen.com/migs/archive/2006/12/01/4781.aspx</link><pubDate>Fri, 01 Dec 2006 07:19:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/12/01/4781.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/4781.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/12/01/4781.aspx#Feedback</comments><slash:comments>69</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/4781.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/4781.aspx</trackback:ping><description>&lt;p&gt;During the following post I'm going to explain a design pattern widely used during software development processes and how it fits into the .NET ecosystem. This pattern would probably fits into the structural patterns group and it's mainly used to decouple components, so abstractions and concrete implementations can vary independently.&lt;/p&gt;
&lt;p&gt;Using the provider pattern in .NET (and most object oriented languages) is pretty easy. We need the following artifacts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A provider definition, used as a contract that specifies what it should do 
&lt;/li&gt;&lt;li&gt;One or multiple provider implementations of the declared contract 
&lt;/li&gt;&lt;li&gt;A consumer willing to make use of the provider and it's implementations&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Imaging the following real life scenario: There is a basic definition of what a car should do (provider definition) and what is considered a car: it must have 4 wheels, an engine, steering wheel, etc.. in the market you are able to find lot of implementations following the actual definition of a car (implementations of the provider), and we, as consumers, can make use of the knowledge and methods defined in the provider contract to change the implementation we use without affecting our behavior (we are able to switch cars and use the common definition of it, as a car, to drive any of the implementations).&lt;/p&gt;
&lt;p&gt;So know, imagine it in the context of software development. We have an interface that defines a set of properties and methods that our provider must implement; we then have one or multiple implementations of that interface available; and of course, any consuming application can use the interface to switch between implementations without being affected. Have a look to the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src="/migs/files/ProviderModel1.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;This is pretty awesome and practical when we are willing to create componentized and decoupled applications. We just use interfaces. This pattern has been widely used in the new ASP.NET 2.0 to create the application services provider infrastructure. For example, the MembershipProvider can be defined either as SqlMembershipProvider or as a custom OracleMembershipProvider; they both provide the same functionality but with different behavior (one uses SQL Server as repository while the other is using Oracle databases)&lt;/p&gt;
&lt;p&gt;This pattern itself, IMHO, can dramatically increase the quality of your architecture because of the modularity and simplicity it provides.&lt;/p&gt;
&lt;p&gt;One of the hidden treasures of .NET is the existence of a Provider Model Framework that allows you to create custom Providers for anything (not only extensions of ASP.NET Providers, but any kind of .NET application or service) &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using .NET Framework 2.0 Provider Model&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So let's start writting some code. To create a provider we first have to create a public abstract class that defines our contract. This class must implement the System.Configuration.ProviderBase abstract class and it should contain the definition of methods and properties used as the "contract" of our provider.&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:52fb5bef-1140-40d8-a455-411caba9dd11" 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; WORD-WRAP: break-word"&gt;&lt;div&gt;&lt;!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--&gt;&lt;span style="COLOR: #008080"&gt;1&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;abstract&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; ImageProvider : ProviderBase
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;3&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;abstract&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;bool&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; CanSaveImages { &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;; }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;4&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;abstract&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Image GetImage(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; id);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;5&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;abstract&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; SaveImage(Image image);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We then need to add the actual implementations of the provider. In this case, we are going to add an image provider for the file system and an extra one for SQL Server.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:9e9f7924-5c36-48fd-9d00-44a140fd29c8" 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: #008080"&gt; 1&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;class&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; FileSystemImageProvider : ImageProvider
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 3&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;override&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;bool&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; CanSaveImages
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 5&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 7&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;true&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;; &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; As we allow to save images&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 8&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;        }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;10&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;11&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;override&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Image GetImage(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; id)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;12&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;13&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Some witty code to get the image from a folder in the FileSystem&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;14&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;null&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;15&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;16&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;17&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;override&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; SaveImage(System.Drawing.Image image)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;18&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;19&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Some witty code to save the image to a folder in the FileSystem&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;20&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;21&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;22&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;23&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;24&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;class&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; SqlImageProvider : ImageProvider
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;25&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;26&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;override&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;bool&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; CanSaveImages
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;27&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;28&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;29&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;30&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;true&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;; &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; As we allow to save images&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;31&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;        }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;32&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;33&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;34&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;override&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Image GetImage(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; id)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;35&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;36&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Some witty code to get the image from a folder in the FileSystem&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;37&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;null&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;; ;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;38&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;39&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;40&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;override&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; SaveImage(System.Drawing.Image image)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;41&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;42&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Some witty code to save the image to a folder in the FileSystem&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;43&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;44&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And finally, we need to create the service that will use the ImageProvider. It's is coupled to the contract definition of our provider and not to it's implementations, so it knows what to ask for but no actually how or where will it be done. The service just initializes the provider using the LoadProvider() method (it should read the provider from the config file; have in mind that here it's hardcoded for instructional purposes and you only need to change the LoadProvider method to achieve that goal)&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:3a204809-402d-4298-b5b3-d3a1e6b395e0" 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; WORD-WRAP: break-word"&gt;&lt;div&gt;&lt;!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--&gt;&lt;span style="COLOR: #008080"&gt; 1&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;class&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ImageService
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;private&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ImageProvider _provider;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 5&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; ImageProvider Provider
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 7&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 8&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;            &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; _provider;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;10&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;11&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;12&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;13&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; ImageService()
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;14&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;15&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        LoadProvider();
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;16&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;17&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;18&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; LoadProvider()
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;19&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;20&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        ProviderSettings ps &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;new&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ProviderSettings(&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;FileSystemImageProvider&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: #000000"&gt;"&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;FileSystemImageProvider_Type_Assembly&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: #008080"&gt;21&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        _provider &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ProvidersHelper.InstantiateProvider(ps, &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;typeof&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;(FileSystemImageProvider)) &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;as&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; ImageProvider;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;22&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;23&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;24&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; Image GetImage(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; id)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;25&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;26&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;return&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; _provider.GetImage(id);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;27&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;28&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;29&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; SaveImage(Image image)
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;30&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    {
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;31&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;        _provider.SaveImage(image);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;32&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;33&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The main caveat of using the .NET Provider Model is that you must reference the System.Web assembly in, probably, non-web projects. This is needed in order to access the ProvidersHelper class used to instantiate the provider collection. And it also forces the application to use the System.Configuration namespace and classes to read the provider configuration located in the web.config or app.config files. &lt;/p&gt;
&lt;p&gt;You'll have to deal with the types and assembly names where those types are defined to create the ProviderSettings instance needed by the ProvidersHelper.InstantiateProvider method. It's maybe not recommended to use all this "web" references in a desktop or service context; so there's a clean and elegant alternative for the OO purists :)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The pure OO implementation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So, we need to get rid of the System.Web reference and make the provider pattern work without using the .NET Framework 2.0 model. The first thing we need to do is to refactor provider's abstract class to an interface (or leave it as a class, it's up to you, but remove the ProviderBase inheritance and any reference to the System.Configuration namespace) and change the concrete providers implementations to make them use the newly created interface. The class diagram should look similar to:&lt;/p&gt;
&lt;p&gt;&lt;img src="/migs/files/ProviderModel2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;First, we should create the following code for the provider contract:&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:60686d22-92ef-4cc1-bd6f-e5a73d070dc8" 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; WORD-WRAP: break-word"&gt;&lt;div&gt;&lt;!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--&gt;&lt;span style="COLOR: #008080"&gt;1&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;interface&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; IImageProvider
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;bool&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; CanSaveImages { &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;get&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;; }
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    Image GetImage(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; id);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;5&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; SaveImage(Image image);
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And of course change the signature of the concrete provider implementations for FileSystemImageProvider and SqlImageProvider so they use the new contract:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:c3466cc5-db96-42b4-8b02-d86036b937e4" 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; WORD-WRAP: break-word"&gt;&lt;div&gt;&lt;!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--&gt;&lt;span style="COLOR: #008080"&gt; 1&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;class&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; FileSystemImageProvider : IImageProvider
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;   &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Implementation of the provider code, only signature of the class changed&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 4&lt;/span&gt; &lt;span style="COLOR: #008000"&gt;&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;}
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 5&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 6&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 7&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;class&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; SqlSystemImageProvider : IImageProvider
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 8&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt; 9&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;   &lt;/span&gt;&lt;span style="COLOR: #008000"&gt;//&lt;/span&gt;&lt;span style="COLOR: #008000"&gt; Implementation of the provider code, only signature of the class changed&lt;/span&gt;&lt;span style="COLOR: #008000"&gt;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;10&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;p&gt;&lt;/p&gt;
&lt;p&gt;The ImageService still almost the same, we only need to change LoadProvider's code so it creates an instance of the desired concrete implementation without using the ProvidersHelper class. Something like this may work perfectly:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:d44ec1d0-586e-40e4-b657-bfd5caba0113" 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; WORD-WRAP: break-word"&gt;&lt;div&gt;&lt;!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--&gt;&lt;span style="COLOR: #008080"&gt;1&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; LoadProvider()
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;2&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;{
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;3&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;    _provider &lt;/span&gt;&lt;span style="COLOR: #000000"&gt;=&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; Activator.CreateInstance(&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;typeof&lt;/span&gt;&lt;span style="COLOR: #000000"&gt;(FileSystemImageProvider)) &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;as&lt;/span&gt;&lt;span style="COLOR: #000000"&gt; IImageProvider;
&lt;/span&gt;&lt;span style="COLOR: #008080"&gt;4&lt;/span&gt; &lt;span style="COLOR: #000000"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Any conclusion?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As you can see, the approach it's quite similar for both methods and it's really simple to introduce it in most of actual software projects and architectures. It provides ease of installation, highly decoupled systems and modularity both in development and deployment.&lt;/p&gt;
&lt;p&gt;There's no excuse to avoid this pattern, as far as it's possible and pragmatic to use it in the context of your architecture :) &lt;/p&gt;
&lt;p&gt;Hope this helps anyone.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/4781.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>During the following post I'm going to explain a design pattern widely used during software development processes and how it fits into the .NET ecosystem. This pattern would probably fits into the structural patterns group and it's mainly used to decouple components, so abstractions and concrete implementations can vary independently.</p>
<p>Using the provider pattern in .NET (and most object oriented languages) is pretty easy. We need the following artifacts:</p>
<ul>
<li>A provider definition, used as a contract that specifies what it should do 
</li><li>One or multiple provider implementations of the declared contract 
</li><li>A consumer willing to make use of the provider and it's implementations</li></ul>
<p>Imaging the following real life scenario: There is a basic definition of what a car should do (provider definition) and what is considered a car: it must have 4 wheels, an engine, steering wheel, etc.. in the market you are able to find lot of implementations following the actual definition of a car (implementations of the provider), and we, as consumers, can make use of the knowledge and methods defined in the provider contract to change the implementation we use without affecting our behavior (we are able to switch cars and use the common definition of it, as a car, to drive any of the implementations).</p>
<p>So know, imagine it in the context of software development. We have an interface that defines a set of properties and methods that our provider must implement; we then have one or multiple implementations of that interface available; and of course, any consuming application can use the interface to switch between implementations without being affected. Have a look to the following diagram:</p>
<p><img src="/migs/files/ProviderModel1.jpg" /></p>
<p>This is pretty awesome and practical when we are willing to create componentized and decoupled applications. We just use interfaces. This pattern has been widely used in the new ASP.NET 2.0 to create the application services provider infrastructure. For example, the MembershipProvider can be defined either as SqlMembershipProvider or as a custom OracleMembershipProvider; they both provide the same functionality but with different behavior (one uses SQL Server as repository while the other is using Oracle databases)</p>
<p>This pattern itself, IMHO, can dramatically increase the quality of your architecture because of the modularity and simplicity it provides.</p>
<p>One of the hidden treasures of .NET is the existence of a Provider Model Framework that allows you to create custom Providers for anything (not only extensions of ASP.NET Providers, but any kind of .NET application or service) </p>
<p><strong></strong> </p>
<p><strong>Using .NET Framework 2.0 Provider Model</strong></p>
<p>So let's start writting some code. To create a provider we first have to create a public abstract class that defines our contract. This class must implement the System.Configuration.ProviderBase abstract class and it should contain the definition of methods and properties used as the "contract" of our provider.</p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:52fb5bef-1140-40d8-a455-411caba9dd11" 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; WORD-WRAP: break-word"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="COLOR: #008080">1</span> <span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> ImageProvider : ProviderBase
</span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000">   </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> CanSaveImages { </span><span style="COLOR: #0000ff">get</span><span style="COLOR: #000000">; }
</span><span style="COLOR: #008080">4</span> <span style="COLOR: #000000">   </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000"> Image GetImage(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> id);
</span><span style="COLOR: #008080">5</span> <span style="COLOR: #000000">   </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> SaveImage(Image image);
</span><span style="COLOR: #008080">6</span> <span style="COLOR: #000000">}</span></div></pre></div>
<p>We then need to add the actual implementations of the provider. In this case, we are going to add an image provider for the file system and an extra one for SQL Server.</p>
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:9e9f7924-5c36-48fd-9d00-44a140fd29c8" 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: #008080"> 1</span> <span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> FileSystemImageProvider : ImageProvider
</span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">override</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> CanSaveImages
</span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">get</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">        {
</span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> As we allow to save images</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        }
</span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">10</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">override</span><span style="COLOR: #000000"> Image GetImage(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> id)
</span><span style="COLOR: #008080">12</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">13</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Some witty code to get the image from a folder in the FileSystem</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">14</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">;
</span><span style="COLOR: #008080">15</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">16</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">17</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">override</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> SaveImage(System.Drawing.Image image)
</span><span style="COLOR: #008080">18</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">19</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Some witty code to save the image to a folder in the FileSystem</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">20</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">21</span> <span style="COLOR: #000000">}
</span><span style="COLOR: #008080">22</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">23</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">24</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> SqlImageProvider : ImageProvider
</span><span style="COLOR: #008080">25</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080">26</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">override</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> CanSaveImages
</span><span style="COLOR: #008080">27</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">28</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">get</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080">29</span> <span style="COLOR: #000000">        {
</span><span style="COLOR: #008080">30</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">; </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> As we allow to save images</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">31</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        }
</span><span style="COLOR: #008080">32</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">33</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">34</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">override</span><span style="COLOR: #000000"> Image GetImage(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> id)
</span><span style="COLOR: #008080">35</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">36</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Some witty code to get the image from a folder in the FileSystem</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">37</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">; ;
</span><span style="COLOR: #008080">38</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">39</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">40</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">override</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> SaveImage(System.Drawing.Image image)
</span><span style="COLOR: #008080">41</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">42</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Some witty code to save the image to a folder in the FileSystem</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">43</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">44</span> <span style="COLOR: #000000">}</span></div></pre></div>
<p></p>
<p>And finally, we need to create the service that will use the ImageProvider. It's is coupled to the contract definition of our provider and not to it's implementations, so it knows what to ask for but no actually how or where will it be done. The service just initializes the provider using the LoadProvider() method (it should read the provider from the config file; have in mind that here it's hardcoded for instructional purposes and you only need to change the LoadProvider method to achieve that goal)</p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:3a204809-402d-4298-b5b3-d3a1e6b395e0" 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; WORD-WRAP: break-word"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="COLOR: #008080"> 1</span> <span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> ImageService
</span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> ImageProvider _provider;
</span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> ImageProvider Provider
</span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">get</span><span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">        {
</span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">            </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> _provider;
</span><span style="COLOR: #008080">10</span> <span style="COLOR: #000000">        }
</span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">12</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">13</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> ImageService()
</span><span style="COLOR: #008080">14</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">15</span> <span style="COLOR: #000000">        LoadProvider();
</span><span style="COLOR: #008080">16</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">17</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">18</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"> LoadProvider()
</span><span style="COLOR: #008080">19</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">20</span> <span style="COLOR: #000000">        ProviderSettings ps </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> ProviderSettings(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">FileSystemImageProvider</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">FileSystemImageProvider_Type_Assembly</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);
</span><span style="COLOR: #008080">21</span> <span style="COLOR: #000000">        _provider </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> ProvidersHelper.InstantiateProvider(ps, </span><span style="COLOR: #0000ff">typeof</span><span style="COLOR: #000000">(FileSystemImageProvider)) </span><span style="COLOR: #0000ff">as</span><span style="COLOR: #000000"> ImageProvider;
</span><span style="COLOR: #008080">22</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">23</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">24</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> Image GetImage(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> id)
</span><span style="COLOR: #008080">25</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">26</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> _provider.GetImage(id);
</span><span style="COLOR: #008080">27</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">28</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080">29</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"> SaveImage(Image image)
</span><span style="COLOR: #008080">30</span> <span style="COLOR: #000000">    {
</span><span style="COLOR: #008080">31</span> <span style="COLOR: #000000">        _provider.SaveImage(image);
</span><span style="COLOR: #008080">32</span> <span style="COLOR: #000000">    }
</span><span style="COLOR: #008080">33</span> <span style="COLOR: #000000">}</span></div></pre></div>
<p>The main caveat of using the .NET Provider Model is that you must reference the System.Web assembly in, probably, non-web projects. This is needed in order to access the ProvidersHelper class used to instantiate the provider collection. And it also forces the application to use the System.Configuration namespace and classes to read the provider configuration located in the web.config or app.config files. </p>
<p>You'll have to deal with the types and assembly names where those types are defined to create the ProviderSettings instance needed by the ProvidersHelper.InstantiateProvider method. It's maybe not recommended to use all this "web" references in a desktop or service context; so there's a clean and elegant alternative for the OO purists :)</p>
<p><strong></strong> </p>
<p><strong>The pure OO implementation</strong></p>
<p>So, we need to get rid of the System.Web reference and make the provider pattern work without using the .NET Framework 2.0 model. The first thing we need to do is to refactor provider's abstract class to an interface (or leave it as a class, it's up to you, but remove the ProviderBase inheritance and any reference to the System.Configuration namespace) and change the concrete providers implementations to make them use the newly created interface. The class diagram should look similar to:</p>
<p><img src="/migs/files/ProviderModel2.jpg" /></p>
<p>First, we should create the following code for the provider contract:</p>
<p><font color="#ff0000"></font></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:60686d22-92ef-4cc1-bd6f-e5a73d070dc8" 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; WORD-WRAP: break-word"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="COLOR: #008080">1</span> <span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">interface</span><span style="COLOR: #000000"> IImageProvider
</span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000"> CanSaveImages { </span><span style="COLOR: #0000ff">get</span><span style="COLOR: #000000">; }
</span><span style="COLOR: #008080">4</span> <span style="COLOR: #000000">    Image GetImage(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000"> id);
</span><span style="COLOR: #008080">5</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> SaveImage(Image image);
</span><span style="COLOR: #008080">6</span> <span style="COLOR: #000000">}</span></div></pre></div>
<p>And of course change the signature of the concrete provider implementations for FileSystemImageProvider and SqlImageProvider so they use the new contract:</p>
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:c3466cc5-db96-42b4-8b02-d86036b937e4" 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; WORD-WRAP: break-word"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="COLOR: #008080"> 1</span> <span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> FileSystemImageProvider : IImageProvider
</span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000">   </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Implementation of the provider code, only signature of the class changed</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">}
</span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">
</span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> SqlSystemImageProvider : IImageProvider
</span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">   </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Implementation of the provider code, only signature of the class changed</span><span style="COLOR: #008000">
</span><span style="COLOR: #008080">10</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">}</span></div></pre></div>
<p></p>
<p>The ImageService still almost the same, we only need to change LoadProvider's code so it creates an instance of the desired concrete implementation without using the ProvidersHelper class. Something like this may work perfectly:</p>
<p></p>
<div class="wlWriterEditableSmartContent" id="57F11A72-B0E5-49c7-9094-E3A15BD5B5E7:d44ec1d0-586e-40e4-b657-bfd5caba0113" 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; WORD-WRAP: break-word"><div><!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><span style="COLOR: #008080">1</span> <span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> LoadProvider()
</span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000">{
</span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000">    _provider </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> Activator.CreateInstance(</span><span style="COLOR: #0000ff">typeof</span><span style="COLOR: #000000">(FileSystemImageProvider)) </span><span style="COLOR: #0000ff">as</span><span style="COLOR: #000000"> IImageProvider;
</span><span style="COLOR: #008080">4</span> <span style="COLOR: #000000">}</span></div></pre></div>
<p></p>
<p><strong>Any conclusion?</strong></p>
<p>As you can see, the approach it's quite similar for both methods and it's really simple to introduce it in most of actual software projects and architectures. It provides ease of installation, highly decoupled systems and modularity both in development and deployment.</p>
<p>There's no excuse to avoid this pattern, as far as it's possible and pragmatic to use it in the context of your architecture :) </p>
<p>Hope this helps anyone.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/4781.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>At last, an up-to-date version of Commerce Server</title><link>http://blogs.clearscreen.com/migs/archive/2006/11/07/4181.aspx</link><pubDate>Tue, 07 Nov 2006 14:09:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/11/07/4181.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/4181.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/11/07/4181.aspx#Feedback</comments><slash:comments>23</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/4181.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/4181.aspx</trackback:ping><description>&lt;p&gt;It was time to get a Commerce Server version up to nowadays technologies. This was my first thought a while ago when listening to Ryan Donovan, Product Unit Manager for Commerce Server 2007.&lt;/p&gt;
&lt;p&gt;In the past I had the chance (or bad luck) to deal with Commerce Server, and I was missing a lot of features. In last version, the migrated most of the code and content to ASP.NET but it still required all the classic COM componentes used in previous versions. This has completely changed. Finally.&lt;/p&gt;
&lt;p&gt;The actual model is completely developed over ASP.NET 2.0 and on top of it you can find the object model (catalogs, orders, etc...) presented by Commerce Server... there is a new extensibility layer over all those components exposed with web services and a new .NET API that supports all the managing and updating content options.&lt;/p&gt;
&lt;p&gt;The most interesting part seems to be the integration of web controls inside ASP.NET that allow to develop e-commerce site dragging and dropping ASP.NET 2.0 templated controls. This was impossible until now. There are more new features like virtual catalogs, integration with Biztalk 2006, support for Membership, Themes and Masterpages, integration with Sharepoint 2007 and support for Active Directory Federation Services (more to come about this)&lt;/p&gt;
&lt;p&gt;The Agile note of this presentation was: “The included Starter Site includes a complete set of unit tests“ .. Than you. Really.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/4181.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>It was time to get a Commerce Server version up to nowadays technologies. This was my first thought a while ago when listening to Ryan Donovan, Product Unit Manager for Commerce Server 2007.</p>
<p>In the past I had the chance (or bad luck) to deal with Commerce Server, and I was missing a lot of features. In last version, the migrated most of the code and content to ASP.NET but it still required all the classic COM componentes used in previous versions. This has completely changed. Finally.</p>
<p>The actual model is completely developed over ASP.NET 2.0 and on top of it you can find the object model (catalogs, orders, etc...) presented by Commerce Server... there is a new extensibility layer over all those components exposed with web services and a new .NET API that supports all the managing and updating content options.</p>
<p>The most interesting part seems to be the integration of web controls inside ASP.NET that allow to develop e-commerce site dragging and dropping ASP.NET 2.0 templated controls. This was impossible until now. There are more new features like virtual catalogs, integration with Biztalk 2006, support for Membership, Themes and Masterpages, integration with Sharepoint 2007 and support for Active Directory Federation Services (more to come about this)</p>
<p>The Agile note of this presentation was: “The included Starter Site includes a complete set of unit tests“ .. Than you. Really.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/4181.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>It's coming up! Get some Atlas, get Ajaxed</title><link>http://blogs.clearscreen.com/migs/archive/2006/09/21/3509.aspx</link><pubDate>Thu, 21 Sep 2006 12:42:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/09/21/3509.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/3509.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/09/21/3509.aspx#Feedback</comments><slash:comments>22</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/3509.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/3509.aspx</trackback:ping><description>&lt;p&gt;I've been some time playing and testing with Atlas. I'm pretty excited to get it real and &lt;a href="http://weblogs.asp.net/scottgu" target="_blank"&gt;ScottGu&lt;/a&gt; has finally &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/09/11/_2200_Atlas_2200_-1.0-Naming-and-Roadmap.aspx"&gt;announced&lt;/a&gt; that Atlas will hit 1.0 before the end of this year. It would go through the typical beta, rc and rtm path, but it will be available as an extension for ASP.NET 2.0.&lt;/p&gt; &lt;p&gt;Atlas is going to be divided into three modules:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Microsoft AJAX Library for the Client Library &lt;/li&gt;&lt;li&gt;Microsoft AJAX Extensions for ASP.NET 2.0 for the Server Library &lt;/li&gt;&lt;li&gt;Microsoft AJAX Control Toolkit for the Control Library&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;It seems that pretty cool name goes wasted (as it happened to Indigo, Avalon, Whidbey, etc...) again, but the important thing is that we are getting support for AJAX in our ASP.NET 2.0 applications.&lt;/p&gt; &lt;p&gt;Get up to date. Read more Atlas related at:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Atlas - &lt;a href="http://atlas.asp.net"&gt;http://atlas.asp.net&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Atlas Control Toolkit - &lt;a href="http://www.codeplex.com/Release/ProjectReleases.as"&gt;http://www.codeplex.com/Release/ProjectReleases.as...&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Atlas Control Toolkit Samples - &lt;a href="http://atlas.asp.net"&gt;&lt;a href="http://atlas.asp.net/default.aspx?tabid=47&amp;amp;subtabid=477"&gt;http://atlas.asp.net/default.aspx?tabid=47&amp;amp;subtabi...&lt;/a&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Scott Guthrie - &lt;a href="http://weblogs.asp.net/scottgu"&gt;http://weblogs.asp.net/scottgu&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Nikhil Khotari - &lt;a href="http://www.nikhilk.com"&gt;http://www.nikhilk.com&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Shawn Burke - &lt;a href="http://blogs.msdn.com/sburke"&gt;http://blogs.msdn.com/sburke&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Bertrand Le Roy - &lt;a href="http://weblogs.asp.net/bleroy"&gt;http://weblogs.asp.net/bleroy&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/3509.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>I've been some time playing and testing with Atlas. I'm pretty excited to get it real and <a href="http://weblogs.asp.net/scottgu" target="_blank">ScottGu</a> has finally <a href="http://weblogs.asp.net/scottgu/archive/2006/09/11/_2200_Atlas_2200_-1.0-Naming-and-Roadmap.aspx">announced</a> that Atlas will hit 1.0 before the end of this year. It would go through the typical beta, rc and rtm path, but it will be available as an extension for ASP.NET 2.0.</p> <p>Atlas is going to be divided into three modules:</p> <ul> <li>Microsoft AJAX Library for the Client Library </li><li>Microsoft AJAX Extensions for ASP.NET 2.0 for the Server Library </li><li>Microsoft AJAX Control Toolkit for the Control Library</li></ul> <p>It seems that pretty cool name goes wasted (as it happened to Indigo, Avalon, Whidbey, etc...) again, but the important thing is that we are getting support for AJAX in our ASP.NET 2.0 applications.</p> <p>Get up to date. Read more Atlas related at:</p> <ul> <li>Atlas - <a href="http://atlas.asp.net">http://atlas.asp.net</a></li> <li>Atlas Control Toolkit - <a href="http://www.codeplex.com/Release/ProjectReleases.as">http://www.codeplex.com/Release/ProjectReleases.as...</a></li> <li>Atlas Control Toolkit Samples - <a href="http://atlas.asp.net"><a href="http://atlas.asp.net/default.aspx?tabid=47&amp;subtabid=477">http://atlas.asp.net/default.aspx?tabid=47&amp;subtabi...</a></a></li> <li>Scott Guthrie - <a href="http://weblogs.asp.net/scottgu">http://weblogs.asp.net/scottgu</a></li> <li>Nikhil Khotari - <a href="http://www.nikhilk.com">http://www.nikhilk.com</a></li> <li>Shawn Burke - <a href="http://blogs.msdn.com/sburke">http://blogs.msdn.com/sburke</a></li> <li>Bertrand Le Roy - <a href="http://weblogs.asp.net/bleroy">http://weblogs.asp.net/bleroy</a></li></ul><img src ="http://blogs.clearscreen.com/migs/aggbug/3509.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Debugging ASP.NET 2.0 applications with Windows Vista</title><link>http://blogs.clearscreen.com/migs/archive/2006/09/14/3488.aspx</link><pubDate>Thu, 14 Sep 2006 12:43:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/09/14/3488.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/3488.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/09/14/3488.aspx#Feedback</comments><slash:comments>59</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/3488.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/3488.aspx</trackback:ping><description>&lt;p&gt;I recently installed Windows Vista pre-RC1 (5536) and it's going perfectly with it; I installed Visual Studio 2005 Team Suite also and I am using the laptop to perform my daily work.&lt;/p&gt; &lt;p&gt;Everything is running fine, but I had some problems trying to debug ASP.NET applications. The problem is that IE7 and Vista are really focused on security, so there's a separate process and user running IE with the least possible privileges. This ain't good for my debugger, because attaching a process is something that could easily be considered harmful.&lt;/p&gt; &lt;p&gt;So, how did I managed to get it to work?&lt;/p&gt; &lt;p&gt;Simple. The ASP.NET applications run on they local server provided by Visual Studio 2005. That is considered an Intranet. By default, Intranet permissions are not configured under IE7 in Vista, so the first time you try to access you &lt;a href="http://localhost"&gt;http://localhost&lt;/a&gt; web server it will ask you to configure it. Do so.&lt;/p&gt; &lt;p&gt;Now you are able to run your ASP.NET developed web application on your own machine and see the results. But you still without debugging.&lt;/p&gt; &lt;p&gt;The solution is simpler than the previous one. To validate that you allow to attach a process to the site that runs the webs you're developing, add the site "localhost" to the Trusted Sites list of IE7, so it will not complaint about it. The next time you start a site included in the trusted list IE will open a new window for it because different trust levels can't coexist in the same process. There's no option to use tabbed browsing, just new windows.&lt;/p&gt; &lt;p&gt;That's all. Happy debugging in Windows Vista.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/3488.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>I recently installed Windows Vista pre-RC1 (5536) and it's going perfectly with it; I installed Visual Studio 2005 Team Suite also and I am using the laptop to perform my daily work.</p> <p>Everything is running fine, but I had some problems trying to debug ASP.NET applications. The problem is that IE7 and Vista are really focused on security, so there's a separate process and user running IE with the least possible privileges. This ain't good for my debugger, because attaching a process is something that could easily be considered harmful.</p> <p>So, how did I managed to get it to work?</p> <p>Simple. The ASP.NET applications run on they local server provided by Visual Studio 2005. That is considered an Intranet. By default, Intranet permissions are not configured under IE7 in Vista, so the first time you try to access you <a href="http://localhost">http://localhost</a> web server it will ask you to configure it. Do so.</p> <p>Now you are able to run your ASP.NET developed web application on your own machine and see the results. But you still without debugging.</p> <p>The solution is simpler than the previous one. To validate that you allow to attach a process to the site that runs the webs you're developing, add the site "localhost" to the Trusted Sites list of IE7, so it will not complaint about it. The next time you start a site included in the trusted list IE will open a new window for it because different trust levels can't coexist in the same process. There's no option to use tabbed browsing, just new windows.</p> <p>That's all. Happy debugging in Windows Vista.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/3488.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Atlas March CTP released and lot of more related cool stuff</title><link>http://blogs.clearscreen.com/migs/archive/2006/03/21/2942.aspx</link><pubDate>Tue, 21 Mar 2006 12:27:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/03/21/2942.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/2942.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/03/21/2942.aspx#Feedback</comments><slash:comments>24</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/2942.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/2942.aspx</trackback:ping><description>&lt;p&gt;Last week I was talking with my &lt;a href="http://blogs.clearscreen.com/dtax"&gt;brother&lt;/a&gt; about a presentation I'm preparing to show AJAX and Atlas at &lt;a href="http://www.ilitia.com"&gt;my company&lt;/a&gt;. He was also preparing one at &lt;a href="http://www.aubay.es"&gt;his company&lt;/a&gt; and asked me a couple of things. The first thing I said was "well, I guess it's better to wait a bit til Monday or Tuesday so we can get the new Atlas CTP that will surely be released" ... I knew nothing about this release, but it was more than obvious that there was going a release coming up at &lt;a href="http://www.mix06.com"&gt;MIX'06&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So, if we had any doubt here is the &lt;a href="http://atlas.asp.net/Default.aspx?tabid=47"&gt;official page for the Atlas March CTP&lt;/a&gt; with a bunch of new features and fixes that can be found here. Within all the new stuff we have: a better designed and informative web site, &lt;a href="http://atlas.asp.net/docs/Default.aspx"&gt;better documentation and learning resources&lt;/a&gt; and some videos from MIX'06 where they show the new features.&lt;/p&gt;
&lt;p&gt;One more interesting thing relating to this release... a MashUp contest is running (try this &lt;a href="http://en.wikipedia.org/wiki/Mashup_%28web_application_hybrid%29"&gt;definition of MashUp&lt;/a&gt; if you don't know what it is) within the Atlas team, so go and create your killing Atlas app. &lt;a href="http://atlas.asp.net/default.aspx?tabid=47&amp;amp;subtabid=472"&gt;Check the contest here&lt;/a&gt;.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/2942.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Last week I was talking with my <a href="http://blogs.clearscreen.com/dtax">brother</a> about a presentation I'm preparing to show AJAX and Atlas at <a href="http://www.ilitia.com">my company</a>. He was also preparing one at <a href="http://www.aubay.es">his company</a> and asked me a couple of things. The first thing I said was "well, I guess it's better to wait a bit til Monday or Tuesday so we can get the new Atlas CTP that will surely be released" ... I knew nothing about this release, but it was more than obvious that there was going a release coming up at <a href="http://www.mix06.com">MIX'06</a></p>
<p>So, if we had any doubt here is the <a href="http://atlas.asp.net/Default.aspx?tabid=47">official page for the Atlas March CTP</a> with a bunch of new features and fixes that can be found here. Within all the new stuff we have: a better designed and informative web site, <a href="http://atlas.asp.net/docs/Default.aspx">better documentation and learning resources</a> and some videos from MIX'06 where they show the new features.</p>
<p>One more interesting thing relating to this release... a MashUp contest is running (try this <a href="http://en.wikipedia.org/wiki/Mashup_%28web_application_hybrid%29">definition of MashUp</a> if you don't know what it is) within the Atlas team, so go and create your killing Atlas app. <a href="http://atlas.asp.net/default.aspx?tabid=47&amp;subtabid=472">Check the contest here</a>.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/2942.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Viewing actual HTML source when creating AJAX applications</title><link>http://blogs.clearscreen.com/migs/archive/2006/02/28/2872.aspx</link><pubDate>Tue, 28 Feb 2006 00:26:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/02/28/2872.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/2872.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/02/28/2872.aspx#Feedback</comments><slash:comments>32</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/2872.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/2872.aspx</trackback:ping><description>&lt;p&gt;I &lt;a href="http://blogs.clearscreen.com/migs/archive/2006/02/24/2851.aspx"&gt;posted&lt;/a&gt; a couple of days ago about my problems debugging HTML source code when working with AJAX and also how I planned to solved it with Internet Explorer Developer Toolbar. It worked, it allowed me to inspect the actual DOM and see how it changed my original source... but it was too slow to debug it that way.&lt;/p&gt;
&lt;p&gt;Fortunately, my brother &lt;a href="http://blogs.clearscreen.com/migs/archive/2006/02/24/2851.aspx#2852"&gt;posted a comment&lt;/a&gt; pointing me to this &lt;a href="http://blogs.telerik.com/blogs/rumen_stankov/archive/2006/02/20/124.aspx"&gt;post&lt;/a&gt; by &lt;a href="http://blogs.telerik.com/blogs/rumen_stankov"&gt;Rumen Stankov&lt;/a&gt; where he shows a trick to view and save the actual source in Internet Explorer. Just paste the following in your address bar:&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;  javascript:'&amp;lt;XMP&amp;gt;' + window.document.body.outerHTML + '&amp;lt;/XMP&amp;gt;'&lt;/font&gt; 
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope you find it as useful as I do. Why doesn't the Developer Toolbar includes something like this feature?&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/2872.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>I <a href="http://blogs.clearscreen.com/migs/archive/2006/02/24/2851.aspx">posted</a> a couple of days ago about my problems debugging HTML source code when working with AJAX and also how I planned to solved it with Internet Explorer Developer Toolbar. It worked, it allowed me to inspect the actual DOM and see how it changed my original source... but it was too slow to debug it that way.</p>
<p>Fortunately, my brother <a href="http://blogs.clearscreen.com/migs/archive/2006/02/24/2851.aspx#2852">posted a comment</a> pointing me to this <a href="http://blogs.telerik.com/blogs/rumen_stankov/archive/2006/02/20/124.aspx">post</a> by <a href="http://blogs.telerik.com/blogs/rumen_stankov">Rumen Stankov</a> where he shows a trick to view and save the actual source in Internet Explorer. Just paste the following in your address bar:</p>
<p><font face="Courier New">  javascript:'&lt;XMP&gt;' + window.document.body.outerHTML + '&lt;/XMP&gt;'</font> 
</p><p></p>
<p>Hope you find it as useful as I do. Why doesn't the Developer Toolbar includes something like this feature?</p><img src ="http://blogs.clearscreen.com/migs/aggbug/2872.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Internet Explorer Developer Toolbar Beta 2</title><link>http://blogs.clearscreen.com/migs/archive/2006/02/24/2851.aspx</link><pubDate>Fri, 24 Feb 2006 17:38:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/02/24/2851.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/2851.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/02/24/2851.aspx#Feedback</comments><slash:comments>46</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/2851.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/2851.aspx</trackback:ping><description>&lt;p&gt;This is pretty old news, but it seemed pretty useful to me today. Related to a couple of AJAX problems where I couldn't inspect the current CSS and HTML object stacks, I needed a tool that allow me to inspect them on the fly.&lt;/p&gt;
&lt;p&gt;So, I just remembered about the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;amp;displaylang=en"&gt;Internet Explorer Developer Toolbar Beta 2&lt;/a&gt;, installed it and started to see how my page change with every callback.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/2851.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>This is pretty old news, but it seemed pretty useful to me today. Related to a couple of AJAX problems where I couldn't inspect the current CSS and HTML object stacks, I needed a tool that allow me to inspect them on the fly.</p>
<p>So, I just remembered about the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en">Internet Explorer Developer Toolbar Beta 2</a>, installed it and started to see how my page change with every callback.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/2851.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Upgrading from MCAD to MCPD Web Developer with exam 71-551</title><link>http://blogs.clearscreen.com/migs/archive/2006/02/24/2849.aspx</link><pubDate>Fri, 24 Feb 2006 13:26:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/02/24/2849.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/2849.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/02/24/2849.aspx#Feedback</comments><slash:comments>106</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/2849.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/2849.aspx</trackback:ping><description>&lt;p&gt;I just took this exam today and it seemed to have a pretty good level. The exam was divided in three section of 30 questions each. Once you finish a section you can't go back and change your answers, but you can go back to add comments to them.&lt;/p&gt;
&lt;p&gt;The first section was specific to web applications and it has a bunch of question with mobile pages, mobile devices, web forms and web controls as the main topics. The second part of the exam looked the hardest one, it was related to framework and types with security attributes, xml serialization attributes, class design and generics in its topics. The third part, the one I was really scared of, was the architecture one and it was really easy to pass, lot of logical questions about designing solutions and best practices.&lt;/p&gt;
&lt;p&gt;There is one thing I still have in mind, that really impressed me positively. I got some questions talking about unit testing, code coverage and integration tests ... :-D&lt;/p&gt;
&lt;p&gt;As with all the beta exams, I'll have to wait to get my results a couple of weeks. While I wait, I'll take more exams.... Next stop: 71-552 Upgrade from MCAD to MCPD Windows Developer; next Monday morning.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/2849.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>I just took this exam today and it seemed to have a pretty good level. The exam was divided in three section of 30 questions each. Once you finish a section you can't go back and change your answers, but you can go back to add comments to them.</p>
<p>The first section was specific to web applications and it has a bunch of question with mobile pages, mobile devices, web forms and web controls as the main topics. The second part of the exam looked the hardest one, it was related to framework and types with security attributes, xml serialization attributes, class design and generics in its topics. The third part, the one I was really scared of, was the architecture one and it was really easy to pass, lot of logical questions about designing solutions and best practices.</p>
<p>There is one thing I still have in mind, that really impressed me positively. I got some questions talking about unit testing, code coverage and integration tests ... :-D</p>
<p>As with all the beta exams, I'll have to wait to get my results a couple of weeks. While I wait, I'll take more exams.... Next stop: 71-552 Upgrade from MCAD to MCPD Windows Developer; next Monday morning.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/2849.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Creating futuristic Web 2.0 applications</title><link>http://blogs.clearscreen.com/migs/archive/2006/02/13/2796.aspx</link><pubDate>Mon, 13 Feb 2006 17:12:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/02/13/2796.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/2796.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/02/13/2796.aspx#Feedback</comments><slash:comments>23</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/2796.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/2796.aspx</trackback:ping><description>&lt;p&gt;Being on the rush is not easy... &lt;/p&gt;
&lt;p&gt;If you have an idea of a cool (or not) web application you have to target it to the web2.0 market and it will success. Sure. But. How you make anything look like web2.0? Easy. add over-sized fonts, the word "social" in your description, a white background and tags clouds to your site!!! You're done. Get ready to sell you site to one of the bigs... ;-P&lt;/p&gt;
&lt;p&gt;Read the full article, it's funny and instructional: &lt;a href="http://mentalized.net/journal/2005/10/10/building_your_very_own_web20_layout/"&gt;http://mentalized.net/journal/2005/10/10/building_your_very_own_web20_layout/&lt;/a&gt;&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/2796.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Being on the rush is not easy... </p>
<p>If you have an idea of a cool (or not) web application you have to target it to the web2.0 market and it will success. Sure. But. How you make anything look like web2.0? Easy. add over-sized fonts, the word "social" in your description, a white background and tags clouds to your site!!! You're done. Get ready to sell you site to one of the bigs... ;-P</p>
<p>Read the full article, it's funny and instructional: <a href="http://mentalized.net/journal/2005/10/10/building_your_very_own_web20_layout/">http://mentalized.net/journal/2005/10/10/building_your_very_own_web20_layout/</a></p><img src ="http://blogs.clearscreen.com/migs/aggbug/2796.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Advanced HTML Basics: How to make a control non-focusable</title><link>http://blogs.clearscreen.com/migs/archive/2006/02/03/2749.aspx</link><pubDate>Fri, 03 Feb 2006 11:27:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/02/03/2749.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/2749.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/02/03/2749.aspx#Feedback</comments><slash:comments>42</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/2749.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/2749.aspx</trackback:ping><description>&lt;p&gt;Have you ever though on how to make any HTML control non-focusable? Yes, thinking about how to not allow it to get focus when using the UI... I've digged a bit about it and found that there's no HTML attribute to provide this functionallity and I came with this idea that solved my problem.&lt;/p&gt;
&lt;p&gt;Browsers use the TabIndex property to determine which control is the next to get the focus. It's a zero-based count. So what if you put any negative number as the value for the TabIndex property??? Easy. It works. That control won't get focused while tabbing in your form. So this control is now non-focusable.&lt;/p&gt;
&lt;p&gt;Hope you find it useful.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/2749.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Have you ever though on how to make any HTML control non-focusable? Yes, thinking about how to not allow it to get focus when using the UI... I've digged a bit about it and found that there's no HTML attribute to provide this functionallity and I came with this idea that solved my problem.</p>
<p>Browsers use the TabIndex property to determine which control is the next to get the focus. It's a zero-based count. So what if you put any negative number as the value for the TabIndex property??? Easy. It works. That control won't get focused while tabbing in your form. So this control is now non-focusable.</p>
<p>Hope you find it useful.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/2749.aspx" width = "1" height = "1" /></body></item></channel></rss>