<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Share Learning Area</title>
        <link>http://inphoteck.com/category/11.aspx</link>
        <description>Learning new stuff and reviewing old stuff about .Net, about programming, about developing web and windows programs, databases and anything to do with computers.</description>
        <language>en-US</language>
        <copyright>Desirea Herrera</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <item>
            <title>Inversion of Control</title>
            <link>http://inphoteck.com/archive/2009/07/26/inversion-of-control.aspx</link>
            <description>&lt;p&gt;While I was reading The Art of Unit Testing by Roy Osherove, I found references to topics that required more investigation. Inversion of Control or IoC was one of them. I vaguely remember reading about it somewhere but being a tech trainer of way too many technologies, and now a lab developer (basically quality assurance checking &amp;amp; screnshotting of MOC labs &amp;amp; labs from other companies),  I've let some topics slide away in favor of stuff related to my job. It's part of the reason I started writing this blog, to hone my skillsets. And now, on to Inversion of Control:&lt;/p&gt;
&lt;p&gt;Inversion of Control is based on the idea of flow control. When you start programming, you learn to write code in classes and methods that control the flow of the program. Your code calls methods that do something and answer back to your code. In Inversion of Control, your central classes wait for the phone call that tells them things they need to know to perform their own activities. &lt;/p&gt;
&lt;p&gt;The &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control"&gt;example onWikipedia &lt;/a&gt;shows a serverFacade class that initially takes an object parameter to its respondToRequest method. The object is a request for data. The respondToRequest method then uses a DAO (Data Access Object) to get data via it's getData method and convert the data via the aspect's convertData method after using the businesslayer object to test if that object is valid. Based on the first implementation, the serverFacade object is coupled to the DAO object. In the lab of OOP, coupling is discourage.  Since the serverFacade shouldn't know anything about how to convert data, or what to return if the data conversion fails (it is only a facade after all), the second implementation moves all the data conversion and return decisions to the DAO class. This in effect, decouples the two classes.&lt;/p&gt;
&lt;p&gt;In Martin Fowler's article &lt;a href="http://martinfowler.com/articles/injection.htm"&gt;Inversion of Control Containers and the Dependency Injection pattern&lt;/a&gt;, he uses a simple class that splits out finding all movies to a finder class. Problems arise when his friends want that functionality for their programs. They might want to store movies in a different format or in a database. An interface or abstract class solves this by allowing the new developer to create a new class to pass to the MovieLister class that can find all of the movies in their own way via their own implementation. &lt;/p&gt;
&lt;p&gt;The key points to both of these examples is that :&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;The classes need to have very specific goals. If an activity doesn't correspond to the method or class, it needs to be moved out. &lt;/li&gt;
    &lt;li&gt;In order to allow for different external dependencies like how the movies are stored and retrieved, create an interface or abstract class. (This idea makes your program easier to fit different situations as needed.) &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Based on Fowler's explanation, what we're really talking about is setting up "plugins" for our software. Essentially you now have the ability to plugin any external movie storage into his MovieLister class. Data storage is only one of the types of external or outside dependencies your software could come across. It could also rely on network availability, configurations as well as configuration files or data stored on a network, or outside services. &lt;/p&gt;
&lt;p&gt;Fowler asserts that Inversion of Control is a common characteristic of a framework. In &lt;font face="Arial"&gt;&lt;a href="http://martinfowler.com/bliki/InversionOfControl.html"&gt;Inversion of Control&lt;/a&gt; he says:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;"A framework embodies some abstract design, with more behavior built in. In order to use it you need to insert your behavior into various places in the framework either by subclassing or by plugging in your own classes. The framework's code then calls your code at these points."&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Fowler also thinks Inversion of Control Containers is too generic and renames this to Dependency Injection and further discusses the Server Locator pattern. I highly suggest you read his full article.  &lt;/p&gt;
&lt;p&gt;Going back to the Wikipedia article, it mentiosn that Inversion of Control is also known as the Hollywood Principle. Basically is the ""Don't call us, we'll call you." concept. IoC takes the integration and configuration of the system out of the application, and performs dependency injection.  &lt;/p&gt;
&lt;p&gt;Further Reading:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeproject.com/KB/aspnet/IOCDI.aspx"&gt;Design pattern – Inversion of control and Dependency injection &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.devx.com/Java/Article/27583"&gt;Design Better Software with the Inversion of Control Pattern&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc707904.aspx"&gt;Inversion of Control Pattern&lt;/a&gt;&lt;/p&gt;

&lt;img src="http://inphoteck.com/aggbug/25.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/26/inversion-of-control.aspx</guid>
            <pubDate>Sun, 26 Jul 2009 17:04:32 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/25.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/26/inversion-of-control.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/25.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Unit Testing Review List</title>
            <link>http://inphoteck.com/archive/2009/07/07/20.aspx</link>
            <description>&lt;img src="http://inphoteck.com/aggbug/20.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/07/20.aspx</guid>
            <pubDate>Tue, 07 Jul 2009 17:26:18 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/20.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/07/20.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/20.aspx</wfw:commentRss>
        </item>
        <item>
            <title>User Defined Casts</title>
            <link>http://inphoteck.com/archive/2009/07/05/17.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;There are times when you may find yourself writing code to move data from a type you defined to another type either predefined or user defined. Of course we are all aware of polymorphism between derived types. This isn't always possible or practical depending on your intentions. It is particularly hard when you're converting between a primiritive type and a user defined type. The answer to this dilemma is to define your own cast.&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;Review&lt;/font&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;font size="2"&gt;As you know, casting is the process of converting one datatype to another. Implicit conversions are automatic and can occur when no data will be lost. Data can be lost when the amount of memory space reserved for the target datatype is less than the memory space used used by the source datatype. Just like trying to pour 2 cups of water into a 1 cup container, data can be lost like the water that spills over. The answer to this dilemma is the explicit conversion where you explicitly acknowledge that the data will be lost and allow it to be lost.  These types of casts are available for predefined datatypes. Normally the predefined casts and polymorphism will suffice, but for those times when you find yourself moving data manually between types, user defined casts are the answer.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font size="2"&gt;Type conversions for your own datatypes are possible but you must define them yourself. You do this by defining your cast within one of the classes from which you will cast. You will also need to mark your cast operation as either implicit or explicitr. A good rule of thumb is to define your cast as explicit if therre is any risk of an exception or if any of the data in the source type might fail to be transferred to the target type. Casting operators can be written into structs and classes. The syntax is similar to overloading an operator as shown below:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#ff6600" size="3"&gt;&lt;strong&gt;// The person class is an abstract class defining basic person information.&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;
