<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-37210378</id><updated>2012-02-01T11:00:45.618+08:00</updated><category term='.Net 4.0'/><category term='skydrive'/><category term='REST'/><category term='stdd'/><category term='mock'/><category term='storage'/><category term='syndication'/><category term='cloud'/><category term='atdd'/><category term='MEF'/><category term='reflector'/><category term='google drive'/><category term='moq'/><category term='scrum'/><category term='fit'/><category term='agile'/><category term='WCF'/><category term='rss'/><category term='VS2010'/><category term='atom'/><category term='slim'/><category term='tdd'/><category term='MCPD'/><category term='.net'/><category term='fitnesse'/><category term='Design Patterns'/><category term='Trivias'/><category term='Silverlight'/><title type='text'>.Net2Me</title><subtitle type='html'>Anything about .Net development, design patterns, agile practices and other interests.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-37210378.post-9201544725838251611</id><published>2012-02-01T11:00:00.002+08:00</published><updated>2012-02-01T11:00:45.630+08:00</updated><title type='text'></title><content type='html'>Blog has moved to &lt;a href="http://devmines.wordpress.com"&gt;http://devmines.wordpress.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-9201544725838251611?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/9201544725838251611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=9201544725838251611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/9201544725838251611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/9201544725838251611'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2012/02/blog-has-moved-to-httpdevmines.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-7009330754390822428</id><published>2010-05-24T13:09:00.001+08:00</published><updated>2010-05-24T13:10:51.124+08:00</updated><title type='text'>Installing FitNesse as a service.</title><content type='html'>Found this blog about &lt;a href="http://www.muellerdesigns.net/dasblog/2006/12/29/InstallingABATFileAsAWindowsServiceSpecificallyFitnesse.aspx"&gt;installing FitNesse as a windows service&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-7009330754390822428?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.muellerdesigns.net/dasblog/2006/12/29/InstallingABATFileAsAWindowsServiceSpecificallyFitnesse.aspx' title='Installing FitNesse as a service.'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/7009330754390822428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=7009330754390822428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/7009330754390822428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/7009330754390822428'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2010/05/installing-fitnesse-as-service.html' title='Installing FitNesse as a service.'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-6685775547352475076</id><published>2010-03-16T07:42:00.007+08:00</published><updated>2010-03-16T19:39:30.399+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net 4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>RESTing in WCF</title><content type='html'>Rob Bagby created a wonderful blog and screencast &lt;a href="http://www.robbagby.com/rest/rest-in-wcf-blog-series-index/"&gt;series on REST in WCF&lt;/a&gt;. Earlier, in 2008, Rob Skonnard, of Pluralsight, also provided a &lt;a href="http://msdn.microsoft.com/en-us/library/dd203052.aspx"&gt;guide to designing and building RESTful web services with WCF 3.5&lt;/a&gt; featured on MSDN. Another series on REST is on &lt;a href="http://blogs.msdn.com/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx"&gt;The .NET Endpoint&lt;/a&gt; by the .NET and AppTabric team which showcased the technology in .Net 4.0. REST's (REpresentational State Transfer) point of view is that a real web service is one designed to embrace the web from the ground up. I find REST's architectural style very interesting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-6685775547352475076?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/6685775547352475076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=6685775547352475076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6685775547352475076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6685775547352475076'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2010/03/resting-in-wcf.html' title='RESTing in WCF'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-6415340083850000431</id><published>2010-03-07T19:35:00.006+08:00</published><updated>2010-03-16T19:40:23.802+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MEF'/><category scheme='http://www.blogger.com/atom/ns#' term='VS2010'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Silverlight 4 development on VS2010 RC</title><content type='html'>I was enjoying going through the Silverlight 4 and MEF videos of &lt;a href="http://channel9.msdn.com/niners/mtaulty"&gt;Mike Taulty&lt;/a&gt; at Channel 9 and immediately fell in love with MEF. I like the declarative way of exporting and importing parts and the ease of composing them into a working application. But before the love affair blossomed into something I found out that Silverlight 4 along with MEF do not work and is not supported in VS2010 RC. It really broke my heart. I mean, how could these MS people excites you so much with something great and leave you #$@!@! Anyway, read the story &lt;a href="http://timheuer.com/blog/archive/2010/02/09/faq-silverlight-and-visual-studio-2010-release-candidate.aspx"&gt;here&lt;/a&gt;. I was about to remove VS2010 RC from my laptop when a speck of hope came. I was desperately googling Silverlight 4 and MEF development in VS2010 RC and after about a week, there in the list of google's search list is &lt;a href="http://blogs.msdn.com/zxue/archive/2010/03/02/enabling-silverlight-4-on-visual-studio-2010-rc.aspx"&gt;Dr. Z's blog&lt;/a&gt; sharing an interesting blog how to enable Silverlight 4 in VS2010 RC. He actually just found the hack from &lt;a href="http://blog.andrew-veresov.com/post/Enable-Silverlight-4-Tools-in-Visual-Studio-2010-Release-Candidate.aspx"&gt;Andrew Veresov&lt;/a&gt; who translated the work of Alex Sorokoletov. So, thanks to these guys. And happy silverlighting!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-6415340083850000431?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/6415340083850000431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=6415340083850000431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6415340083850000431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6415340083850000431'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2010/03/silverlight-4-development-on-vs2010-rc.html' title='Silverlight 4 development on VS2010 RC'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-215888371019278151</id><published>2010-02-20T07:09:00.005+08:00</published><updated>2010-03-16T19:40:49.763+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fitnesse'/><category scheme='http://www.blogger.com/atom/ns#' term='agile'/><category scheme='http://www.blogger.com/atom/ns#' term='atdd'/><category scheme='http://www.blogger.com/atom/ns#' term='fit'/><title type='text'>ATDD, FIT and FItNesse Training</title><content type='html'>Just finished conducting training and coaching atdd, fit and fitnesse in Amsterdam. It was a great experience. Fit provides a medium of communication between business people and developers to speak a common language and express business rules that both understand. Ward Cunningham in his book Fit for Development said that two major interconnected tasks essential to the value and quality of software application is helping to think about and communicate through concrete examples of what is needed in a software application; and automatically testing, from a business perspective, that the application is doing what is expected and continues to do so as it grows in functionality. ATDD with FIT and FitNesse are a perfect combination to execute these tasks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-215888371019278151?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/215888371019278151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=215888371019278151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/215888371019278151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/215888371019278151'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2010/02/atdd-fit-and-fitnesse-training.html' title='ATDD, FIT and FItNesse Training'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-98685994327810937</id><published>2010-01-07T13:52:00.003+08:00</published><updated>2010-03-16T19:41:08.881+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Great MSDN Articles</title><content type='html'>Articles that are must-read for silverlight devs:&lt;br /&gt;1. &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163791.aspx"&gt;Drill into .Net Framework internals to see how the CLR creates runtime objects.&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://msdn.microsoft.com/en-us/magazine/dd315415.aspx"&gt;Build LOB Enterprise Apps with Silverlight Part I&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://msdn.microsoft.com/en-us/magazine/dd434653.aspx"&gt;Build LOB Enterprise Apps with Silverlight Part II&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I'll be adding more...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-98685994327810937?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/98685994327810937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=98685994327810937' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/98685994327810937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/98685994327810937'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2010/01/great-msdn-articles.html' title='Great MSDN Articles'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-797086935853248217</id><published>2010-01-07T10:37:00.004+08:00</published><updated>2010-01-07T10:46:10.413+08:00</updated><title type='text'>Globe, Smart or Sun</title><content type='html'>&lt;div&gt;Ever wonder which cellphone number belongs to which network? The fourth digit is the key. Look at the following table:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://4.bp.blogspot.com/_cUa_e5y2KO8/S0VKQYwHrGI/AAAAAAAAADA/vZLSZaV0jmA/s1600-h/cellnetwork.PNG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 212px; FLOAT: left; HEIGHT: 177px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5423822971620273250" border="0" alt="" src="http://4.bp.blogspot.com/_cUa_e5y2KO8/S0VKQYwHrGI/AAAAAAAAADA/vZLSZaV0jmA/s320/cellnetwork.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;     So for example a number 0917-344-3433 belongs to a Globe network and 0918-443-3224 belongs to a Smart network. So if you have one of those unlimited call on the same network subscription make sure you know the correct information.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-797086935853248217?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.load.com.ph/smartglobe.asp' title='Globe, Smart or Sun'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/797086935853248217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=797086935853248217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/797086935853248217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/797086935853248217'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2010/01/globe-smart-or-sun.html' title='Globe, Smart or Sun'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_cUa_e5y2KO8/S0VKQYwHrGI/AAAAAAAAADA/vZLSZaV0jmA/s72-c/cellnetwork.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-8821111485857134053</id><published>2010-01-06T11:00:00.002+08:00</published><updated>2010-03-16T19:41:24.946+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='atdd'/><title type='text'>Starting ATDD</title><content type='html'>I found a great site that provides useful tutorials in understanding Acceptance Test Driven Development (ATDD). Enjoy learning ATDD &lt;a href="http://schuchert.wikispaces.com/FitNesse.Tutorials.0"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-8821111485857134053?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://schuchert.wikispaces.com/FitNesse.Tutorials.0' title='Starting ATDD'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/8821111485857134053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=8821111485857134053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/8821111485857134053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/8821111485857134053'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2010/01/starting-atdd.html' title='Starting ATDD'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-1853013836180976281</id><published>2009-12-27T09:33:00.002+08:00</published><updated>2009-12-27T09:41:20.115+08:00</updated><title type='text'>Installing Windows 7 from USB</title><content type='html'>I have a company issued Thinkpad X61 laptop. X61 is lighweight and small but i find it powerful and suits my job. Since it doesn't have a internal DVD drive, i have to plug in an external  one to install Windows 7. I found a &lt;a href="http://blogs.technet.com/aviraj/archive/2009/02/01/installing-windows-7-using-usb-thumb-drive.aspx"&gt;link&lt;/a&gt; though that allows me to install Windows 7 from a USB thumb drive. Very helpful!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-1853013836180976281?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blogs.technet.com/aviraj/archive/2009/02/01/installing-windows-7-using-usb-thumb-drive.aspx' title='Installing Windows 7 from USB'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/1853013836180976281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=1853013836180976281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1853013836180976281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1853013836180976281'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/12/installing-windows-7-from-usb.html' title='Installing Windows 7 from USB'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-9221063945552954520</id><published>2009-12-07T11:37:00.002+08:00</published><updated>2009-12-07T11:42:23.393+08:00</updated><title type='text'>First Christmas</title><content type='html'>I am looking forward to celebrate Christmas in my home town. This will be my first Christmas in nineteen years. I left as single man but am coming back with a family of my own- a beautiful wife and wonderful children. And lots of gray hair on my head.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-9221063945552954520?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/9221063945552954520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=9221063945552954520' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/9221063945552954520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/9221063945552954520'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/12/first-christmas.html' title='First Christmas'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-4405821503837820910</id><published>2009-12-07T11:32:00.002+08:00</published><updated>2009-12-07T11:36:50.533+08:00</updated><title type='text'>Develop With Passion</title><content type='html'>I enjoyed reading Jean-Paul Boodhoo's &lt;a href="http://blog.jboodhoo.com"&gt;Develop With Passion &lt;/a&gt;blog. I am inspired of his unselfish motivation for his dedication to share his knowledge.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-4405821503837820910?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blog.jpboodhoo.com' title='Develop With Passion'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/4405821503837820910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=4405821503837820910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/4405821503837820910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/4405821503837820910'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/12/develop-with-passion.html' title='Develop With Passion'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-652351230697797097</id><published>2009-11-26T09:40:00.003+08:00</published><updated>2009-11-26T10:03:49.804+08:00</updated><title type='text'>Enabling TFS 2008 Support for Expression Blend 3</title><content type='html'>TFS 2008 support for expression blend 3 is enabled by the following:&lt;br /&gt;A. Service-side component.&lt;br /&gt;1. Download and install Team Foundation Server 2008 service pack 1 from &lt;a href="http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=9e40a5b6-da41-43a2-a06d-3cee196bfe3d&amp;amp;displayLang=en"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;B. Client-side componnent.&lt;br /&gt;1. Download and install Visual Studio 2008 Service Pack 1 &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=FBEE1648-7106-44A7-9649-6D9F6D58056E"&gt;here.&lt;/a&gt;&lt;br /&gt;2. Download and install Team Explorer 2008 &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0ed12659-3d41-4420-bbb0-a46e51bfca86&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;br /&gt;3. Download and install Team Explorer hotfix &lt;a href="http://code.msdn.microsoft.com/KB967483"&gt;here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-652351230697797097?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/652351230697797097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=652351230697797097' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/652351230697797097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/652351230697797097'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/11/enabling-tfs-2008-support-for.html' title='Enabling TFS 2008 Support for Expression Blend 3'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-8504741688049683473</id><published>2009-09-11T11:26:00.003+08:00</published><updated>2010-03-16T19:42:15.017+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fitnesse'/><category scheme='http://www.blogger.com/atom/ns#' term='agile'/><category scheme='http://www.blogger.com/atom/ns#' term='atdd'/><category scheme='http://www.blogger.com/atom/ns#' term='stdd'/><category scheme='http://www.blogger.com/atom/ns#' term='fit'/><category scheme='http://www.blogger.com/atom/ns#' term='slim'/><title type='text'>Fit for Agile</title><content type='html'>I been doing Agile development for the last two years and it's encouraging to see the visible improvement in the development teams. Since then Agile interests me a lot that i started reading some more. And the more i read the more i realized that there is still tons in Agile development that i really wasn't aware of. ATDD, STDD, Fitnesse, Slim - all agile practices and tools . I like the way the Describe-Demonstrate-Develop cycle's simplicity and the greater focus on creating and using tests to produce quality software. I foresee a drastic improvement in the dev teams in the coming days.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-8504741688049683473?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/8504741688049683473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=8504741688049683473' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/8504741688049683473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/8504741688049683473'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/09/fit-for-agile.html' title='Fit for Agile'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-2028930655124224987</id><published>2009-06-18T09:14:00.006+08:00</published><updated>2010-03-16T19:42:44.506+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mock'/><category scheme='http://www.blogger.com/atom/ns#' term='tdd'/><category scheme='http://www.blogger.com/atom/ns#' term='moq'/><title type='text'>Mocking .Net 3.5</title><content type='html'>VS2008 lacks mocking feature. With TDD, being able to create mock objects is an essential. Why mock? One rule of unit testing is to isolate the test as much as possible to focus on one specific object and test solely around the behavior we expect from it and not of any of its dependencies. The dependency objects' implementation in fact doesn't have to exist yet and may well just be represented by interfaces utilize by the mocking framework to create mock objects. Since VS2008 is yet to have this feature, searching for mock frameworks in the web leads me to &lt;a href="http://code.google.com/p/moq/"&gt;Moq&lt;/a&gt;, pronounced "Mock-you". I'll be spending a lot of time mocking with this tool. So, Happy Mocking!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-2028930655124224987?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://code.google.com/p/moq/' title='Mocking .Net 3.5'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/2028930655124224987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=2028930655124224987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2028930655124224987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2028930655124224987'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/06/mocking-net-35.html' title='Mocking .Net 3.5'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-1148508527434884914</id><published>2009-06-03T17:41:00.003+08:00</published><updated>2010-03-16T19:43:13.350+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='agile'/><category scheme='http://www.blogger.com/atom/ns#' term='scrum'/><title type='text'>Practicing Scrum</title><content type='html'>I found this article about &lt;a href="http://www.agile-software-development.com/2007/09/how-to-implement-scrum-in-10-easy-steps.html"&gt;Implementing Scrum&lt;/a&gt; a good read. The article mentioned the following steps:&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/09/how-to-implement-scrum-in-10-easy-steps_20.html"&gt;Step #1: Get your backlog in order!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/09/how-to-implement-scrum-in-10-easy-steps_28.html"&gt;Step #2: How to estimate your product backlog&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/10/how-to-implement-scrum-in-10-easy-steps.html"&gt;Step #3: Sprint Planning/clarify requirements&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/10/how-to-implement-scrum-in-10-easy-steps_11.html"&gt;Step #4: Sprint Planning/estimate tasks&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/10/how-to-implement-scrum-in-10-easy-steps_16.html"&gt;Step #5: Create a collaborative workspace&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/10/how-to-implement-scrum-in-10-easy-steps_19.html"&gt;Step #6: Sprint!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/10/how-to-implement-scrum-in-10-easy-steps_30.html"&gt;Step #7: Stand up and be counted!&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/11/how-to-implement-scrum-in-10-easy-steps.html"&gt;Step #8: Track progress with a daily burndown chart&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/11/how-to-implement-scrum-in-10-easy-steps_13.html"&gt;Step #9: Finish when you said you would&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.agile-software-development.com/2007/11/how-to-implement-scrum-in-10-easy-steps_20.html"&gt;Step #10: Review, reflect, repeat...&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've been following the scrum practices for almost two years already and there are still a lot for me to learn and improve.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-1148508527434884914?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.agile-software-development.com/2007/09/how-to-implement-scrum-in-10-easy-steps.html' title='Practicing Scrum'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/1148508527434884914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=1148508527434884914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1148508527434884914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1148508527434884914'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/06/practicing-scrum.html' title='Practicing Scrum'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-2162096726740955957</id><published>2009-06-01T08:43:00.004+08:00</published><updated>2009-06-02T16:03:48.164+08:00</updated><title type='text'>Fit for Life</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_cUa_e5y2KO8/SiMmP9QcEYI/AAAAAAAAAC4/yjbB1m6hvQc/s1600-h/Windows+Photo+Gallery+Wallpaper.jpg"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 320px; FLOAT: left; HEIGHT: 240px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5342155638574944642" border="0" alt="" src="http://1.bp.blogspot.com/_cUa_e5y2KO8/SiMmP9QcEYI/AAAAAAAAAC4/yjbB1m6hvQc/s320/Windows+Photo+Gallery+Wallpaper.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;This isn't about .net or technology but i cannot help but be proud of my beautiful wife. On May 31st, she joined the four-mile (6.4 km) fun run held at the Global City, Taguig and crossed the finish line under 42 minutes, which is three minutes faster than her personal goal. She's just awesome: a very hardworking mother of two energetic kids, a working mom, a health conscious lady, and to top it - a wife of a stubborn husband. May 31, 2009, I can never forget it. It's our sixth year anniversary.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-2162096726740955957?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/2162096726740955957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=2162096726740955957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2162096726740955957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2162096726740955957'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/06/fit-for-life.html' title='Fit for Life'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_cUa_e5y2KO8/SiMmP9QcEYI/AAAAAAAAAC4/yjbB1m6hvQc/s72-c/Windows+Photo+Gallery+Wallpaper.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-5986325702017891065</id><published>2009-05-28T10:35:00.002+08:00</published><updated>2009-05-28T10:39:58.331+08:00</updated><title type='text'>ISO 9001 Certified!</title><content type='html'>BlastAsia, Inc. is now ISO 9001 certified! Congratulations to all especially to the very hard working QA team headed by the hunk Jun Sionson!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-5986325702017891065?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.blastasia.com' title='ISO 9001 Certified!'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/5986325702017891065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=5986325702017891065' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/5986325702017891065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/5986325702017891065'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/05/iso-9001-certified.html' title='ISO 9001 Certified!'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-2433940096968606155</id><published>2009-05-16T09:41:00.008+08:00</published><updated>2010-03-16T19:43:48.937+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='skydrive'/><category scheme='http://www.blogger.com/atom/ns#' term='storage'/><category scheme='http://www.blogger.com/atom/ns#' term='google drive'/><title type='text'>Space full, store them in the cloud</title><content type='html'>There seems to be a lot of noise with storage in the cloud. &lt;a href="http://windowslive.com/Online/SkyDrive"&gt;Microsoft's Live Skydrive&lt;/a&gt; allows you to store up to 25 GB (free) of data with 50MB maximum upload per file. Not bad! Google is coming up with &lt;a href="http://www.pcworld.com/article/158625/take_a_peek_at_the_google_drive.html"&gt;Google Drive&lt;/a&gt; too. With available third party utilities such as &lt;a href="http://on10.net/blogs/sarahintampa/Mount-SkyDrive-As-A-Virtual-Drive-In-Windows/"&gt;Gladinet&lt;/a&gt;, these online storage can be made available to your desktop as though they are locally stored making your favorite drag and drop feature works like a snap.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-2433940096968606155?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/2433940096968606155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=2433940096968606155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2433940096968606155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2433940096968606155'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/05/space-full-store-them-in-cloud.html' title='Space full, store them in the cloud'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-2222928319030166034</id><published>2009-05-15T17:20:00.010+08:00</published><updated>2010-03-16T19:44:27.128+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='atom'/><category scheme='http://www.blogger.com/atom/ns#' term='syndication'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='reflector'/><category scheme='http://www.blogger.com/atom/ns#' term='rss'/><title type='text'>.Net Syndication</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_cUa_e5y2KO8/Sg06PaGxcnI/AAAAAAAAACw/pSro_f-EKSo/s1600-h/syndication.png"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 320px; FLOAT: left; HEIGHT: 210px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5335985169884082802" border="0" alt="" src="http://2.bp.blogspot.com/_cUa_e5y2KO8/Sg06PaGxcnI/AAAAAAAAACw/pSro_f-EKSo/s320/syndication.png" /&gt;&lt;/a&gt; I been looking at the .Net assemblies through the .Net Reflector and i found the System.ServiceModel.Syndication namespace inside the System.ServiceModel.Web assembly with several useful classes for &lt;a href="http://en.wikipedia.org/wiki/Web_syndication"&gt;web syndication&lt;/a&gt;. I am making some sort of feed aggregator site which basically contains a collection of links to syndication feeds and making it the central viewing site.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The final output would be something like on the above. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;There are three different commonly used formats for syndication feeds namely: &lt;a href="http://web.resource.org/rss/1.0/"&gt;RSS 1.0&lt;/a&gt;, &lt;a href="http://www.rssboard.org/rss-specification"&gt;RSS 2.0&lt;/a&gt;, and &lt;a href="http://atompub.org/2005/07/11/draft-ietf-atompub-format-10.html"&gt;ATOM 1.0&lt;/a&gt;. If you look at the format of each you will see that they have different element specification. &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The SyndicationFeed class represents a top-level feed object in Atom 1.0 and RSS 2.0. Although RSS 1.0 is not natively supported, you can easily create a formatter class that can handle it by deriving the abstract SyndicationFeedFormatter class. The Atom10FeedFormatter and RSS20FeedFormatter,which handles Atom 1.0 and RSS 2.0 respectively are derived from this base class. &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Loading the feed from Martin Fowler's site at &lt;a href="http://martinfowler.com/bliki/bliki.atom"&gt;http://martinfowler.com/bliki/bliki.atom&lt;/a&gt;, you use the following code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;string uri = "http://martinfowler.com/bliki/bliki.atom";&lt;br /&gt;&lt;br /&gt;// Read in the feed.&lt;br /&gt;XmlReader reader = XmlReader.Create(uri);&lt;br /&gt;&lt;br /&gt;// Check whether RSS 2.0 or ATOM 1.0&lt;br /&gt;SyndicationFeedFormatter formatter;&lt;br /&gt;&lt;br /&gt;SyndicationFeedFormatter rss20Formatter = new Rss20FeedFormatter();&lt;br /&gt;SyndicationFeedFormatter atom20Formatter = new Atom10FeedFormatter();&lt;br /&gt;&lt;br /&gt;// Try first if RSS 2.0&lt;br /&gt;if (rss20Formatter.CanRead(reader))&lt;br /&gt;{&lt;br /&gt;    formatter = rss20Formatter.ReadFrom(reader);&lt;br /&gt;}&lt;br /&gt;else if(atom10Formatter.CanRead(reader))&lt;br /&gt;{&lt;br /&gt;    formatter = atom10Formatter.ReadFrom(reader);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;    throw new ApplicationException("Feed Format currently not supported!");&lt;br /&gt;&lt;br /&gt;// other codes...&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can use the SyndicatonFeedFormatter class to load from a source feed (SyndicationFeed), check the version of the feed, gain access to the feed items(SyndicationItem) and write the feed contents to an XMLWriter.&lt;br /&gt;&lt;br /&gt;Other useful classes are SyndicationItem, SyndicationPerson, TextSyndicationContent,SyndicationLink and SyndicationCategory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-2222928319030166034?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/2222928319030166034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=2222928319030166034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2222928319030166034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2222928319030166034'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/05/net-syndication.html' title='.Net Syndication'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_cUa_e5y2KO8/Sg06PaGxcnI/AAAAAAAAACw/pSro_f-EKSo/s72-c/syndication.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-1368853400064109053</id><published>2009-01-28T09:09:00.002+08:00</published><updated>2009-01-28T09:15:28.918+08:00</updated><title type='text'>Model-View-ViewModel Pattern for WPF</title><content type='html'>Great articles using design patterns for WPF.&lt;br /&gt;&lt;a href="http://www.acceptedeclectic.com/2008/01/model-view-viewmodel-pattern-for-wpf.html"&gt;Pete Weissbrod's M-V-VM&lt;/a&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx"&gt;Dan Crevier's DM-V-VM&lt;/a&gt; series&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-1368853400064109053?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.acceptedeclectic.com/2008/01/model-view-viewmodel-pattern-for-wpf.html' title='Model-View-ViewModel Pattern for WPF'/><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/1368853400064109053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=1368853400064109053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1368853400064109053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1368853400064109053'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2009/01/model-view-viewmodel-pattern-for-wpf.html' title='Model-View-ViewModel Pattern for WPF'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-7864416386974332872</id><published>2008-05-22T18:32:00.002+08:00</published><updated>2008-05-22T18:39:29.741+08:00</updated><title type='text'>Managing Connection Strings using ConfigurationManager Class</title><content type='html'>&lt;div class="ExternalClassA35EAE3CEE8B4651A787D2E1B655B514"&gt;     The .Net Framework 2.0 introduces the ConfigurationManager class in the System.Configuration namespace. I use this class to manage the ConnectionStrings section in the application configuration file(app.config or web.config). The ConnectionStrings section allows you to store connection information for accessing databases. And by using the static ConnectionStrings property of the ConnectionManager class you will be able to get the different records in the ConnectionStrings section of the config file.&lt;br /&gt;&lt;br /&gt;     To configure a connection string for a database named BAIDB in a SQL Server named BAISERVER using Windows Authentication, we add a record in the ConnectionStrings section:&lt;br /&gt;&lt;span style="color:#993300;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:78%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#993300;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;?&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;xml&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;version&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;1.0&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;encoding&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;utf-8&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; ?&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;configuration&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;connectionStrings&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;        &amp;lt;add&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;SQLConnection&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;"&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;                connectionString&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Data Source=BAISERVER;Initial&lt;br /&gt;                    Catalog=BAIDB;Integrated Security=true&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;"&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;                providerName&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;System.Data.SqlClient&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;br /&gt;     &amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;connectionStrings&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;configuration&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#993300;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Now, to use the connection string in code, we add a reference to the System.Configuration assembly. This is very important. If you don't explicitly reference the assembly you will not see the ConfigurationManager class.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000080;"&gt;using &lt;/span&gt;System;&lt;br /&gt;&lt;span style="color:#003366;"&gt;using &lt;/span&gt;System.Configuration.&lt;br /&gt;&lt;span style="color:#000080;"&gt;using &lt;/span&gt;System.Data;&lt;br /&gt;&lt;span style="color:#003366;"&gt;using &lt;/span&gt;System.Data.SqlClient;&lt;br /&gt;&lt;span style="color:#003366;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#003366;"&gt;namespace &lt;/span&gt;BAI&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color:#003366;"&gt;  static class&lt;/span&gt; Program&lt;br /&gt;    {&lt;br /&gt;          &lt;span style="color:#003366;"&gt;static&lt;/span&gt; &lt;span style="color:#003300;"&gt;void &lt;/span&gt;Main(string[] args)&lt;br /&gt;          {&lt;br /&gt;&lt;span style="color:#008000;"&gt;              //retrieve the connection record in the &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;              //ConnectionStrings section named SQLConnection&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color:#33cccc;"&gt;string &lt;/span&gt;connectionString =             &lt;br /&gt;                         &lt;span style="color:#33cccc;"&gt;ConfigurationManager&lt;/span&gt;.ConnectionStrings&lt;br /&gt;                         ["SQLConnection"].ConnectionString;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color:#33cccc;"&gt;SqlConnection &lt;/span&gt;connection = new &lt;span style="color:#33cccc;"&gt;SQLConnection&lt;/span&gt;&lt;br /&gt;                         (connectionString);&lt;br /&gt;&lt;br /&gt;             connection.Open();&lt;br /&gt;&lt;span style="color:#008000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;            //Do something with the connection.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color:#006600;"&gt;//Close the connection&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;            connection.Close();&lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;     If your application uses more than one database, you can add the appropriate connection string record in the ConnectionStrings section.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#993300;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;?&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;xml&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;version&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;1.0&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;encoding&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;utf-8&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; ?&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;configuration&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;connectionStrings&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;        &amp;lt;add&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;SQLConnection&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;"&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;                connectionString&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Data Source=BAISERVER;Initial&lt;br /&gt;                    Catalog=BAIDB;Integrated Security=true&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;"&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;                providerName&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;System.Data.SqlClient&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-size:85%;"&gt; /&amp;gt;&lt;br /&gt;&lt;span style="color:#a31515;"&gt;        &amp;lt;add&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;SQLConnection2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;"&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;                connectionString&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Data Source=BAISERVER2;Initial&lt;br /&gt;                    Catalog=BAIDB2;Integrated Security=true&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;"&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#ff0000;"&gt;                providerName&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;System.Data.SqlClient&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt; /&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;     &amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="font-size:85%;color:#a31515;"&gt;connectionStrings&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;configuration&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;And you can use the second connection like this:&lt;/div&gt;&lt;div&gt;&lt;span style="color:#000080;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="color:#000080;"&gt;using &lt;/span&gt;System;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="color:#003366;"&gt;using &lt;/span&gt;System.Configuration.&lt;/div&gt;&lt;div&gt;&lt;span style="color:#000080;"&gt;using &lt;/span&gt;System.Data;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#003366;"&gt;using &lt;/span&gt;System.Data.SqlClient;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#003366;"&gt;namespace &lt;/span&gt;BAI&lt;/div&gt;&lt;div&gt;{&lt;br /&gt;  &lt;span style="color:#003366;"&gt;  static class&lt;/span&gt; Program&lt;br /&gt;    {&lt;/div&gt;&lt;div&gt;          &lt;span style="color:#003366;"&gt;static&lt;/span&gt; &lt;span style="color:#003300;"&gt;void &lt;/span&gt;Main(string[] args)&lt;/div&gt;&lt;div&gt;          {&lt;/div&gt;&lt;div&gt;&lt;span style="color:#008000;"&gt;              //retrieve the connection record in the &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color:#008000;"&gt;              //ConnectionStrings section named SQLConnection&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;              &lt;span style="color:#33cccc;"&gt;string &lt;/span&gt;connectionString =             &lt;br /&gt;                         &lt;span style="color:#33cccc;"&gt;ConfigurationManager&lt;/span&gt;.ConnectionStrings&lt;br /&gt;                         ["SQLConnection"].ConnectionString;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;             &lt;span style="color:#33cccc;"&gt;SqlConnection &lt;/span&gt;connection = new &lt;span style="color:#33cccc;"&gt;SQLConnection&lt;/span&gt;&lt;br /&gt;                         (connectionString);&lt;/div&gt;&lt;br /&gt;&lt;div&gt;             connection.Open();&lt;/div&gt;&lt;div&gt;&lt;span style="color:#008000;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="color:#008000;"&gt;            //Do something with the connection.&lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;            &lt;span style="color:#006600;"&gt;//Close the connection&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;            connection.Close();&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;            &lt;span style="color:#33cccc;"&gt;string &lt;/span&gt;connectionString2 =             &lt;br /&gt;                         &lt;span style="color:#33cccc;"&gt;ConfigurationManager&lt;/span&gt;.ConnectionStrings&lt;br /&gt;                         ["SQLConnection2"].ConnectionString;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;             &lt;span style="color:#33cccc;"&gt;SqlConnection &lt;/span&gt;connection2 = new &lt;span style="color:#33cccc;"&gt;SQLConnection&lt;/span&gt;&lt;br /&gt;                         (connectionString2);&lt;/div&gt;&lt;br /&gt;&lt;div&gt;             connection2.Open();&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#008000;"&gt;            //Do something with the connection.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;            &lt;span style="color:#006600;"&gt;//Close the connection&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;            connection2.Close();&lt;br /&gt;       }&lt;/div&gt;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;     As you can see the .Net Framework has already done much of the work for us to manage connection string information. You can also encrypt the connection strings for security reasons.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;     The ConfigurationManager class can also be use to manage the different sections of the configuration file.&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-7864416386974332872?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/7864416386974332872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=7864416386974332872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/7864416386974332872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/7864416386974332872'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2008/05/managing-connection-strings-using.html' title='Managing Connection Strings using ConfigurationManager Class'/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-3882207097905212337</id><published>2008-05-10T00:00:00.002+08:00</published><updated>2008-05-10T17:13:09.671+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><title type='text'></title><content type='html'>&lt;span xmlns=""&gt;&lt;p&gt;&lt;strong&gt;Design Pattern: Singleton Implementation in .Net&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Some of our development tasks require us to control the number of instances created for a particular class or type. There could be possible reasons for this. One, you have limited resources in terms of memory and disk such as programming for pocket PCs and mobile apps. Two, a resource pool is maintained for an application to use such as connection to database servers for licensing concerns. These are just two cases among others wherein the creation of objects is controlled.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The singleton design pattern allows us to limit the instance of an object to one. It is the easiest design pattern to understand and implement among the 23 defined by the Gang Of Four(GOF). In this article, we try to implement the pattern using C#.Net.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The following are significant in using singleton:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. The user of the class must not be able to create an instance by using a public constructor.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. The class must not be inheritable thus preventing any subclass to define a public constructor and create the instance from there.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. A global point of access to the single instance must be provided.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Let us create a POSRegister class. This class is responsible for all functions related to cashiering and tendering in a POS application. We only need one instance of this class for the whole application so we use the Singleton pattern to implement this.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So first we define the skeleton of the class:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;public class&lt;/span&gt; &lt;span style="color:#33cccc;"&gt;POSRegister&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;     #region Business Properties&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;    // All properties related to the operation of the&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;    // class goes here.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;   #endregion&lt;br /&gt;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To prevent the user of this class from creating instances of this class we have to make its contructor private:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;public class&lt;/span&gt; &lt;span style="color:#33cccc;"&gt;POSRegister&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;     #region Constructors&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // Make the constructor private&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;     private &lt;/span&gt;POSRegister()&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     {&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #endregion&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #region Business Properties&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // All properties related to the operation of the&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // class goes here.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;     #endregion&lt;br /&gt;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Then, we make sure that this class cannot be subclassed or inherited by using the "sealed" specifier:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;// Sealed makes the class not inheritable&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;public sealed class&lt;/span&gt; &lt;span style="color:#33cccc;"&gt;POSRegister&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #region Constructors&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // Make the constructor private&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;     private &lt;/span&gt;POSRegister()&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     {&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #endregion&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #region Business Properties&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // All properties related to the operation of the&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // class goes here.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;     #endregion&lt;br /&gt;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;At this point, we have a class that cannot be instantiated and cannot be subclassed. A pretty useless class. The last thing we need to do is to provide a global point of access to the single instance. We do this by keeping a static field available to the class and then implementing either a static public property or method for the client to use.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;// Sealed makes the class not inheritable&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;public sealed class&lt;/span&gt; &lt;span style="color:#33cccc;"&gt;POSRegister&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #region Constructors&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // Make the constructor private&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;     private &lt;/span&gt;POSRegister()&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     {&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #endregion&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     #region Business Properties&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // All properties related to the operation of the&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // class goes here.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;     #endregion&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // define a static field of POSRegister class.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;     private static &lt;/span&gt;&lt;span style="color:black;"&gt;POSRegister _singleInstance;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // define a public static method for the user of this class&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;     // to use.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;     public static &lt;/span&gt;&lt;span style="color:black;"&gt;POSRegister Instance()&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     { &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;          // check if the single instance is already instantiated or &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;          // not&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:green;"&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;          if (&lt;/span&gt;&lt;span style="color:black;"&gt;_singleInstance == null)&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;               _singleInstance = new POSRegister();&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;          return _singleInstance;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;That's it, we have implemented the singleton pattern for the POSRegister class. Now, client can use this class by:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:navy;"&gt;class&lt;/span&gt; &lt;span style="color:#33cccc;"&gt;Program&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:navy;"&gt;     public static &lt;/span&gt;&lt;span style="color:black;"&gt;void Main(string[] args)&lt;/span&gt;&lt;br /&gt;     {&lt;br /&gt;&lt;br /&gt;          POSRegister register = POSRegister.Instance();&lt;br /&gt;     &lt;/p&gt;&lt;p&gt;          &lt;span style="color:#009900;"&gt;//call any methods or properties exposed by the class&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;          register.OpenDrawer();&lt;br /&gt;&lt;/p&gt;&lt;p&gt;     }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The only access to the single instance of the class is through the static Instance method. Users of this class will end up sharing the same instance throughout the application's life.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So we have seen the Singleton pattern implementation in .Net and learned that using this pattern allows us to limit the number of instances created from a class to just one.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Happy coding!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-3882207097905212337?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/3882207097905212337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=3882207097905212337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/3882207097905212337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/3882207097905212337'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2008/05/design-pattern-singleton.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-8675412408325738554</id><published>2007-11-03T15:40:00.001+08:00</published><updated>2007-11-03T15:52:26.964+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MCPD'/><title type='text'></title><content type='html'>&lt;span xmlns=""&gt;Needed Upgrade&lt;br /&gt;&lt;p&gt;I am planning to upgrade my MCSD certification to MCPD. Microsoft provides two upgrade exams for this. The exams are 70-553 and 70-554, which are called Upgrade: MCSD Microsoft.Net Skills to MCPD Enterprise Application Developer by using Microsoft .NET Framework Part 1 and Part 2, respectively. These are the two Professional Developer (PRO) Upgrade Exams for those who have obtained the MCSD on Microsoft .NET certification.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The 70-553 exam measures your ability to develop and implement rich client applications, targeting the Windows Forms platform using .NET Framework 2.0, as well as build interactive, data-driven Web-based applications with Web Forms, ASP.NET, and the .NET Framework for both intranet and internet uses.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The 70-554 exam, on the other hand, measures your ability to develop and implement n-tier solutions targeting both web and rich-client user experiences.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I will be digging deeper into the topics listed on the Microsoft learning website&lt;br /&gt;&lt;a href="http://www.microsoft.com/learning/exams/70-553.mspx"&gt;http://www.microsoft.com/learning/exams/70-553.mspx&lt;/a&gt; and&lt;br /&gt;&lt;a href="http://www.microsoft.com/learning/exams/70-554.mspx"&gt;http://www.microsoft.com/learning/exams/70-554.mspx&lt;/a&gt; for each exam on the next few weeks with the following purposes: first, obviously is to upgrade my .NET knowledge taking advantage of the new features the .NET 2.0 brings; second, is to obtain the MCPD Enterprise Application Developer certification.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-8675412408325738554?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/8675412408325738554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=8675412408325738554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/8675412408325738554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/8675412408325738554'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2007/11/needed-upgrade-i-am-planning-to-upgrade.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-213803392491752397</id><published>2007-06-05T03:34:00.000+08:00</published><updated>2007-06-05T03:40:07.759+08:00</updated><title type='text'></title><content type='html'>Have you seen the Surface?&lt;br /&gt;&lt;br /&gt;Take a look at the endless possibilities here at &lt;a href="http://www.microsoft.com/surface/"&gt;Microsoft Surface&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Amazing!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-213803392491752397?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/213803392491752397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=213803392491752397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/213803392491752397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/213803392491752397'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2007/06/have-you-seen-surface-take-look-at.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-1619916703030047750</id><published>2007-05-28T10:01:00.000+08:00</published><updated>2007-05-28T11:08:20.572+08:00</updated><title type='text'></title><content type='html'>Technology Core Group&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_cUa_e5y2KO8/Rlo5R0Th66I/AAAAAAAAABs/0uBZghdgwjc/s1600-h/CoreTechnicalGroup.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5069427308820032418" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_cUa_e5y2KO8/Rlo5R0Th66I/AAAAAAAAABs/0uBZghdgwjc/s320/CoreTechnicalGroup.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Meeting with the core group on technology is filled with learning and fun. On Friday, May 25, the group welcomed three more members who are as hot as our Q.A. Director, Jun. We welcome Redgie, Shem, and Vic!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-1619916703030047750?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/1619916703030047750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=1619916703030047750' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1619916703030047750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/1619916703030047750'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2007/05/technology-core-group-meeting-with-core.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_cUa_e5y2KO8/Rlo5R0Th66I/AAAAAAAAABs/0uBZghdgwjc/s72-c/CoreTechnicalGroup.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-6645759155437697378</id><published>2007-05-18T10:05:00.001+08:00</published><updated>2007-05-18T11:54:39.546+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><title type='text'></title><content type='html'>&lt;strong&gt;Decorator Design Pattern gives Power&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It is an amazing fact that once you get to understand the concept of designing your software using patterns you will start to get the habit of thinking in patterns in your programming development style. Design patterns just simply work!&lt;br /&gt;&lt;br /&gt;Messing around with the Decorator, I find that I can provide additional behaviors to my objects without resorting to deep heirarchical subclassing. It's like bestowing an object with added powers under your control. If super heroes will put into commercial their unique abilities, I'll be shopping around for Spiderman's skill of travelling with his web; without using a car, I can have more savings. Superman may have something in market too, and i'll definitely be going after his bullet repelling power for a safe vacation to beautiful destinations. Having the power of congress to make laws is desirable; I want to make sure that no one in this planet sells Kryptonite. Now, back to decorators. They are also known as wrappers. You can have a simple guy and wrap him with some web and impenetrateable powers, and you have the new amazing SuperSpider. Really going back to decorators now...&lt;br /&gt;&lt;br /&gt;The Gang of Four says that decorators allow you to attach additional responsibilities(think powers) to an object dynamically. Decorators provide a flexible alternative to subclasing for extending functionality.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the diagram:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_cUa_e5y2KO8/Rk0MmETh60I/AAAAAAAAAA8/dSc2-8wPjhI/s1600-h/DecoratorDiagram.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5065719003991894850" style="CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_cUa_e5y2KO8/Rk0MmETh60I/AAAAAAAAAA8/dSc2-8wPjhI/s320/DecoratorDiagram.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Let us dig into the participants of this pattern.&lt;br /&gt;&lt;br /&gt;The Component defines the interface for objects that can have responsibilites added to them dynamicaly.*&lt;br /&gt;&lt;br /&gt;The ConcreteComponent defines an object to which additional responsibilities can be attached.*&lt;br /&gt;&lt;br /&gt;The Decorator maintains a reference to a Component object and defines an interface that conforms to Component's interface.*&lt;br /&gt;&lt;br /&gt;The ConcreteDecorator adds responsibilities to the component.*&lt;br /&gt;&lt;br /&gt;*Design Patterns, Elements of Reusable Object Oriented Sotftware,&lt;br /&gt;by Gamma, Helm, Johnson and Vlissides&lt;br /&gt;&lt;br /&gt;Note that the Decorator is a Component , and holds or wraps and instance of another Component. Decorator forwards requests to its Component object, and may optionally perform additional operations before and after forwarding the request.&lt;br /&gt;&lt;br /&gt;Implementation.&lt;br /&gt;&lt;br /&gt;Let us walk through a sample implementation of this pattern.&lt;br /&gt;&lt;br /&gt;We are developing a control for our windows application project. This control draws itself on the form container as a simple rectangular box. However, additional requirement comes in and the team lead says that the control should be able to fill a background with some color of choice. Barely started the new design, we received another requirement on our desk. The control should also be able to draw text assigned to it. Additionally, it needs to accomodate displaying an icon inside its border when needed.&lt;br /&gt;&lt;br /&gt;The control requirements:&lt;br /&gt;1. Simple rectangular box control.&lt;br /&gt;2. Background color power.&lt;br /&gt;3. Text displaying power.&lt;br /&gt;4. Icon showing power.&lt;br /&gt;&lt;br /&gt;We can actually make a simple control and provide properties for the second, third and fourth requirements, but we don't want to have those powers attached when we don't need to. We want to be able to select a few or all of those powers according to our need or mood. There are times that the new amazing SuperSpider just want to live like a simple guy; he wants to travel with his feet and get a feel of those smuggled Kryptonites. Remember, with much power , comes great responsibility.&lt;br /&gt;&lt;br /&gt;So we design our solution using the Decorator pattern like this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_cUa_e5y2KO8/Rk0N80Th61I/AAAAAAAAABE/abgLlsTQ_2U/s1600-h/Solution.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5065720494345546578" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_cUa_e5y2KO8/Rk0N80Th61I/AAAAAAAAABE/abgLlsTQ_2U/s320/Solution.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Matching the decorator pattern participants, we have:&lt;br /&gt;&lt;br /&gt;CellBase - Component, an abstract class&lt;br /&gt;TableCell - ConcreteComponent&lt;br /&gt;CellDecoratorBase - Decorator, an abstract class&lt;br /&gt;FillableCellDecorator - ConcreteDecorator, additional behavior&lt;br /&gt;BorderedCelDecorator - ConcreteDecorator, additional behavior&lt;br /&gt;TextCellDecorator - ConcreteDecorator, additional behavior&lt;br /&gt;IconCellDecorator - ConcreteDecorator, additional behavior&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To implement our control in C#.Net, we first define our abstract class Component, CellBase.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;color:#009900;"&gt;public abstract class CellBase&lt;br /&gt;{&lt;br /&gt;   #region Properties&lt;br /&gt;   #endregion&lt;br /&gt;&lt;br /&gt;   // Provide basic painting of control.&lt;br /&gt;   public virtual void Draw(System.Drawing.Graphics graphics,&lt;br /&gt;      int cellWidth, int cellHeight)&lt;br /&gt;   {&lt;br /&gt;      //Get the rectangle bounds.&lt;br /&gt;      Rectangle r = GetRectangle(cellWidth, cellHeight);&lt;br /&gt;&lt;br /&gt;      //Fill the rectangle with default silver color.&lt;br /&gt;      graphics.FillRectangle(Brushes.Silver, r);&lt;br /&gt;&lt;br /&gt;      //Draw a simple border.&lt;br /&gt;      graphics.DrawRectangle(Pens.Black, r);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Helper method. Use to get the bounds of this control&lt;br /&gt;   protected virtual Rectangle GetRectangle(int cellWidth,&lt;br /&gt;      int cellHeight)&lt;br /&gt;   {&lt;br /&gt;      Rectangle r = new Rectangle(columnNo * cellWidth,&lt;br /&gt;         rowNo * cellHeight, cellWidth, cellHeight);&lt;br /&gt;&lt;br /&gt;      return r;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Helper method. Use to check whether this control&lt;br /&gt;   // has been clicked.&lt;br /&gt;   public bool Intersects(int x, int y)&lt;br /&gt;   {&lt;br /&gt;      Rectangle r = GetRectangle(100, 50);&lt;br /&gt;      Rectangle r1 = new Rectangle(x, y, 1, 1);&lt;br /&gt;&lt;br /&gt;      return (r1.IntersectsWith(r));    &lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;TableCell, the ConcreteComponent class, implements the CellBase.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color:#009900;"&gt;&lt;span style="font-size:85%;"&gt;public class TableCell : CellBase&lt;br /&gt;{&lt;br /&gt;   public override string ToString()&lt;br /&gt;   {&lt;br /&gt;      return "I am a simple TableCell";&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then we define CellDecoratorBase, which is the abstract Decorator class.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;color:#009900;"&gt;public abstract class CellDecoratorBase : CellBase&lt;br /&gt;{&lt;br /&gt;   protected CellBase cell;&lt;br /&gt;   public CellDecoratorBase(CellBase cell)&lt;br /&gt;   {&lt;br /&gt;      this.cell = cell;  &lt;br /&gt;      this.TableNo = cell.TableNo;&lt;br /&gt;      this.RowNo = cell.RowNo;&lt;br /&gt;      this.ColumnNo = cell.ColumnNo;           &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Forward requests to containted component.&lt;br /&gt;   public override void Draw(System.Drawing.Graphics graphics,&lt;br /&gt;      int cellWidth, int cellHeight)&lt;br /&gt;   {&lt;br /&gt;      cell.Draw(graphics, cellWidth, cellHeight);&lt;br /&gt;   }&lt;/span&gt;&lt;span style="font-size:85%;color:#009900;"&gt;  &lt;br /&gt;   // Forward requests to containted component.&lt;br /&gt;   public override int TableNo&lt;br /&gt;   {&lt;br /&gt;      get{return cell.TableNo;}&lt;br /&gt;      set{cell.TableNo = value;}&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Forward requests to containted component.&lt;br /&gt;   public override int ColumnNo&lt;br /&gt;   {&lt;br /&gt;      get{return cell.ColumnNo;}&lt;br /&gt;      set{cell.ColumnNo = value;}&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Forward requests to containted component.&lt;br /&gt;   public override int RowNo&lt;br /&gt;   {&lt;br /&gt;      get{return cell.RowNo;}&lt;br /&gt;      set{cell.RowNo = value;}&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;Here now is the FillableCellDecorator, the power to fill a background color.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;color:#009900;"&gt;public class FillableCellDecorator : CellDecoratorBase&lt;br /&gt;{&lt;br /&gt;   private Color backColor;&lt;br /&gt;   public FillableCellDecorator(Color backColor, CellBase cell)&lt;br /&gt;      : base(cell)&lt;br /&gt;   {&lt;br /&gt;      this.backColor = backColor;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override void Draw(System.Drawing.Graphics graphics, int cellWidth, int cellHeight)&lt;br /&gt;   {&lt;br /&gt;      //Call base method&lt;br /&gt;      base.Draw(graphics, cellWidth, cellHeight);&lt;br /&gt;&lt;br /&gt;      //Fill rectangle.&lt;br /&gt;      Rectangle r = base.GetRectangle(cellWidth, cellHeight);&lt;br /&gt;&lt;br /&gt;      //Make sure we don't fill the borders.&lt;br /&gt;      r.Inflate(-1, -1);&lt;br /&gt;      r.Width += 1;&lt;br /&gt;      r.Height += 1;&lt;br /&gt;&lt;br /&gt;      SolidBrush brush = new SolidBrush(backColor);&lt;br /&gt;&lt;br /&gt;      graphics.FillRectangle(brush, r);&lt;br /&gt;&lt;br /&gt;      brush.Dispose();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override string ToString()&lt;br /&gt;   {&lt;br /&gt;       string str = cell.ToString();&lt;br /&gt;       str += "\nBestowed with FillableCellDecorator power,";&lt;br /&gt;       str += "\n      i can now hide myself in a background color.";&lt;br /&gt;       return str;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then our TextCellDecorator, the power to draw text, will be like this.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;color:#009900;"&gt;public class TextCellDecorator : CellDecoratorBase&lt;br /&gt;{&lt;br /&gt;   private Color foreColor;&lt;br /&gt;   private string text;&lt;br /&gt;   public TextCellDecorator(string text, Color foreColor, CellBase cellBase)&lt;br /&gt;      : base(cellBase)&lt;br /&gt;   {&lt;br /&gt;      this.text = text;&lt;br /&gt;      this.foreColor = foreColor;&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override void Draw(Graphics graphics, int cellWidth, int cellHeight)&lt;br /&gt;   {&lt;br /&gt;      //Call contained cell's Draw method.&lt;br /&gt;      base.Draw(graphics, cellWidth, cellHeight);&lt;br /&gt;&lt;br /&gt;      RectangleF r = (RectangleF)GetRectangle(cellWidth, cellHeight);&lt;br /&gt;         r.Inflate(-3, -3);&lt;br /&gt;&lt;br /&gt;      SolidBrush brush = new SolidBrush(foreColor);&lt;br /&gt;      graphics.DrawString(text, new Font("Arial", 14f), brush, r);&lt;br /&gt;      brush.Dispose();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override string ToString()&lt;br /&gt;   {&lt;br /&gt;      string str = cell.ToString();&lt;br /&gt;      str += "\nIt's nice to have a TextCellDecorator power,";&lt;br /&gt;      str += "\n      can you read my text?";&lt;br /&gt;      return str;&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;And in order to have the power to show off some iconic power, we have the IconCellDecorator.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;color:#009900;"&gt;public class IconCellDecorator : CellDecoratorBase&lt;br /&gt;{&lt;br /&gt;   private Image image;&lt;br /&gt;   public IconCellDecorator(Image image, CellBase cell)&lt;br /&gt;      : base(cell)&lt;br /&gt;   {&lt;br /&gt;      this.image = image;&lt;br /&gt; &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override void Draw(Graphics graphics, int cellWidth, int cellHeight)&lt;br /&gt;   {&lt;br /&gt;      //Call contained component's draw method&lt;br /&gt;      base.Draw(graphics, cellWidth, cellHeight);&lt;br /&gt;&lt;br /&gt;      //draw icon.    &lt;br /&gt;      Rectangle r = this.GetRectangle(cellWidth, cellHeight);&lt;br /&gt;      r.Inflate(-3, -3);&lt;br /&gt;      r.Width -= 50;&lt;br /&gt;      r.X = r.X + 50;&lt;br /&gt;   &lt;br /&gt;      graphics.DrawImage(image, r);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override string ToString()&lt;br /&gt;   {&lt;br /&gt;      string str = cell.ToString();&lt;br /&gt;      str += "\nWow! This is great, with IconCellDecorator power,";&lt;br /&gt;      str += "\n      i can now show off my icon.";&lt;br /&gt;      return str;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I added a new Decorator just to drive the point that it is easy to add more behavior as needed. The BorderedCellDecorator allows you to draw a highlighted border around the the control when it is clicked.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;color:#009900;"&gt;public class BorderedCellDecorator : CellDecoratorBase&lt;br /&gt;{&lt;br /&gt;   private Color borderColor;&lt;br /&gt;   private int borderWidth = 4;&lt;br /&gt;   public BorderedCellDecorator(Color borderColor, CellBase cell)&lt;br /&gt;      : base(cell)&lt;br /&gt;   {&lt;br /&gt;      this.borderColor = borderColor;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override void Draw(System.Drawing.Graphics graphics, int cellWidth, int cellHeight)&lt;br /&gt;   {&lt;br /&gt;      base.Draw(graphics, cellWidth, cellHeight);&lt;br /&gt;    &lt;br /&gt;      Rectangle r = GetRectangle(cellWidth, cellHeight);&lt;br /&gt;      r.Inflate(-3, -3);&lt;br /&gt;      Brush b = new SolidBrush(Color.Orange);&lt;br /&gt;      Pen p = new Pen(b, borderWidth);&lt;br /&gt;&lt;br /&gt;      graphics.DrawRectangle(p, r);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public override string ToString()&lt;br /&gt;   {&lt;br /&gt;      string str = cell.ToString();&lt;br /&gt;      str += "\nAdded BorderedCellDecorator power,";&lt;br /&gt;      str += "\n      i can now enclosed myself with a shield border.";&lt;br /&gt;      return str;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally, in order to test our control and its amazing powers, we code something like this.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:85%;color:#009900;"&gt;&lt;br /&gt;public partial class MainForm : Form&lt;br /&gt;{&lt;br /&gt;   public MainForm()&lt;br /&gt;   {&lt;br /&gt;      InitializeComponent();&lt;br /&gt;    &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private int rows;&lt;br /&gt;   private int columns;&lt;br /&gt;&lt;br /&gt;   private void btnDraw_Click(object sender, EventArgs e)&lt;br /&gt;   {&lt;br /&gt;      rows = int.Parse(this.txtRows.Text);&lt;br /&gt;      columns = int.Parse(this.txtColumns.Text);&lt;br /&gt;&lt;br /&gt;      CreateCells(rows, columns);&lt;br /&gt;&lt;br /&gt;      this.Refresh();&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   protected override void OnPaint(PaintEventArgs e)&lt;br /&gt;   {&lt;br /&gt;      if (list == null) return;&lt;br /&gt;      if (list.Count == 0) return;&lt;br /&gt;&lt;br /&gt;      DrawLayout(e.Graphics);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private System.Collections.ArrayList list;&lt;br /&gt;   private void CreateCells(int rows, int columns)&lt;br /&gt;   {&lt;br /&gt;      list = new System.Collections.ArrayList();&lt;br /&gt;&lt;br /&gt;      CellBase cellBase = null;&lt;br /&gt;      Image img = Image.FromFile(@"bell.gif");&lt;br /&gt;&lt;br /&gt;      int counter = 0;&lt;br /&gt;      for (int i = 0; i &lt; rows; i++)&lt;br /&gt;      {&lt;br /&gt;         for (int j = 0; j &lt; columns; j++)&lt;br /&gt;         {&lt;br /&gt;            //cellBase = new TableCell();&lt;br /&gt;            cellBase = new TableCell();&lt;br /&gt;&lt;br /&gt;            cellBase.RowNo = i;&lt;br /&gt;            cellBase.ColumnNo = j;&lt;br /&gt;            cellBase.TableNo = counter;&lt;br /&gt;&lt;br /&gt;            if (chkBackColor.Checked)&lt;br /&gt;               cellBase = new FillableCellDecorator(Color.Purple, cellBase);&lt;br /&gt;&lt;br /&gt;            if (chkText.Checked)&lt;br /&gt;               cellBase = new TextCellDecorator(counter.ToString(), &lt;br /&gt;                   Color.Yellow, cellBase);&lt;br /&gt;&lt;br /&gt;            if (chkImage.Checked)&lt;br /&gt;               cellBase = new IconCellDecorator(img, cellBase);&lt;br /&gt;&lt;br /&gt;            list.Add(cellBase);&lt;br /&gt;            counter++;&lt;br /&gt;         }&lt;br /&gt;      }  &lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   // DrawLayout method using offscreen rendering to avoid flicker.&lt;br /&gt;   private void DrawLayout(Graphics g)&lt;br /&gt;   {&lt;br /&gt;      int cellWidth = 100;&lt;br /&gt;      int cellHeight = 50;&lt;br /&gt;&lt;br /&gt;      Bitmap bmpOff;&lt;br /&gt;      Graphics gxOff;&lt;br /&gt;&lt;br /&gt;      //Create a bitmap the size of the form.&lt;br /&gt;      bmpOff = new Bitmap(ClientRectangle.Width, ClientRectangle.Height);&lt;br /&gt;      SolidBrush blueBrush = new SolidBrush(Color.Blue);&lt;br /&gt;      Pen whitePen = new Pen(Color.White, 3);&lt;br /&gt;&lt;br /&gt;      //Create a Grahics object that is not of the screen.&lt;br /&gt;      gxOff = Graphics.FromImage(bmpOff);&lt;br /&gt;      // gxOff.FillRectangle(new SolidBrush(Color.Red), 0, 0, bmpOff.Width, bmpOff.Height);&lt;br /&gt;&lt;br /&gt;      foreach (CellBase cell in list)&lt;br /&gt;      {&lt;br /&gt;         cell.Draw(gxOff, cellWidth, cellHeight);&lt;br /&gt;      }&lt;br /&gt;   &lt;br /&gt;      // Render the off-screen bitmap onto the screen.&lt;br /&gt;      g.DrawImage(bmpOff, 0, 0, ClientRectangle, GraphicsUnit.Pixel);&lt;br /&gt;&lt;br /&gt;      // Dispose created Graphic object.&lt;br /&gt;      gxOff.Dispose();&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   protected override void OnMouseUp(MouseEventArgs e)&lt;br /&gt;   {&lt;br /&gt;      if (list == null) return;&lt;br /&gt;      if (list.Count == 0) return;&lt;br /&gt;&lt;br /&gt;      foreach (CellBase cell in list)&lt;br /&gt;      {&lt;br /&gt;         if (cell.Intersects(e.X, e.Y))&lt;br /&gt;         {&lt;br /&gt;            Graphics g = this.CreateGraphics();&lt;br /&gt;            &lt;br /&gt;            DrawLayout(g);&lt;br /&gt;&lt;br /&gt;            this.lblCellTypeUnClicked.Text = cell.ToString();&lt;br /&gt;            &lt;br /&gt;            // Wrapped object to have a highlight power.&lt;br /&gt;            CellBase clickedCell = new BorderedCellDecorator(Color.Orange, cell);&lt;br /&gt;            clickedCell.Draw(g, 100, 50);&lt;br /&gt;&lt;br /&gt;            this.lblCellTypeClicked.Text = clickedCell.ToString();&lt;br /&gt;            g.Dispose();&lt;br /&gt;&lt;br /&gt;            break;&lt;br /&gt;         }&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;Here are some images of our application.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_cUa_e5y2KO8/Rk0eekTh62I/AAAAAAAAABM/H8-8L2N2oY8/s1600-h/NoPower.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_cUa_e5y2KO8/Rk0eekTh62I/AAAAAAAAABM/H8-8L2N2oY8/s320/NoPower.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5065738666352175970" /&gt;&lt;/a&gt;&lt;br /&gt;Ordinary Simple control, living as ordinary citizen.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_cUa_e5y2KO8/Rk0e70Th63I/AAAAAAAAABU/7ZXTP9wxAwE/s1600-h/BackgroundPower.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_cUa_e5y2KO8/Rk0e70Th63I/AAAAAAAAABU/7ZXTP9wxAwE/s320/BackgroundPower.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5065739168863349618" /&gt;&lt;/a&gt;&lt;br /&gt;Ordinary Simple control, living as ordinary citizen, but with ability to hide in a shade of purple.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_cUa_e5y2KO8/Rk0fK0Th64I/AAAAAAAAABc/zAHFeioBfNc/s1600-h/TextPower.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_cUa_e5y2KO8/Rk0fK0Th64I/AAAAAAAAABc/zAHFeioBfNc/s320/TextPower.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5065739426561387394" /&gt;&lt;/a&gt;&lt;br /&gt;Ordinary Simple control, living as ordinary citizen, but with ability to hide in a shade of purple and to show its number logo.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_cUa_e5y2KO8/Rk0fZkTh65I/AAAAAAAAABk/xFZjnXTjLb0/s1600-h/IconPower.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_cUa_e5y2KO8/Rk0fZkTh65I/AAAAAAAAABk/xFZjnXTjLb0/s320/IconPower.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5065739679964457874" /&gt;&lt;/a&gt;&lt;br /&gt;The new amazing super ordinary control with all its powers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In conclusion, using decorators we can provide additional behaviors to an object. This we can do without resorting to subclassing. Behaviours can be attached or detached without the knowledge of the object being wrapped or decorated.&lt;br /&gt;&lt;br /&gt;Email me if you want the source codes.&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;br /&gt;&lt;span style="font-size:85%;color:#009900;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-6645759155437697378?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6645759155437697378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6645759155437697378'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2007/05/decorator-design-pattern-gives-power-it.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_cUa_e5y2KO8/Rk0MmETh60I/AAAAAAAAAA8/dSc2-8wPjhI/s72-c/DecoratorDiagram.bmp' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-6449550864955715438</id><published>2007-05-08T23:30:00.000+08:00</published><updated>2007-05-08T23:42:30.851+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Trivias'/><title type='text'></title><content type='html'>&lt;strong&gt;100" T.V., Anyone???&lt;/strong&gt;&lt;br /&gt;I asked a Japanese colleague about some interesting facts.&lt;br /&gt;&lt;br /&gt;I said,"Sumimasen, is it true that Japanese people use their T.V. sets, components, refs and other equipment for a year and replace them after that."&lt;br /&gt;&lt;br /&gt;He replied, "No, no, no! T.V. sets and refs gets five to ten years before replacing them. Too expensive if changed yearly!"&lt;br /&gt;&lt;br /&gt;He also added, "But watches and cellphones, yes, Japanese replace every year."&lt;br /&gt;&lt;br /&gt;So, there goes straight facts from a Japanese himself.&lt;br /&gt;&lt;br /&gt;Next time you're considering of buying that second-hand T.V. at the port area, remember it's not just a year old.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-6449550864955715438?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/6449550864955715438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=6449550864955715438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6449550864955715438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/6449550864955715438'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2007/05/100-t.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-4384329004929755748</id><published>2007-05-08T09:50:00.000+08:00</published><updated>2007-05-09T12:59:08.575+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><title type='text'></title><content type='html'>&lt;strong&gt;Strategy Design Pattern Implementation&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Here is the definition of the Strategy design pattern by GOF(Gang of Four):&lt;br /&gt;“&lt;em&gt;Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.”*&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;And here are the uses or applications by GOF:&lt;br /&gt;&lt;em&gt;1. many related classes differ only in their behavior. Strategies provide a way to configure a class with one of many behaviors.*&lt;br /&gt;2. you need different variants of an algorithm. For example, you might define algorithms reflecting different space/time trade-offs. Strategies can be used when these variants are implemented as a class hierarchy of algorithms [HO87].*&lt;br /&gt;3. an algorithm uses data that clients shouldn't know about. Use the Strategy pattern to avoid exposing complex, algorithm-specific data structures.*&lt;br /&gt;4. a class defines many behaviors, and these appear as multiple conditional statements in its operations. Instead of many conditionals, move related conditional branches into their own Strategy class.*&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Here is the diagram by GOF:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_cUa_e5y2KO8/RkAbC5_mzlI/AAAAAAAAAA0/t-wPblgJBEE/s1600-h/strategy.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5062075717905731154" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_cUa_e5y2KO8/RkAbC5_mzlI/AAAAAAAAAA0/t-wPblgJBEE/s320/strategy.gif" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;I had a chance to notice this design pattern when working on the restaurant management system project. And this proves to be very useful when we have different algorithms that we can use interchangeably. Instead of having switch or if statements, we can encapsulate the different strategies or policies in each own class and then instantiate the one that is relevant.&lt;br /&gt;&lt;br /&gt;We try to walk through a sample implementation of this pattern with a tax calculation project. Different countries have different tax calculation policy. If our system is targeted to an international environment it needs to have some way to load the correct tax calculator. We do not want angry Japanese waving their samurais when they have been charged with special tax on their Sake just because we use the tax calculator intended for Singapore. At the same time, it should be simple enough to change tax calculators with a few code change or no code change at all.&lt;br /&gt;&lt;br /&gt;In the example that follows we will encapsulate the tax calculation policy for each country on its own strategy class. Each strategy will derived from a base abstract class. This way, we can use each of these strategies interchangeably without the knowledge of the client class.&lt;br /&gt;&lt;br /&gt;Here is the uml diagram for our solution.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_cUa_e5y2KO8/RkAbC5_mzkI/AAAAAAAAAAs/Zp4ITxdbqdU/s1600-h/Strategy.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5062075717905731138" style="CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_cUa_e5y2KO8/RkAbC5_mzkI/AAAAAAAAAAs/Zp4ITxdbqdU/s320/Strategy.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;Now, for the implementation we define first the strategy abstract class.&lt;br /&gt;Here is the code in C#.Net.&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public abstract class TaxCalculationStrategyBase&lt;br /&gt;{&lt;br /&gt;   // Maintain an instance of the context class&lt;br /&gt;   protected OrderInfo orderInfo;&lt;br /&gt;&lt;br /&gt;   // Set the instance of the context class.&lt;br /&gt;   public void SetTaxableInfo(OrderInfo orderInfoBase)&lt;br /&gt;   {&lt;br /&gt;      this.orderInfo = orderInfoBase;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Concrete strategies will provide implementation&lt;br /&gt;   // for this abstract method.&lt;br /&gt;   public abstract void CalculateTax();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;Then we create a tax calculator concrete strategy implementation for Japan:&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class JapanTaxCalculationStrategy : TaxCalculationStrategyBase&lt;br /&gt;{&lt;br /&gt;   // Default constructor&lt;br /&gt;   public JapanTaxCalculationStrategy()&lt;br /&gt;   {&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Implement specific algorithm.&lt;br /&gt;   public override void CalculateTax()&lt;br /&gt;   {&lt;br /&gt;      // Japan uses this formula for computing&lt;br /&gt;      // inclusive taxes.&lt;br /&gt;      base.orderInfo.TaxAmount =&lt;br /&gt;            (base.orderInfo.OrderAmount + 10) / (100 + 10);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;And, here is another tax calculator concrete strategy implementation for Singapore:&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class SingaporeTaxCalculationStrategy : TaxCalculationStrategyBase&lt;br /&gt;{&lt;br /&gt;   // Default constructor&lt;br /&gt;   public SingaporeTaxCalculationStrategy()&lt;br /&gt;   {&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Singapore may use tax calculation&lt;br /&gt;   // formula different from Japan&lt;br /&gt;   public override void CalculateTax()&lt;br /&gt;   {&lt;br /&gt;      base.orderInfo.TaxAmount =&lt;br /&gt;           base.orderInfo.OrderAmount * 10 / 100;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We also make use of a factory to give us a specific tax calculator.&lt;br /&gt;&lt;br /&gt;Below is one version of the factory.&lt;br /&gt;This class is the point of change when we try to add more calculators.&lt;br /&gt;This version, though, requires code compilation.&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class TaxCalculatorFactory&lt;br /&gt;{&lt;br /&gt;   // Context objects uses this static method&lt;br /&gt;   // to create a specific tax calculator.&lt;br /&gt;   public static TaxCalculationStrategyBase&lt;br /&gt;       CreateTaxCalculator()&lt;br /&gt;   {&lt;br /&gt;      TaxCalculationStrategyBase calculator = null;&lt;br /&gt;&lt;br /&gt;      // We can retrieve a tax calculator name by using&lt;br /&gt;      // an application configuration file.&lt;br /&gt;      string calculatorName =&lt;br /&gt;        System.Configuration.ConfigurationSettings.AppSettings&lt;br /&gt;           ["TaxCalculator"];&lt;br /&gt;&lt;br /&gt;      // We can add appropriate case statements&lt;br /&gt;      // to new calculators.&lt;br /&gt;      switch (calculatorName)&lt;br /&gt;      {&lt;br /&gt;         case "Japan":&lt;br /&gt;            calculator = new JapanTaxCalculationStrategy();&lt;br /&gt;            break;&lt;br /&gt;         case "Singapore":&lt;br /&gt;            calculator =&lt;br /&gt;               new SingaporeTaxCalculationStrategy();&lt;br /&gt;            break;&lt;br /&gt;         // Add more case statements here.&lt;br /&gt;         // case "Philippine":&lt;br /&gt;         //     calculator =&lt;br /&gt;         //         new PhilippineTaxCalculationStrategy();&lt;br /&gt;         //     break;&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      return calculator;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below is another version of a factory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We can use reflection to instantiate the type of the calculator based on a configuration file.&lt;br /&gt;This way, we only change the configuration file with no code compilation steps needed. The configuration file entry includes the full name of the class that will be instantiated.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class TaxCalculatorFactory&lt;br /&gt;{&lt;br /&gt;   public static TaxCalculationStrategyBase&lt;br /&gt;     CreateTaxCalculator()&lt;br /&gt;   {&lt;br /&gt;      // We assume the calculator class is located in&lt;br /&gt;      // the same assembly as the client.&lt;br /&gt;      // But we can easily load it from any assembly.&lt;br /&gt;      Assembly assembly = Assembly.GetExecutingAssembly();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      // App.config: ["TaxCalculatorName"] values - &lt;br /&gt;      //   "TaxCalculators.SingaporeTaxCalculatorStrategy"&lt;br /&gt;      string className =&lt;br /&gt;          System.Configuration.ConfigurationSettings.AppSettings&lt;br /&gt;               ["TaxCalculatorName"];&lt;br /&gt;&lt;br /&gt;      // Use reflection to create an instance.&lt;br /&gt;      // Make sure that we cast the result of the&lt;br /&gt;      // CreateInstance method.&lt;br /&gt;      TaxCalculationStrategyBase calculator;&lt;br /&gt;      calculator =&lt;br /&gt;        (TaxCalculationStrategyBase)&lt;br /&gt;             assembly.CreateInstance(className);&lt;br /&gt;&lt;br /&gt;      return calculator;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is the context class that uses the tax calculators:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class OrderInfo&lt;br /&gt;{&lt;br /&gt;   // Default Constructor&lt;br /&gt;   public OrderInfo()&lt;br /&gt;   {&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Context class contains or knows only&lt;br /&gt;   // the abstract class but has no knowledge&lt;br /&gt;   // of any concrete strategy classes.&lt;br /&gt;   protected TaxCalculationStrategyBase calculator;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   // Provides a method to set a strategy&lt;br /&gt;   public void SetTaxCalculationStrategy&lt;br /&gt;       (TaxCalculationStrategyBase calculator)&lt;br /&gt;   {&lt;br /&gt;      this.calculator = calculator;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Client can call this method for tax computation.&lt;br /&gt;   public void CalculateTax()&lt;br /&gt;   {&lt;br /&gt;      // Use the factory to create calculator instance.&lt;br /&gt;      this.calculator =&lt;br /&gt;          TaxCalculatorFactory.CreateTaxCalculator();&lt;br /&gt;&lt;br /&gt;      // Set the context of the strategy.&lt;br /&gt;      // This type of assignment is often called&lt;br /&gt;      // dependency injection.&lt;br /&gt;      calculator.SetTaxableInfo(this);&lt;br /&gt;&lt;br /&gt;      // This effectively sets the TaxAmount property.&lt;br /&gt;      calculator.CalculateTax();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Other properties of the context class.&lt;br /&gt;   private int orderNo;&lt;br /&gt;   public int OrderNo&lt;br /&gt;   {&lt;br /&gt;      get&lt;br /&gt;      {&lt;br /&gt;         return orderNo;&lt;br /&gt;      }&lt;br /&gt;      set&lt;br /&gt;      {&lt;br /&gt;         orderNo = value;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private double orderAmount;&lt;br /&gt;   public double OrderAmount&lt;br /&gt;   {&lt;br /&gt;      get&lt;br /&gt;      {&lt;br /&gt;         return orderAmount;&lt;br /&gt;      }&lt;br /&gt;      set&lt;br /&gt;      {&lt;br /&gt;         orderAmount = value;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private double taxAmount;&lt;br /&gt;  &lt;br /&gt;   // This method will be called by the concrete strategy&lt;br /&gt;   // using dependency injection&lt;br /&gt;   // or otherwise also termed "inversion of control"&lt;br /&gt;   public double TaxAmount&lt;br /&gt;   {&lt;br /&gt;      get&lt;br /&gt;      {&lt;br /&gt;         return taxAmount;&lt;br /&gt;      }&lt;br /&gt;      set&lt;br /&gt;      {&lt;br /&gt;         taxAmount = value;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public double TotalAmount&lt;br /&gt;   {&lt;br /&gt;      get&lt;br /&gt;      {&lt;br /&gt;         return orderAmount + taxAmount;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We can use a client with the following code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public partial class OrderForm : Form&lt;br /&gt;{&lt;br /&gt;   public OrderForm()&lt;br /&gt;   {&lt;br /&gt;      InitializeComponent();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private void calculateButton_Click&lt;br /&gt;      (object sender, EventArgs e)&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;      // Instantiate the context object.&lt;br /&gt;      OrderInfo orderInfo = new OrderInfo();&lt;br /&gt;&lt;br /&gt;      // Assign properties&lt;br /&gt;      orderInfo.OrderNo = 9999; &lt;br /&gt;      orderInfo.OrderAmount =&lt;br /&gt;          double.Parse(this.orderAmountTextBox.Text);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      // Call tax calculation&lt;br /&gt;      orderInfo.CalculateTax();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      // Show results.&lt;br /&gt;      this.lblOrderAmount.Text =&lt;br /&gt;          orderInfo.OrderAmount.ToString();&lt;br /&gt;      this.lblTaxAmount.Text =&lt;br /&gt;          orderInfo.TaxAmount.ToString();&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Several things to note here:&lt;br /&gt;1. The context class (OrdeInfo) doesn’t have to know which specific tax calculator it is using. It only knows the base abstract class(TaxCalculationStrategyBase). The factory takes care of the creation of the specific calculator based on the configuration file.&lt;br /&gt;2. The client class(OrderForm) doesn’t have to know any tax calculators at all. The tax calculation procedure is encapsulated inside the context class(OrderInfo).&lt;br /&gt;3. If we want to use a specific calculator, we simply change the configuration file&lt;br /&gt;4. If we want to create another tax calculator for another country, for example, Philippine taxation, we simple derived from the base abstract class (TaxCalculationStrategyBase) and code inside the specific tax calculation implementation.&lt;br /&gt;&lt;br /&gt;In conclusion, the strategy design pattern allows us to encapsulate algorithms that varies into its own classes. This way we avoid code complexity inside the context class.&lt;br /&gt;&lt;br /&gt;Please email me if you want the source code used in this article.&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;*Design Patterns Elements of Reusable Object Oriented Software&lt;br /&gt;by Gamma, Helm, Johnson, Vlissides&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#009900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_cUa_e5y2KO8/Rj_dUp_mzjI/AAAAAAAAAAk/eJ7FWAgQ-7Q/s1600-h/Strategy.gif"&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:95;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-4384329004929755748?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/4384329004929755748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=4384329004929755748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/4384329004929755748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/4384329004929755748'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2007/05/strategy-design-pattern-implementation.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_cUa_e5y2KO8/RkAbC5_mzlI/AAAAAAAAAA0/t-wPblgJBEE/s72-c/strategy.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-2262111267196494680</id><published>2007-05-03T17:53:00.000+08:00</published><updated>2007-05-08T09:53:51.552+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design Patterns'/><title type='text'></title><content type='html'>Design Patterns for Blasters&lt;br /&gt;&lt;br /&gt;We had a meeting with some of the senior developers last April 27th. The goal was to address project delays. We started by identifying the causes of the problem. Identified areas that needed strengthening are project management and skill set augmentation. As developers, we agreed to take action on the latter task. Our first response is to have better programming development style by incorporating design patterns in our analysis and coding. This is really a pretty exciting endeavour to pursue in the next few weeks...or years.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-2262111267196494680?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/2262111267196494680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=2262111267196494680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2262111267196494680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/2262111267196494680'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2007/05/design-patterns-for-blasters-blah-blah.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37210378.post-116280340872551175</id><published>2006-11-06T16:55:00.000+08:00</published><updated>2006-11-13T17:36:00.525+08:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/2654/4175/1600/IMG_0067.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/2654/4175/320/IMG_0067.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;trying to test what's blogging blah blah blah is all about.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37210378-116280340872551175?l=dotnet2me.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnet2me.blogspot.com/feeds/116280340872551175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37210378&amp;postID=116280340872551175' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/116280340872551175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37210378/posts/default/116280340872551175'/><link rel='alternate' type='text/html' href='http://dotnet2me.blogspot.com/2006/11/trying-to-test-whats-blogging-blah.html' title=''/><author><name>Roy Saberon</name><uri>http://www.blogger.com/profile/00110433360267166413</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
