<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>Dot Net Nerd</title>
        <link>http://inphoteck.com/Default.aspx</link>
        <description>Racetracker to NerdTracker</description>
        <language>en-US</language>
        <copyright>Desirea Herrera</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <image>
            <title>Dot Net Nerd</title>
            <url>http://inphoteck.com/images/RSS2Image.gif</url>
            <link>http://inphoteck.com/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Inversion of Control</title>
            <category>Share Learning Area</category>
            <category>Unit Testing</category>
            <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>July 11 - 17 Twitter Links I Want to Read</title>
            <category>Twitterings</category>
            <link>http://inphoteck.com/archive/2009/07/11/july-11-17.aspx</link>
            <description>&lt;img src="http://inphoteck.com/aggbug/24.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/11/july-11-17.aspx</guid>
            <pubDate>Sat, 11 Jul 2009 15:02:02 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/24.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/11/july-11-17.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/24.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Brainstorming Rooms</title>
            <category>Thought Provoking Stuff</category>
            <link>http://inphoteck.com/archive/2009/07/08/23.aspx</link>
            <description>Wujec talks about 3 parts of the brain and how we get meaning out of imagery, motion, etc. He talked about how the brain visually interrogates what it sees, develops a series of questions and then develops a mental model. 

&lt;img src="http://inphoteck.com/aggbug/23.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/08/23.aspx</guid>
            <pubDate>Wed, 08 Jul 2009 19:45:15 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/23.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/08/23.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/23.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Must See: Clay Shirky: How social media can make history</title>
            <category>Social Media</category>
            <link>http://inphoteck.com/archive/2009/07/08/22.aspx</link>
            <description>This is probably the most thought provoking video I've seen in quite a while. Shirky talks about how media is increasingly a result of amatuer or citizen reporters. It's no longer controlled by professionals &amp; government. It talks about China's Great Firewall and how they now have to shut down services to control the amatuer producers. 

&lt;img src="http://inphoteck.com/aggbug/22.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/08/22.aspx</guid>
            <pubDate>Wed, 08 Jul 2009 19:20:59 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/22.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/08/22.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/22.aspx</wfw:commentRss>
        </item>
        <item>
            <title>July 6-10 Twitter Links I want to read.</title>
            <category>Twitterings</category>
            <link>http://inphoteck.com/archive/2009/07/07/21.aspx</link>
            <description>&lt;img src="http://inphoteck.com/aggbug/21.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/07/21.aspx</guid>
            <pubDate>Tue, 07 Jul 2009 18:18:05 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/21.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/07/21.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/21.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Unit Testing Review List</title>
            <category>Share Learning Area</category>
            <category>Unit Testing</category>
            <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>Contact-CaptureBait : Capturing Contact Information</title>
            <category>Contact CaptureBait</category>
            <category>Social Media</category>
            <link>http://inphoteck.com/archive/2009/07/05/18.aspx</link>
            <description>&lt;img src="http://inphoteck.com/aggbug/18.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/07/05/18.aspx</guid>
            <pubDate>Sun, 05 Jul 2009 20:21:24 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/18.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/07/05/18.aspx#feedback</comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/18.aspx</wfw:commentRss>
        </item>
        <item>
            <title>User Defined Casts</title>
            <category>Share Learning Area</category>
            <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>
            <category>Share Learning Area</category>
            <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>How to Define Your Project </title>
            <category>Web Development For Customers</category>
            <link>http://inphoteck.com/archive/2009/04/05/15.aspx</link>
            <description>&lt;p&gt;A lot of times I get asked to take a look at an idea for a web site that a friend or colleague not involved with the IT industry has come upon. Most people have no idea what it takes to build a web site or a piece of software. Many times the idea is not very well thought out. A lot of people get caught up in their ideas and don’t consider the exactly how much work it might take to actually build the web site or software. That’s not their fault because they generally don’t know what it takes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So what does it take to define your idea?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The first step in actually defining your idea would be up to figure out who is going to use your site or software. Software architects actually define these as users. When you talk to a web developer or web designer, they’ll describe an actual person or persona. A persona describes a person based on their experience, their job and their age. This gives the developer a sense of the skill set of the user. &lt;/p&gt;
&lt;p&gt;Once you understand who would use the software, you need to understand how they will use the software or web site. By thinking of all the different types of activities the individual user might perform on the web site or software, you can start to understand the scope of your project. Developers might take this information and build up what we call Use Case Scenarios. Use Case Scenarios help us get an overview of the project.&lt;/p&gt;
&lt;p&gt;Another thing to take a look at is the data involved. You need to know exactly what pieces of information will be input into the system and output from the system. That information needs to be broken down into a small a piece of data as possible.&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;Someone’s address would be broken down into first name, last name, street address, city, state, and the zip code. It’s very important to identify every piece of data.&lt;/p&gt;
&lt;p&gt;Once you understand who will use your web site or software and the data that’s input into and output from the web site or software, you need to think about specific rules. How are the users allowed to put data into your web site or software? What are they allowed to do with the data on the screen? These are your business rules. You may have a few of them or you may have all lot of them.&lt;/p&gt;
&lt;p&gt;Something else that will help you define the scope of your project are interfaces. If it’s a web site, what pages will you need? If you know of a web site that is similar, to a look at the pages included on that web site. If it’s a piece of software, look at similar software. Write down a list to pages or key interfaces that you know you will need. Look back at the activities the users will perform. Those activities will help you define what pages you need.&lt;/p&gt;
&lt;p&gt;By going through this process, you’ll get a better idea of the scope of your project. Once you know the scope of your project, you’ll understand the estimates supplied by the vendors. A low estimate may mean that the developer doesn’t really understand your project.&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;Lowball figures can also mean poorly built software. Poorly built software Can and does cost you money. When you hire a developer to fix or redevelop the web site or software, they won’t be willing to give you a discount. Giving you a discount means the developer paid for the cost of building it the first time.&lt;/p&gt;&lt;img src="http://inphoteck.com/aggbug/15.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Desirea Herrera</dc:creator>
            <guid>http://inphoteck.com/archive/2009/04/05/15.aspx</guid>
            <pubDate>Mon, 06 Apr 2009 00:45:13 GMT</pubDate>
            <wfw:comment>http://inphoteck.com/comments/15.aspx</wfw:comment>
            <comments>http://inphoteck.com/archive/2009/04/05/15.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://inphoteck.com/comments/commentRss/15.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>