public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;abstract&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Person&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; firstName;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; lastName;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Person(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; first, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; last)&lt;br /&gt;
{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.firstName = first;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.lastName = last;&lt;br /&gt;
}&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Person()&lt;br /&gt;
{}&lt;br /&gt;
&lt;/font&gt;&lt;font size="2"&gt;}&lt;br /&gt;
&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2" /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;strong&gt;&lt;font color="#ff6600" size="3"&gt;// The Farrier class inherits from the Person class. &lt;br /&gt;
&lt;/font&gt;&lt;/strong&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; : &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Person&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; expertise;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Farrier(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; first, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; last, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; expertise):&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;base&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(first,last)&lt;br /&gt;
{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.expertise = expertise;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#339966"&gt;&lt;strong&gt;// Note the explicit conversion operator. &lt;br /&gt;
// &lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font color="#339966"&gt;&lt;strong&gt;This does not technically need to be explicit as no data will be lost and no exceptions will occur.&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;static&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;explicit&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;operator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; value)&lt;br /&gt;
{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; fName = value.firstName;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; lName = value.lastName;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; specialty = value.expertise;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;em&gt;(fName, lName, specialty);&lt;br /&gt;
}&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt; &lt;strong&gt;&lt;font color="#ff6600" size="3"&gt;&lt;font color="#ff6600" size="3"&gt;&lt;strong&gt;// This is the Veterinarian class that in herits from the Person class.&lt;/strong&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;
public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; : &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Person&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;specialty;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;Veterinarian(&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;first,&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;last,&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;specialty):&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;base&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;(first,last)&lt;/font&gt;&lt;br /&gt;
&lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;.specialty&lt;/font&gt;&lt;font color="#000000"&gt; = specialty;&lt;/font&gt;&lt;br /&gt;
&lt;font color="#000000"&gt;}&lt;br /&gt;
&lt;/font&gt;&lt;br /&gt;
&lt;strong&gt;&lt;font color="#339966"&gt;// Note the implicity conversion operator.&lt;/font&gt; &lt;/strong&gt;&lt;br /&gt;
&lt;/font&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;static&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;implicit&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;operator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;value)&lt;br /&gt;
{&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;fName = value.firstName;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;lName = value.lastName;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;expertise = value.specialty;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;fName, lName, expertise);&lt;/font&gt;&lt;br /&gt;
&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;img alt="" src="http://www.inphoteck.com/Images/UserDefinedCastsForm.jpg" /&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff6600" size="3"&gt;// The Form code.&lt;/font&gt;&lt;/strong&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;
public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;partial&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Form1&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; : &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Form&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Form1()&lt;br /&gt;
{&lt;br /&gt;
InitializeComponent();&lt;br /&gt;
}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#339966"&gt;&lt;strong&gt;// Using the implicit conversion&lt;/strong&gt;&lt;/font&gt; &lt;br /&gt;
&lt;/font&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; farrierToVet_Click(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;EventArgs&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; e)&lt;br /&gt;
{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; a = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;(farrierFName.Text, farrierLName.Text, farrierExpertise.Text);&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; b = (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt;)a;&lt;br /&gt;
veterinarianFName.Text = b.firstName;&lt;br /&gt;
veterinarianLName.Text = b.lastName;&lt;br /&gt;
veterinarianSpecialty.Text = b.specialty;&lt;br /&gt;
}&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;&lt;font color="#339966"&gt;// Using the explicit conversion.&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; vetTofarrier_Click(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;EventArgs&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; e)&lt;br /&gt;
{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; b = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Veterinarian&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;(veterinarianFName.Text, veterinarianLName.Text, veterinarianSpecialty.Text);&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;em&gt;&lt;font size="2"&gt; a = b; &lt;br /&gt;
farrierFName.Text = a.firstName;&lt;br /&gt;
farrierLName.Text = a.lastName;&lt;br /&gt;
farrierExpertise.Text = a.expertise;&lt;br /&gt;
}&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;&lt;font color="#339966"&gt;// Attempting to use polymorphism.&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;em&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; polymorphicFarriertoVet_Click(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;EventArgs&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt; e)&lt;br /&gt;
{&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; a = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Farrier&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;(farrierFName.Text, farrierLName.Text, farrierExpertise.Text);&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Person&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;em&gt; c = a;&lt;br /&gt;
&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;strong&gt;&lt;em&gt;// The following causes compile error: &lt;br /&gt;
&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;strong&gt;&lt;em&gt;//Cannot implicitly convert type 'UserDefinedCasts.Person' to 'UserDefinedCasts.Veterinarian'. &lt;br /&gt;
&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;strong&gt;&lt;em&gt;//An explicit conversion exists (are you missing a cast?) C:\Documents and Settings\Desirea\My Documents\Visual Studio 2008\Projects\UserDefinedCasts\UserDefinedCasts\Form1.cs 43 30 UserDefinedCasts&lt;br /&gt;
&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;strong&gt;&lt;em&gt;//&lt;br /&gt;
&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;strong&gt;&lt;em&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Veterinarian b = c;&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;MessageBox&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Show(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;"Conversions would not work even with explicit conversion. Person does not contain a casting operator."&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;,&lt;br /&gt;
&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;"Polymorphic Conversion Not Possible"&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;,&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;MessageBoxButtons&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;.OK,&lt;br /&gt;
&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;MessageBoxIcon&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;em&gt;.Error);&lt;br /&gt;
}&lt;br /&gt;
&lt;/em&gt;&lt;/strong&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;/font&gt;&lt;font color="#ff6600" size="3"&gt;&lt;font color="#ff6600" size="3"&gt;&lt;strong&gt;&lt;font color="#000000"&gt;Usage&lt;/font&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;font color="#000000" size="2"&gt;User defined casts are a good way to reduce code. If you find yourself writing code to move data from one of your datatypes to another, defining your own casts within one of the classes or structs will make the job a lot simpler. It's also a good solution when inheritance won't resolve the issue via polymorphism. You can also decouple classes that while containing similar data do not necessarily need to be tied together as in the case of integers and floats. I'm sure someone has some more suggestions as to how to use user defined casts. Feel free to post them below.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;img src="http://inphoteck.com/aggbug/17.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/05/17.aspx</guid>
            <pubDate>Sun, 05 Jul 2009 18:17:21 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/17.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/05/17.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/17.aspx</wfw:commentRss>
        </item>
        <item>
            <title>C# Preprocessor Directives </title>
            <link>http://inphoteck.com/archive/2009/04/14/16.aspx</link>
            <description>&lt;div /&gt;
&lt;div&gt;Here’s just a few notes on preprocessor directives. &lt;/div&gt;
&lt;div&gt;They’re never terminated by a semi-colon.&lt;/div&gt;
&lt;div&gt;They can never be translated to any commands in code &lt;/div&gt;
&lt;div&gt;They affect the compilation process &lt;/div&gt;
&lt;div&gt;They can prevent compilation of positions of source code. This is great for having 2 release versions of your application. It’s also great for eliminating debug information source code.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;# define&lt;/strong&gt; identifier&lt;/div&gt;
&lt;div&gt;This directive tells the compiler that the identifier or symbol exists. It does not define a valid you for that identifier. These symbols work as a true or false designator.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;# undef identifier&lt;/div&gt;
&lt;div&gt;This directive tells the compiler that the identifier or symbol should cease the existing. Any test for the identifier will result in a false reading.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In either case nothing will happen if the symbol does or does not exist. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#if&lt;/strong&gt; Identifier&lt;/div&gt;
&lt;div&gt;//some code&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#endif&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;This directive combination tells the compiler to conditionally execute the code block between the directives based on the return of the identifier. If the identifier has been defined using the #define directive, the code will execute. If it has not been defined or has been undefined using the #undef directive the code will not execute.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#elif&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;This directive acts the same way as and else if statement. It fits in with the #if and the #endif directives.&lt;/div&gt;
&lt;div&gt;#if Identifier&lt;/div&gt;
&lt;div&gt;//some code&lt;/div&gt;
&lt;div&gt;#elif otherIdentifier&lt;/div&gt;
&lt;div&gt;//some code&lt;/div&gt;
&lt;div&gt;#endif&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;C# Allows you to use comparison operators like &amp;amp;&amp;amp; and = =.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#warning   #error&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;These directives cause warning or error messages when the compiler encounters them. The error directive will display any text to the user as if it were a compile error and then stops compilation whereas the warning directive will continue compiling the application.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#region&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#endregion&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;These directives work in conjunction with each other to organize the layout of your code. They don’t affect compilation.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#line&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;This directive will alter the file name and line number information to output by compiler warnings and error messages. This is most useful when coding in conjunction with some other assembly that might alter the code you type in before sending the line number to the compiler and the line numbers may not match up correctly.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;#pragma&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;This directive will suppress or restore compiler warnings. It can be implemented on class or method levels.&lt;/div&gt;
&lt;div&gt;                                 &lt;/div&gt;&lt;img src="http://inphoteck.com/aggbug/16.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/04/14/16.aspx</guid>
            <pubDate>Wed, 15 Apr 2009 03:48:51 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/16.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/04/14/16.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/16.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Programming Articles Archive</title>
            <link>http://inphoteck.com/archive/2009/01/06/14.aspx</link>
            <description>&lt;p&gt;I found this question over at stackoverflow.com about what are the best articles on programming. I've compiled the list of suggestions here for easy reference. I'm guessing it will take some time to get through all of these articles myself. &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;a&gt;&lt;/a&gt;&lt;a rel="nofollow" href="http://norvig.com/21-days.html"&gt;Teach Yourself Programming in Ten Years&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Painless Functional Specifications, by Joel Spolsky.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.joelonsoftware.com/articles/fog0000000036.html"&gt;Why Bother?&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.joelonsoftware.com/articles/fog0000000035.html"&gt;What's a Spec?&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.joelonsoftware.com/articles/fog0000000034.html"&gt;But... How?&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.joelonsoftware.com/articles/fog0000000033.html"&gt;Tips&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;The &lt;a rel="nofollow" href="http://www.indiangeek.net/wp-content/uploads/Programmer%20competency%20matrix.htm"&gt;Programmer Competency Matrix&lt;/a&gt; is an excellent reference to gauge your development skills.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.gotw.ca/publications/concurrency-ddj.htm"&gt;The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.lips.utexas.edu/ee382c-15005/Readings/Readings1/05-Broo87.pdf"&gt;No Silver Bullet - Essence and Accidents of Software Engineering&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://tomayko.com/writings/rest-to-my-wife"&gt;How I Explained REST to My Wife&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.codinghorror.com/blog/archives/001150.html"&gt;Coding Without Comments&lt;/a&gt;,&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://steve.yegge.googlepages.com/being-the-averagest"&gt;http://steve.yegge.googlepages.com/being-the-averagest&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.laputan.org/mud/"&gt;Big Ball of Mud&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.norvig.com/spell-correct.html"&gt;"How to Write a Spelling Corrector"&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.paulgraham.com/hp.html"&gt;Hackers and Painters&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.md.chalmers.se/~rjmh/Papers/whyfp.html"&gt;Why functionnal programming matters&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;bunch of very good ones &lt;a rel="nofollow" href="http://www.prairienet.org/~dsb/artcls.htm"&gt;here&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html"&gt;The Law of Leaky Abstractions&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.paulgraham.com/hp.html"&gt;Great Hackers&lt;/a&gt; by Paul Graham&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.smashingmagazine.com/2008/01/31/10-principles-of-effective-web-design/"&gt;10 Principles Of Effective Web Design&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.joelonsoftware.com/articles/Wrong.html"&gt;Making Wrong Code Look Wrong&lt;/a&gt; by Joel Spolsky on Hungarian Notation.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.codinghorror.com/blog/archives/000749.html"&gt;Code Tells You How, Comments Tell You Why&lt;/a&gt; by Jeff Atwood.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://people.redhat.com/drepper/cpumemory.pdf"&gt;What Every Programmer Should Know About Memory [pdf]&lt;/a&gt; by Ulrich Drepper&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://docs.sun.com/source/806-3568/ncg_goldberg.html"&gt;What Every Computer Scientist Should Know About Floating-Point Arithmetic&lt;/a&gt; by Goldberg.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.randsinrepose.com/archives/2004/07/10/what_to_do_when_youre_screwed.html"&gt;What to do when you're screwed&lt;/a&gt; by Rands&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.developerdotstar.com/printable/mag/articles/reeves_design.html"&gt;"What is Software Design"&lt;/a&gt; by Jack W. Reeves&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/"&gt;The Cathedral and the Bazaar&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Eric Sink's &lt;a rel="nofollow" href="http://www.ericsink.com/articles/Four_Questions.html"&gt;My life as a code economist&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;Chris Brumme's excellent essay on &lt;a rel="nofollow" href="http://blogs.msdn.com/cbrumme/archive/2004/02/20/77460.aspx"&gt;finalization in .NET&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://blogs.msdn.com/cbrumme/archive/2003/10/01/51524.aspx"&gt;gory inner details of the exception model in .NET&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;Ian Griffiths on &lt;a rel="nofollow" href="http://www.interact-sw.co.uk/iangblog/2004/09/23/threadless"&gt;doing work without threads&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;Ian Griffiths again on &lt;a rel="nofollow" href="http://www.interact-sw.co.uk/iangblog/2004/04/20/whatlocks"&gt;deadlock complexities&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;Raymond Chen on &lt;a rel="nofollow" href="http://blogs.msdn.com/oldnewthing/archive/2005/08/22/454487.aspx"&gt;software development taxes&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;Jan Mikovsky on &lt;a rel="nofollow" href="http://miksovsky.blogs.com/flowstate/2005/10/the_fractal_nat.html"&gt;the fractal nature of UI design problems&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://steve-yegge.blogspot.com/2008/10/programmers-view-of-universe-part-1.html"&gt;A programmer's view of the Universe, part 1: The fish&lt;/a&gt; by Steve Yegge&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html"&gt;life in the kingdom of nouns&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html"&gt;Why numbering should start at zero&lt;/a&gt; by E.W. Dijkstra&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.lospadres.info/thorg/lbb.html"&gt;Secrets of the Little Blue Box&lt;/a&gt; by Ron Rosenbaum&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://steve-yegge.blogspot.com/2007/01/pinocchio-problem.html"&gt;The Pinocchio Problem&lt;/a&gt; by Steve Yegge&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html"&gt;Go To Statement Considered Harmful&lt;/a&gt; by Edsger W. Dijkstra&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://alistair.cockburn.us/Characterizing+people+as+non-linear,+first-order+components+in+software+development"&gt;Characterizing people as non-linear, first-order components in software development&lt;/a&gt; by Alistair Cockburn&lt;/li&gt;
    &lt;li&gt;This is very specific to Java development, but an excellent overview of memory management issues by Attila Szegedi. Makes me want to buy him a beer :)&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.szegedi.org/articles/memleak2.html"&gt;A day in the life of a memory leak hunter&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.szegedi.org/articles/memleak2.html"&gt;Yet another day in the life of a memory leak hunter&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.szegedi.org/articles/memleak3.html"&gt;Memory leak hunting still doesn't end, or: Serialization also requires a bit of manually imposed amnesia&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Anything in &lt;a rel="nofollow" href="http://www.hanselminutes.com/"&gt;Hanselminutes&lt;/a&gt;, or &lt;a rel="nofollow" href="http://www.hanselman.com/"&gt;Scott's Blog&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.bluegraybox.com/blog/2004/12/02/picture-hanging/"&gt;Picture Hanging&lt;/a&gt; by Colin MacDonald. &lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.fastcompany.com/magazine/06/writestuff.html"&gt;They Write The Right Stuff&lt;/a&gt;, a timeless article by Charles Fishman published in FastCompany 1996.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://samizdat.mines.edu/howto/HowToBeAProgrammer.html?p=1"&gt;How to be a Programmer: A Short, Comprehensive, and Personal Summary&lt;/a&gt; by Robert L. Read&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.securecoding.cert.org/confluence/display/seccode/CERT+Secure+Coding+Standards"&gt;Cert Secure Coding Standards&lt;/a&gt; is a gem&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.codinghorror.com/blog/archives/001184.html"&gt;Coding: It's Just Writing&lt;/a&gt; by Jeff Attwood.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.joelonsoftware.com/items/2008/11/26.html"&gt;Exploding Offer Season&lt;/a&gt; by Joel Spolsky&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.smashingmagazine.com/2008/12/15/10-useful-techniques-to-improve-your-user-interface-designs/"&gt;10 Useful Techniques To Improve Your User Interface Designs&lt;/a&gt; by Dmitry Fadeyev.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://se.ethz.ch/~meyer/publications/computer/quality_first.pdf"&gt;Practice To Perfect: The Quality First Model&lt;/a&gt; by Bertrand Meyer.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.acm.org/ubiquity/views/t_burns_1.html"&gt;Effective Unit Testing&lt;/a&gt; by Tim Burns.&lt;/li&gt;
    &lt;li&gt;&lt;a rel="nofollow" href="http://www.objectmentor.com/resources/publishedArticles.html"&gt;Object Mentor Articles&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
If any of them get out of date, just mention it here with a comment and the updated link.&lt;img src="http://inphoteck.com/aggbug/14.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/01/06/14.aspx</guid>
            <pubDate>Wed, 07 Jan 2009 05:48:30 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/14.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/01/06/14.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/14.aspx</wfw:commentRss>
        </item>
        <item>
            <title>What's a Service Contract in WCF?</title>
            <link>http://inphoteck.com/archive/2008/12/03/10.aspx</link>
            <description>&lt;p&gt;It's important to first understand what defines a service contract. Basically a service contract defines the group of operations in a service, the operation's signatures and message datatypes. It also defines the location of the operations and the specific protocols and serialization formats that support communication with the service.&lt;/p&gt;
&lt;p&gt;In WCF, we define a service contracts with method and class attributes. The following is a simple service with it's associated attributes: &lt;/p&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;// Step 1 Import the necessary namespace&lt;br /&gt;using System;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;&lt;br /&gt;namespace myHoakyService&lt;br /&gt;{&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;   //Step 2 Use the ServiceContract attribute to &lt;br /&gt;   //&lt;/font&gt;&lt;font color="#993300"&gt;&lt;font face="Arial" size="2"&gt;identify a class or interface that defines a &lt;br /&gt;   //WCF service contract for clients.&lt;br /&gt;  [ServiceContract(Namespace=&lt;/font&gt;&lt;a href="http://localhost/HoakyService"&gt;&lt;font face="Arial" size="2"&gt;http://localhost/HoakyService&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt;)]&lt;br /&gt;   public interface IHoakyService&lt;br /&gt;  {&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;       //Step 3 Identify Service Operations &lt;br /&gt;       //with the OperationContract &lt;br /&gt;       //attribute and expose it to clients&lt;br /&gt;       [OperationContract]&lt;br /&gt;       string HoakyMethod();&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;       //Note: You can even include methods &lt;br /&gt;       //that are not exposed to clients.&lt;br /&gt;       string HoakyNonAccessibleMethod();&lt;br /&gt;  }&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font color="#993300"&gt;&lt;font face="Arial" size="2"&gt;  //Note: You can even apply the ServiceContract to classes&lt;br /&gt;  [ServiceContract(Namespace=&lt;/font&gt;&lt;a href="http://locahost/HoakyClassService"&gt;&lt;font face="Arial" size="2"&gt;http://locahost/HoakyClassService&lt;/font&gt;&lt;/a&gt;&lt;font face="Arial" size="2"&gt;)]&lt;br /&gt;  public class HoakyClassService&lt;br /&gt;  {	&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;     [OperationContract]&lt;br /&gt;     string HoakyClassMethod()&lt;br /&gt;     {&lt;br /&gt;       return "This is a hoaky method.";&lt;br /&gt;     }&lt;br /&gt;  }&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;//Step 4 Design a class that implements the ServiceContract Interface&lt;br /&gt;  public class HoakyClass : IHoakyService&lt;br /&gt;  {&lt;br /&gt;    public string HoakyMethod()&lt;br /&gt;    {&lt;br /&gt;      return HoakyNonAccessibleMethod();&lt;br /&gt;    }&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;    string HoakyNonAccessibleMethod()&lt;br /&gt;    {&lt;br /&gt;      return "This is a hoaky method.";&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Microsoft's recommendation is to restrict your Service Contracts to interfaces because it defines the group of operations and&lt;br /&gt;
 the operation signatures. Let's read between the lines here. A group of operations is basically the interface's methods, and the operation signatures are well the method signatures. Nothing difficult about that now is there?&lt;/p&gt;
&lt;p&gt;The other benefits of using interfaces for Service Contracts are that they can be extended by other interfaces.&lt;br /&gt;
 You can also create classes that implement multiple service contract interfaces whereas a class can only implement one service contract. Versioning becomes easier because old clients can still point to the old service contract interface while newer clients can point to a newer service contract interface.&lt;/p&gt;
&lt;h3&gt;Pass By Value&lt;/h3&gt;
&lt;p&gt;You're parameters and return values represent the method signatures or operation signatures. The biggest thing to understand with WCF is that everything is pass by value or as I like to say "pass by copy". This is actually standard in many interoperable applications. &lt;br /&gt;
The next biggest thing to remember is that both parameters and return values must be serializable(convert to XML). Windows Communication Foundation (WCF) uses the DataContractSerializer as its default serialization engine to convert data into XML and to convert XML back into data. &lt;br /&gt;
The following datatypes are handled by the DataContractSerializer:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Primitive types such as integers and strings &lt;/li&gt;
    &lt;li&gt;Simple composite types such as DateTime &lt;/li&gt;
    &lt;li&gt;XML-based types such as XmlElement &lt;/li&gt;
    &lt;li&gt;Collections &lt;/li&gt;
    &lt;li&gt;Enumerations &lt;/li&gt;
    &lt;li&gt;Types marked with the SerializableAttribute attribute &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information see:  &lt;a href="http://msdn.microsoft.com/en-us/library/ms731923.aspx"&gt;Types Supported by the Data Contract Serializer &lt;/a&gt; &lt;/p&gt;
&lt;p&gt; Note to VB programmers: The value of the parameter names in the operation signature are part of the contract and are case sensitive.&lt;/p&gt;
&lt;p&gt;It is possible to change the exposed name of your return values and parameters. You would use the MessageParameterAttribute attribute as follows:&lt;/p&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.ServiceModel;&lt;br /&gt;using System.Text;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;namespace MyHoakierService&lt;br /&gt;{&lt;br /&gt;  [ServiceContract(Namespace="http://localhost/HoakierService")]&lt;br /&gt;  public interface IHoakierService{&lt;br /&gt;    [OperationContract]&lt;br /&gt;    [return:MessageParameter(Name = "HoakyOut")]&lt;br /&gt;    string HoakyMethod([MessageParameter(Name = "HoakyIn")]string input);&lt;br /&gt;  }&lt;/font&gt;&lt;/pre&gt;
&lt;h3&gt;On to Data Contracts&lt;/h3&gt;
&lt;p&gt;Wait, we had service contracts and now we have data contracts? Well we just mentioned that WCF methods work on a Pass By Value or "pass by copy" method. Why do we need data contracts? Ok, data contracts make an operation more widely accessible by a variety of clients. In other words, it's more interoperable. &lt;/p&gt;
&lt;p&gt;We implement data contracts by simply marking our types with DataContractAttribute and DataMemberAttribute attributes. Data contracts are opt-in contracts. You have to apply the data contract attribute for them to be serialized.&lt;/p&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;using System;&lt;br /&gt;using System.Runtime.Serialization;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;namespace myHoakyService&lt;br /&gt;{&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;[DataContract]&lt;br /&gt;public class Hoakster&lt;br /&gt;{&lt;br /&gt;    // Step 1: Serialize a memeber.&lt;br /&gt;    [DataMember]&lt;br /&gt;    internal string HoakyName;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;    // Step 2: Serialize a private member.&lt;br /&gt;    [DataMember]&lt;br /&gt;    private int HoakyNumber;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;    // Note: No DataMemberAttribute = No seralized data.&lt;br /&gt;    private string HoakyNonSerialized;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;    // Note: Not serialized&lt;br /&gt;    private string HoakyNonSerializedValue;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;    //Step 3: serializing a Property that accesses a non-serialized member.&lt;br /&gt;    [DataMember]&lt;br /&gt;    public string HoakySeralizedValue&lt;br /&gt;    {&lt;br /&gt;        get { return HoakyNonSerializedValue;}&lt;br /&gt;        set { HoakyNonSerializedValue = value; }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;}&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Be aware, you're not limited to using Datacontract attributes and primitives. You can use other serialization methods as explained here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms732038.aspx "&gt;Specifying Data Transfer in Service Contracts &lt;/a&gt; (Some interesting stuff in there about Message Contracts which I'll cover in another post.)&lt;br /&gt;
&lt;/p&gt;
&lt;h3&gt;Message Exchange Patterns&lt;/h3&gt;
&lt;p&gt;&lt;br /&gt;
Service operations are supported by a SOAP message exchange that transfers application data back and forth, &lt;br /&gt;
including the data required to support standard security, &lt;br /&gt;
transaction, and session-related features. &lt;br /&gt;
This being the case, the service operation signature dictates a certain underlying message exchange pattern (MEP) &lt;br /&gt;
that can support the data transfer and the features an operation requires. Note that now an operation signature is building up to include security, transaction, and session data.&lt;/p&gt;
&lt;p&gt;There are three patterns in the WCF programming model that you can use. &lt;br /&gt;
The request/reply is just like it sounds. A client sends a request with parameters and waits for the server to reply with a return value. Note that the return message/value could be an empty message as a result of a void return on an operation.&lt;br /&gt;
Another return type would be a Soap FaultException that notifies the client of an error.&lt;/p&gt;
&lt;p&gt;A one-way operation is one in which a client invokes an operation and continues processing after WCF writes the message to the network. Note that the client wouldn't be processing any FaultException errors returned to it. To designate an operation as one-way apply the OperationContractAttribute with a IsOneWay=true property.&lt;/p&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;[OperationContractAttribute(IsOneWay=true)]&lt;br /&gt;&lt;/font&gt;&lt;font face="Arial" color="#993300" size="2"&gt;void hoakyMethod(string HoakyInput);&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;A duplex pattern allows the service and the client to send messages to each other independently whether using one-way or request/reply messaging. This works well for asynchronous operations or services that have to notify a client with a message. When you design a duplex contract, you  design two interfaces; one interface to send messages from client to service and a callback interface to send messages from the service to the client. &lt;/p&gt;
&lt;p&gt;You start by declaring your ServiceContract on your receiver interface (the one that the client sends the messages to). You add a CallBackContract property that points to the callback interface.  And yes, this implementation tells the client "Hi Hoaky Client".&lt;/p&gt;
&lt;pre&gt;&lt;font face="Arial" color="#993300" size="2"&gt;//Step 1: Define your ServiceContract for the receiving interface.&lt;br /&gt;[ServiceContract(Namespace = &lt;span style="COLOR: maroon"&gt;&lt;span style="COLOR: maroon"&gt;&lt;a href="http://localhost/MyHoakyDuplexService"&gt;http://localhost/MyHoakyDuplexService&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, &lt;br /&gt;                 SessionMode=SessionMode.Required,&lt;br /&gt;                 CallbackContract=typeof(IHoakyCallback))]&lt;br /&gt;public interface IHoaky&lt;br /&gt;{&lt;br /&gt;    [OperationContract(IsOneWay=true)]&lt;br /&gt;    void Hoaky();    &lt;br /&gt;}&lt;br /&gt;// Step 2: Create a callback interface so the service can say something to the client.&lt;br /&gt;// This defines the methods that the service can call on the client. So yes, if your client&lt;br /&gt;// needs to hear from the service, it must implement this interface.&lt;br /&gt;public interface IHoakyCallback&lt;br /&gt;{&lt;br /&gt;   //Note: We're still using the OperationContract attribute. &lt;br /&gt;   //This time we're using the OneWay &lt;br /&gt;   //property so the operation can talk in a one way direction.&lt;br /&gt;    [OperationContract(IsOneWay = true)]&lt;br /&gt;    void HoakyCaller(string hoakified);&lt;br /&gt;}&lt;br /&gt;//Step 3: Create a Class that implements the Service Contract Interface&lt;br /&gt;[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]&lt;br /&gt;public class HoakyService : IHoaky&lt;br /&gt;{&lt;br /&gt;    string hoakified;&lt;br /&gt;    IHoakyCallback callback = null;&lt;br /&gt;    public HoakyService()&lt;br /&gt;    {&lt;br /&gt;        hoakified= "Hi Hoaky Client";&lt;br /&gt;        //Note: The following allows the service to call a method on the client.&lt;br /&gt;        callback = OperationContext.Current.GetCallbackChannel&amp;lt;IHoakyCallback&amp;gt;();&lt;br /&gt;    }&lt;br /&gt;    public void Hoaky()&lt;br /&gt;    {&lt;br /&gt;        callback.HoakyCaller(hoakified);        &lt;br /&gt;    }&lt;br /&gt;}&lt;/font&gt;&lt;/pre&gt;
&lt;h3&gt;Security&lt;/h3&gt;
&lt;p&gt;You have 2 choices. You can set the secuirty of your message in the binding of the endpoint or you can turn off the message security in the binding. In most cases your system level settings will take care of what you need. Only in special circumstances would you set specific message protecting in the binding of an endpoint for specific messages. &lt;/p&gt;
&lt;p&gt;There are more topics to cover but I think I'll leave those topics to another post. &lt;/p&gt;&lt;img src="http://inphoteck.com/aggbug/10.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2008/12/03/10.aspx</guid>
            <pubDate>Wed, 03 Dec 2008 16:04:43 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/10.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2008/12/03/10.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/10.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Trouble in Paradise or Quick Find to the Rescue</title>
            <link>http://inphoteck.com/archive/2008/12/02/9.aspx</link>
            <description>&lt;p&gt;So I was working on this Windows Communication Foundation tutorial.  The tutorial came as a pre-existing solution that you would update via WCF tasks. I'd successfully done the C# version after many attempts. Most of my problems stemmed from typos during the tutorial. Then came the VB version of the tutorial. Well, there actually wasn't much VB or C# in the labs so I can't use the excuse that I work mostly in C#. That sucks. &lt;/p&gt;
&lt;p&gt;So what was the error? I kept running the lab and got an error that the Internet endpoint did not exist. I'd run it several times. Well as it turned out, I had a typo buried inside of the app.config file. A quick Find for the errored address allowed me to pinpoint the error of my ways. &lt;/p&gt;
&lt;p&gt;Sometimes you just can't beat a good quick search of your project. And so, being your own spelling police really can save the day.&lt;/p&gt;&lt;img src="http://inphoteck.com/aggbug/9.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2008/12/02/9.aspx</guid>
            <pubDate>Wed, 03 Dec 2008 05:17:15 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/9.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2008/12/02/9.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/9.aspx</wfw:commentRss>
        </item>
        <item>
            <title>What is Windows Communication Foundation?</title>
            <link>http://inphoteck.com/archive/2008/12/01/7.aspx</link>
            <description>&lt;p&gt;What we're looking at is at it's basic level a Service Oriented Architecture. It basically allows you to write services for other applications to use.  It combines COM, COM+, and MSMQ, .NET Remoting, ASMX, System.Messaging, and .NET Enterprise Services. The basic concepts of interoperability, performance, transactional support as well as security differ from client application to client application. WCF strives to meet the needs of different client applications.&lt;/p&gt;
&lt;p&gt;Basically a WCF client and a WCF service use the WCF which addresses communication challenges between a service and a diverse range of client requirements. Microsoft identifies the following as the most important aspects of WCF:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Unification of existing .NET Framework communication technologies. &lt;/li&gt;
    &lt;li&gt;Support for cross-vendor interoperability, including reliability, security, and transactions. &lt;/li&gt;
    &lt;li&gt;Explicit service orientation. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;WCF can communicate via Web Services using SOAP or messages like RSS.  The ability to communicate using SOAP enables WCF to communicate with a wide variety of clients which are not necessarily built using WCF. I found it highly interesting to come across WS Specifications which are used to add security features, end-to-end reliability, and transactional support  to the SOAP message. &lt;/p&gt;
&lt;p&gt;Microsoft did some performance testing to compare it to .Net relevant technologies. (&lt;a href="http://go.microsoft.com/fwlink/?LinkId=94274."&gt;go.microsoft.com/fwlink/&lt;/a&gt;)  With WCF configured using BasicHttpBinding, the throughput performance of WCF was better than ASP.NET Web Services by 19%, 21% and 36% for 1, 10 and 100 objects in a message, respectively. When both operated over HTTPS,  WCF outperformed ASP.NET Web Services by 16%, 18% and 26% for 1, 10 and 100 objects in a message respectively. The results when compared to Web Services Enhancements  was even better.  .Net Enterprise Services and  .Net Remoting showed similar improvements in performance. &lt;/p&gt;
&lt;p&gt;Installing WCF won't break pre-existing applications built in any of these .Net technologies. You do have to be aware of some interoperability issues with the WS specficiations. &lt;a href="http://msdn.microsoft.com/en-us/library/ms732008.aspx"&gt;Migrating WSE 3.0 Web Services to WCF&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Messaging&lt;/h3&gt;
&lt;p&gt;WCF is based on message passing communication. Messages of any type can be uniformly represented which means that WCF can utilize a single API across a variety of transport methods.  In WCF terms, a client sends a message and a  server responds to messages. Endpoints are points of contact for both services and clients. They describe in a standard-based way where messages should be sent, how they should be sent, and the messages format. A service might have multiple endpoints for different purposes. A client's endpoint would be compatible with one of the service's endpoints.  &lt;/p&gt;
&lt;p&gt;In a larger picture, you can think of a service as a sort of communications center. It would accept calls from cell phones, telephones, and maybe even email.  On the other hand, each of those devices/applications only interact with one endpoint on the communications center. &lt;/p&gt;
&lt;p&gt;At the core of any communication is the transport protocol. These can range from HTTP to TCP and those that support MSMQ nodes on a Peer Network. WCF is extensible so you can add more transport mechanisms as needed. &lt;/p&gt;
&lt;p&gt;WCF natively supports the following message formats but is also extensible in this respect:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Text encoding, an interoperable encoding. &lt;/li&gt;
    &lt;li&gt;Message Transmission Optimization Mechanism (MTOM) encoding, which is an interoperable way for efficiently sending unstructured binary data to and from a service. &lt;/li&gt;
    &lt;li&gt;Binary encoding for efficient transfer. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;WCF also supports messaging patterns as pertains to each message format.  &lt;/p&gt;
&lt;p&gt;The easiest way for the beginner to think of WCF is to think of it as a large switchboard. Behind the switchboard are different functions that need to be reused by a variety of customers. Each customer might speak a different language and use different devices like a cell phone, a VoiP application, or a telephone. The WCF switchboard has endpoints configured that each of these customers can use to send messages to which the WCF switchboard responds. &lt;/p&gt;
&lt;p&gt;For more fundamentals of WCF, I suggest the following article from Microsoft : &lt;a href="http://msdn.microsoft.com/en-us/library/ms731079.aspx"&gt;Fundamental Windows Communication Foundation Concepts&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And this is just the beginning... &lt;!----&gt;&lt;/p&gt;&lt;img src="http://inphoteck.com/aggbug/7.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2008/12/01/7.aspx</guid>
            <pubDate>Mon, 01 Dec 2008 20:25:26 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/7.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2008/12/01/7.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/7.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Unit Testing in Visual Studio</title>
            <link>http://inphoteck.com/archive/2008/12/01/6.aspx</link>
            <description>&lt;p&gt;The more I learn, the more I know I don't know. As an MCT, it's my job to continually update my skills. To that end, I've been delving into things that aren't covered in the courses I teach.  Things like Unit Testing.&lt;/p&gt;
&lt;h3&gt;What's A Unit Test?&lt;/h3&gt;
&lt;p&gt;With Visual Studio 2005 and 2008, you get the ability in some versions like Team System to create a Test Project to do Unit Testing. Before I start talking about creating a unit test, let's review the basics. A unit test verifies that a function actually performs it's duties. Now, there are black box and white box types of tests. A black box test only tests that a function accepts only the datatypes it's designed to accept and returns the data or no data that it's expected to return.  In other words, you put in certain stuff and get certain stuff back. Now a white box test actually allows you to know what's going on between the input and output. White box testing ensures that you actually are testing all code pathways. It's called "Code Coverage".  For more information about Unit Testing you can check the following links:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.marcclifton.com/tabid/82/Default.aspx"&gt;Advanced Unit Testing Part 1&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Unit_testing"&gt;Wikipedia on Unit Testing&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It's important to write your Unit Tests before you actually develop your application. After identifying the requirements of the application, a unit test can define the functionality of different pieces of the code before it's written. Unit testing helps to maintain the integrity of your code during refactoring. You'll always be able to test that the function still fulfills it's intended purpose.&lt;/p&gt;
&lt;h3&gt;Generating a Unit Test in Visual Studio&lt;/h3&gt;
&lt;p&gt;The simplest method of generating a unit test in Visual Studio is to right click the name of any method and select &lt;strong&gt;Create Unit Tests&lt;/strong&gt;. Be aware that not all versions of Visual Studio support Unit Testing. You can also create a new Test Project to add to the project and then, a test class can be added by either selecting from &lt;strong&gt;Add New Test&lt;/strong&gt; popup or by selecting &lt;strong&gt;Unit Test&lt;/strong&gt; from &lt;strong&gt;Add&lt;/strong&gt; menu. This brings up the &lt;strong&gt;Create Unit Tests&lt;/strong&gt; screen where multiple methods to be tested can be selected.&lt;/p&gt;
&lt;p&gt;Visual Studio only actually writes a basic stub for the Unit Test. It's up to you to fill in the blanks for the application. You'll do things like test that the return values are the correct datatype and within the expected value range. You'll also check to make sure the funciton only accepts the data it's suppose to accept. &lt;/p&gt;
&lt;p&gt;You'll normally see the following assert statement:&lt;br /&gt;
Assert.Inconclusive("A method that does not return a value cannot be verified.");&lt;/p&gt;
&lt;p&gt;If you ran the Unit Test for the method you're testing right now, You'd see the error message  "Assert.Inconclusive failed. A method that does not return a value cannot be verified." Now, if you comment out the Assert.Inconclusive statement, you'll have a test that passes because the unit test method isn't testing for anything. That's not going to help. &lt;/p&gt;
&lt;p&gt;You'll have to write some test code with the Assert statement. You'll be supplying the method with specific values and comparing the results with the expected result in an Assert statement. &lt;/p&gt;
&lt;h3&gt;Unit Test Design is Obviously Important&lt;/h3&gt;
&lt;p&gt;Obviously, did I say that again? Yup, I did. You've got to think of all possibilities going into the method and all coming out of the method. This takes some prior planning.  Now it might seem backwards based on what I've just said about right clicking a method and/or creating a Test Project to add to your application. The key is to think out your Unit Tests ahead of time so that you can implement them easily using Visual Studio. &lt;/p&gt;
&lt;p&gt;Additional Resources&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms182532.aspx"&gt;msdn.microsoft.com/en-us/library/ms182532.aspx&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.geekzone.co.nz/vs2008/4819"&gt;www.geekzone.co.nz/vs2008/4819&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.developingfor.net/visual-studio/first-foray-into-unit-testing-with-visual-studio-2008.html"&gt;www.developingfor.net/visual-studio/first-foray-into-unit-testing-with-visual-studio-2008.html&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.geekzone.co.nz/vs2008/4819"&gt;www.geekzone.co.nz/vs2008/4819&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://haacked.com/archive/2008/07/22/unit-test-boundaries.aspx"&gt;haacked.com/archive/2008/07/22/unit-test-boundaries.aspx&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Good Luck Unit Testing&lt;/p&gt;
&lt;p&gt;I've written an additional Unit Testing Review with more links @ &lt;a id="viewpost_ascx_TitleUrl" title="Title of this entry." href="http://inphoteck.com/archive/2009/07/07/20.aspx"&gt;Unit Testing Review List&lt;/a&gt; &lt;font face="Arial"&gt; &lt;/font&gt;&lt;br /&gt;
&lt;/p&gt;&lt;img src="http://inphoteck.com/aggbug/6.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2008/12/01/6.aspx</guid>
            <pubDate>Mon, 01 Dec 2008 08:50:39 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/6.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2008/12/01/6.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/6.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>