<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Joseph Bulger IV &#187; Technology</title>
	<atom:link href="http://josephbulger.com/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://josephbulger.com</link>
	<description>God, Family, Church, Engineering</description>
	<lastBuildDate>Thu, 29 Apr 2010 15:10:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating an PagedList&lt;T&gt; that uses AJAX</title>
		<link>http://josephbulger.com/technology/creating-an-pagedlistt-that-uses-ajax/</link>
		<comments>http://josephbulger.com/technology/creating-an-pagedlistt-that-uses-ajax/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 16:05:58 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[linkedIn]]></category>
		<category><![CDATA[paging]]></category>

		<guid isPermaLink="false">http://josephbulger.com/technology/creating-an-pagedlistt-that-uses-ajax/</guid>
		<description><![CDATA[I’ve been using this PagedList functionality that i found from a blog article Rob Conery put up, and a control I found by Robert Muehsig which I’ve really enjoyed using so far.
One of the things that was missing from the functional set that I ended up needing was the ability to page the list, but [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been using this PagedList functionality that i found from a <a href="http://blog.wekeroad.com/2007/12/10/aspnet-mvc-pagedlistt/" target="_blank">blog article Rob Conery</a> put up, and <a href="http://code-inside.de/blog-in/2008/04/08/aspnet-mvc-pagination-view-user-control/" target="_blank">a control I found by Robert Muehsig</a> which I’ve really enjoyed using so far.</p>
<p>One of the things that was missing from the functional set that I ended up needing was the ability to page the list, but through issuing AJAX requests instead of the typical post back.</p>
<p>So I went off and extended the existing model to support AJAX requests, and thought I would share it in case anyone else needed to do the same thing.</p>
<p>I guess the best place to start would be the use case.  So to start I created a control that encapsulates the Paging UI layout and calls I need.  The use of the original control looks like this:</p>
<pre class="brush: csharp;">

Html.RenderPartial(&quot;AjaxPagination&quot;,
    new AjaxPaginationViewData
        {
            PageIndex = Model.PageIndex,
            Action = &quot;CondoPage&quot;,
            Controller = &quot;Home&quot;,
            AjaxOptions =
                new AjaxOptions { UpdateTargetId = &quot;updatedContent&quot; },
            TotalCount = Model.TotalCount,
            PageSize = Model.PageSize,
            NumberOfPagesToEachSide = 2
        }
);
</pre>
<p>The new AJAX functionality is called similarly:</p>
<pre class="brush: csharp;">

&lt;% using (Ajax.BeginForm(&quot;SomePage&quot;,
        &quot;SomeController&quot;,
        new AjaxOptions { UpdateTargetId = &quot;updatedContent&quot; })) { %&gt;

        &lt;% Html.RenderPartial(&quot;AjaxPagination&quot;,
                new AjaxPaginationViewData {
                        PageIndex = Model.PageIndex,
                        Action = &quot;SomeAction&quot;,
                        Controller = &quot;SomeController&quot;,
                        AjaxOptions = new AjaxOptions
                                { UpdateTargetId = &quot;updatedContent&quot; },
                        TotalCount = Model.TotalCount,
                        PageSize = Model.PageSize,
                        NumberOfPagesToEachSide = 2
                });%&gt;

&lt;% } %&gt;
</pre>
<p>A couple things to note. You’ll notice that the AJAX control is rendered inside a Ajax.BeginForm. This is because I’m using the Microsoft.Ajax way of making AJAX calls.  This could also be done using jQuery or something else that can process AJAX calls. I just went this way because the scripts are already included in asp.net mvc app when you first create the project.  The result of the AJAX call will be a partial view, and we’ll need to put that somewhere.  That’s where the UpdatedTargetId comes into play. Other things we include in the AJAX control that are not in the original are the Action and the Controller, and some AjaxOptions. PageActionLink doesn’t work with the AJAX control, because we’ll be using Ajax.ActionLink to build the link, which is why I broke it up into Action, and Controller. For the AjaxOptions, we need those to specify the target of the call.</p>
<p>So now that’s been explained, let’s look at the controls themselves.  Here’s a comparison of the original control and the ajax control.</p>
<p>The original is one this way:</p>
<pre class="brush: csharp;">

&lt;% if (Model.HasPreviousPage) { %&gt;
    &lt;a href=&quot;&lt;%=Model.PageActionLink.Replace(&quot;%7Bpage%7D&quot;, (Model.PageIndex - 1).ToString())%&gt;&quot;&gt;Previous&lt;/a&gt;
&lt;% } %&gt;

&lt;% if (Model.GetFirstPageToLink() != 1) { %&gt;...&lt;% } %&gt;

&lt;%for (var page = Model.GetFirstPageToLink(); page &lt;= Model.GetLastPageToLink(); page++) {
    if (page == Model.PageIndex) { %&gt;
        &lt;%=page.ToString()%&gt;
&lt;% } else { %&gt;
    &lt;a href=&quot;&lt;%=Model.PageActionLink.Replace(&quot;%7Bpage%7D&quot;, page.ToString())%&gt;&quot;&gt;&lt;%=page.ToString()%&gt;&lt;/a&gt;
&lt;% } 

    if (page != Model.GetLastPageToLink()) { %&gt;|&lt;% } } %&gt;

&lt;% if (Model.GetLastPageToLink() != Model.PageCount) { %&gt;...&lt;% } %&gt;

&lt;% if (Model.HasNextPage) { %&gt;
    &lt;a href=&quot;&lt;%=Model.PageActionLink.Replace(&quot;%7Bpage%7D&quot;, (Model.PageIndex + 1).ToString())%&gt;&quot;&gt;Next&lt;/a&gt;
&lt;% } %&gt;
</pre>
<p>And the AJAX control is done this way:</p>
<pre class="brush: csharp;">

&lt;% if (Model.HasPreviousPage) { %&gt;

&lt;%= Ajax.ActionLink(&quot;Previous&quot;, Model.Action, Model.Controller, new { page = (Model.PageIndex - 1).ToString() }, Model.AjaxOptions)%&gt;

&lt;% } %&gt;

&lt;% if (Model.GetFirstPageToLink() != 1) { %&gt;...&lt;% } %&gt;

&lt;%for (var page = Model.GetFirstPageToLink(); page &lt;= Model.GetLastPageToLink(); page++) {
    if (page == Model.PageIndex) { %&gt;
        &lt;%=page.ToString()%&gt;
    &lt;% } else { %&gt;

&lt;%= Ajax.ActionLink(page.ToString(), Model.Action, Model.Controller, new { page = page.ToString() }, Model.AjaxOptions)%&gt;

&lt;% } if (page != Model.GetLastPageToLink()) { %&gt; | &lt;% } } %&gt;

&lt;% if (Model.GetLastPageToLink() != Model.PageCount) { %&gt;...&lt;% } %&gt;

&lt;% if (Model.HasNextPage) { %&gt;

&lt;%= Ajax.ActionLink(&quot;Next&quot;, Model.Action, Model.Controller, new { page = (Model.PageIndex + 1).ToString() }, Model.AjaxOptions)%&gt;

&lt;% } %&gt;
</pre>
<p>The big difference here is the way that the links are generated. The original control simply creates an anchor tag and passes in the url generated by the Model. The AJAX control uses AJAX.ActionLink() instead, so we can have the link support AJAX.</p>
<p>So knowing how the control looks, this is the Model for the AJAX control itself:</p>
<pre class="brush: csharp;">

public class AjaxPaginationViewData
{
    public int NumberOfPagesToEachSide { get; set; }
    public int PageIndex { get; set; }
    public int PageSize { get; set; }
    public int TotalCount { get; set; }

    public string Action { get; set; }
    public string Controller { get; set; }

    public AjaxOptions AjaxOptions { get; set; }

    public int PageCount
    {
        get
        {
            return (int)Math.Ceiling((double)TotalCount / PageSize);
        }
    }
    public bool HasPreviousPage
    {
        get
        {
            return (PageIndex &gt; 1);
        }
    }

    public bool HasNextPage
    {
        get
        {
            return (PageIndex * PageSize) &lt;= TotalCount;
        }
    }

    public int GetFirstPageToLink()
    {
        return (PageIndex - NumberOfPagesToEachSide &gt; 1 ? PageIndex - NumberOfPagesToEachSide : 1);
    }

    public int GetLastPageToLink()
    {
        return (PageIndex + NumberOfPagesToEachSide &lt; PageCount ? PageIndex + NumberOfPagesToEachSide : PageCount);
    }
}
</pre>
<p>That pretty much explains how the control is built.</p>
<p>The only thing left is how the interaction with PagedList happens.  For that we look at the action that the control calls.  In this example, we’re calling SomeAction in SomeController, and it would look something like this:</p>
<pre class="brush: csharp;">

public ActionResult SomeAction(int page)
{
    CachedPage = page;
    var query = GetSearchQuery(CachedSearchParameters);
    var model = query.ToPagedList(page, DefaultPageSize);
    return PartialView(&quot;AjaxResults&quot;, model);
}
</pre>
<p>The ToPagedList performs the functionality that is included with the PagedList classes which you can find <a href="http://pagedlist.codeplex.com/" target="_blank">here</a>.</p>
<p>Let me know what you think, and if you’d like some demo source to see this in action I can happily provide, just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/creating-an-pagedlistt-that-uses-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Impressions of Droid Eris</title>
		<link>http://josephbulger.com/technology/first-impressions-of-droid-eris/</link>
		<comments>http://josephbulger.com/technology/first-impressions-of-droid-eris/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 04:28:08 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[phone]]></category>

		<guid isPermaLink="false">http://josephbulger.com/technology/first-impressions-of-droid-eris/</guid>
		<description><![CDATA[I just recently got a new phone, a Droid Eris. So far I&#8217;m liking it a lot. The keyboard is surprisingly easy to use. I haven&#8217;t gotten around to tethereing the phone yet, but thats my next step. Then I&#8217;ll be able to use my computer from the road, something the iPhone didn&#8217;t offer me, [...]]]></description>
			<content:encoded><![CDATA[<p>I just recently got a new phone, a Droid Eris. So far I&#8217;m liking it a lot. The keyboard is surprisingly easy to use. I haven&#8217;t gotten around to tethereing the phone yet, but thats my next step. Then I&#8217;ll be able to use my computer from the road, something the iPhone didn&#8217;t offer me, which is why I went with an Android phone. So here&#8217;s hoping!</p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/first-impressions-of-droid-eris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I finally got an invite to Google Voice</title>
		<link>http://josephbulger.com/technology/i-finally-got-an-invite-to-google-voice/</link>
		<comments>http://josephbulger.com/technology/i-finally-got-an-invite-to-google-voice/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 13:31:17 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://josephbulger.com/?p=150</guid>
		<description><![CDATA[Google Voice is a message management system that was originally called  Grand Central, but got bought out by Google.  I was a real fan even before Google got it, but all the lines had been bought out so I couldn&#8217;t get into it.  I recently received an email that they had opened up some more [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Google Voice" href="https://www.google.com/voice">Google Voice</a> is a message management system that was originally called  Grand Central, but got bought out by Google.  I was a real fan even before Google got it, but all the lines had been bought out so I couldn&#8217;t get into it.  I recently received an email that they had opened up some more lines, so I jumped.</p>
<p>Now I have google voice, and there are some things that I think are <strong>really</strong> cool about it.  When someone leaves you a voicemail, it transcribes the recording for you so you can read it online.  Also, all texts that are sent to you are viewable online as well.  One other awesome feature is that you can add a call widget to your web site (I have one on the right hand side) that allows people to call you without giving out your phone number.  It&#8217;s great if you have a portfolio online, and want people to contact you about freelance jobs or something, but you don&#8217;t want to give out your number.</p>
<p>Check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/i-finally-got-an-invite-to-google-voice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Reputation System</title>
		<link>http://josephbulger.com/technology/building-a-reputation-system/</link>
		<comments>http://josephbulger.com/technology/building-a-reputation-system/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 01:53:57 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Church]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[linkedIn]]></category>
		<category><![CDATA[reputation system]]></category>
		<category><![CDATA[serve and trade]]></category>

		<guid isPermaLink="false">http://josephbulger.com/general/building-a-reputation-system/</guid>
		<description><![CDATA[I’m working on a reputation system for a site I’ve been recently working on (http://www.serveandtrade.com).  I’m going through some ideas so I thought I’d post them on here and see what people think.
Let’s start buy throwing up what we currently have so we can see where we’re trying to go.  Here’s a mockup of what [...]]]></description>
			<content:encoded><![CDATA[<p>I’m working on a reputation system for a site I’ve been recently working on (<a href="http://www.serveandtrade.com">http://www.serveandtrade.com</a>).  I’m going through some ideas so I thought I’d post them on here and see what people think.</p>
<p>Let’s start buy throwing up what we currently have so we can see where we’re trying to go.  Here’s a mockup of what a user will see when they search for trades right now.</p>
<p><a href="http://josephbulger.com/wp-content/uploads/2009/09/currentsearchconcept1.png" rel="lightbox[165]"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="currentsearchconcept" src="http://josephbulger.com/wp-content/uploads/2009/09/currentsearchconcept_thumb1.png" border="0" alt="currentsearchconcept" width="539" height="309" /></a></p>
<p>I have a couple problems with how it works right now.</p>
<ol>
<li>I don’t like that it’s in a grid/table format.  I have to fix that first.  I’m moving more towards something like a list layout.</li>
<li>There are some things missing that I would like to be able to do.  For instance, if I just searched for “can of soup”, and I see that Michelle has the one I want, I would like to have a button/link/something to click on that says “I want that!”  Right now the only thing you can do is go look at the trade, or ask a question.</li>
<li>Clicking on the owner’s link takes you to their profile, but it doesn’t show you what other trades they have, or trades they are looking for.  That information could really be useful.</li>
</ol>
<p><span style="color: #eeeeee;">I’m sure there are other things I could think of, but for now I’m going to start focusing on these three and build some mockups to illustrate these workflows.</span></p>
<p>First, getting rid of the grid.</p>
<p><a href="http://josephbulger.com/wp-content/uploads/2009/09/newsearchconcept1.png" rel="lightbox[165]"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="newsearchconcept" src="http://josephbulger.com/wp-content/uploads/2009/09/newsearchconcept_thumb1.png" border="0" alt="newsearchconcept" width="539" height="309" /></a></p>
<p>This search list looks a lot better I think.  There are some more features on here then the other one, but we’ll go over those in subsequent posts.</p>
<p>So at this point I’m looking for any feedback.  ANY feedback, good or bad… I’ll take it all.  I really haven’t made up my mind at this point yet, but I think I’m heading in the right direction.</p>
<p>Next post will be about the “I want it!” feature.  Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/building-a-reputation-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trying out Microsoft Hohm: Save Energy, Save Money</title>
		<link>http://josephbulger.com/general/trying-out-microsoft-hohm-save-energy-save-money/</link>
		<comments>http://josephbulger.com/general/trying-out-microsoft-hohm-save-energy-save-money/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 03:06:05 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[energy]]></category>
		<category><![CDATA[hohm]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://josephbulger.com/?p=144</guid>
		<description><![CDATA[I&#8217;m trying out a new product Microsoft is releasing on the web called Hohm.  It&#8217;s a web site dedicated to tracking your energy expenditure and cost, so that you can reduce your energy consumption and also save you some cash along the way.
How does it accomplish this?  It profiles you and your house.  It asks [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying out a new product Microsoft is releasing on the web called <a title="Microsoft Hohm" href="http://www.microsoft-hohm.com">Hohm</a>.  It&#8217;s a web site dedicated to tracking your energy expenditure and cost, so that you can reduce your energy consumption and also save you some cash along the way.</p>
<p>How does it accomplish this?  It profiles you and your house.  It asks you some basic (and some not so basic) information about your house and your energy habits.  The cool thing is you can choose to fill in as much, or as little, as you want.  No pressure.  However, the more information you can give it the more accurate the reports will be.</p>
<p>Other cool things include the ability to track your energy bills through an automated feed.  This has to be set up with your utility company(ies), but if they offer it, then it&#8217;s a quick way for Hohm to get a lot of information about your energy consumption.  I live in Homestead, FL, and as of today they haven&#8217;t set up any of the providers here.  I&#8217;m hoping they will in the future so I can submit them my data feed and get some real data to project.</p>
<p>I&#8217;m really using it as a way to try and save money primarily.  If it works out I&#8217;ll be writing a success story on it at a later date.</p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/general/trying-out-microsoft-hohm-save-energy-save-money/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Mock that Rocks</title>
		<link>http://josephbulger.com/technology/the-mock-that-rocks/</link>
		<comments>http://josephbulger.com/technology/the-mock-that-rocks/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 17:19:07 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[balsamiq]]></category>
		<category><![CDATA[linkedIn]]></category>
		<category><![CDATA[mockup]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://josephbulger.com/?p=128</guid>
		<description><![CDATA[I&#8217;ve discovered a product that I really enjoy using and thought I would share it.  It&#8217;s called Balsamiq Mockups and it&#8217;s a tool that you can use online or on your computer for drawing up quick ideas on software systems.  They use a sketchy kind of font to give you that &#8220;drawing out a spec&#8221; feel.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve discovered a product that I really enjoy using and thought I would share it.  It&#8217;s called <a title="Balsamiq Mockups" href="http://www.balsamiq.com/products/mockups">Balsamiq Mockups</a> and it&#8217;s a tool that you can use online or on your computer for drawing up quick ideas on software systems.  They use a sketchy kind of font to give you that &#8220;drawing out a spec&#8221; feel.  What really makes the product so appealing is how fast you can build up a simple mock to show to your team.  I&#8217;m literally able to sit down at my computer and within 5 minutes have a meaningful mockup of some kind of feature I want to convey.  Really powerful stuff.</p>
<p>Here&#8217;s an example of the kind of thing you can build with it.</p>
<div id="attachment_130" class="wp-caption alignnone" style="width: 488px"><a href="http://www.balsamiq.com/products/mockups"><img class="size-full wp-image-130     " title="Balsamiq Demo" src="http://josephbulger.com/wp-content/uploads/2009/07/balsamiqdemo.png" alt="Balsamiq Demo" width="478" height="282" /></a><p class="wp-caption-text">Balsamiq Demo</p></div>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/the-mock-that-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BlackBerry Curve: 2 years and still truckin&#8217;</title>
		<link>http://josephbulger.com/technology/blackberry-curve-2-years-and-still-truckin/</link>
		<comments>http://josephbulger.com/technology/blackberry-curve-2-years-and-still-truckin/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 15:48:22 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Family]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blackberry]]></category>

		<guid isPermaLink="false">http://josephbulger.com/?p=72</guid>
		<description><![CDATA[I&#8217;ve been unexpectedly suprised by the longevity of my BlackBerry Curve.  I&#8217;m coming up on my 2 year mark, and it&#8217;s still operating the same as it was when I bought it.  I think that&#8217;s the first phone I&#8217;ve had that I can say that of.  That&#8217;s also not for lack of use, either.  I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been unexpectedly suprised by the longevity of my BlackBerry Curve.  I&#8217;m coming up on my 2 year mark, and it&#8217;s still operating the same as it was when I bought it.  I think that&#8217;s the first phone I&#8217;ve had that I can say that of.  That&#8217;s also not for lack of use, either.  I&#8217;ve really beat the heck out of this phone.  The only issue I&#8217;ve come across is the ball will get sticky every now and then and it won&#8217;t respond to movement.  There&#8217;s a simple remedy, though.  All you have to do is move around the ball with a damp cloth.  After you&#8217;ve done that for a bit, let it dry and you should be able to use the ball again.  I&#8217;ve had to do this about 4 times, because my son, Isaac, get&#8217;s a hold of the thing and get&#8217;s some <em>funk </em>on it.</p>
<p>All in all, very pleased with my BlackBerry.</p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/blackberry-curve-2-years-and-still-truckin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ had it right, Multiple Inheritance Rocks, Single Inheritance&#8230; not so much.</title>
		<link>http://josephbulger.com/technology/c-had-it-right-multiple-inheritance-rocks-single-inheritance-not-so-much/</link>
		<comments>http://josephbulger.com/technology/c-had-it-right-multiple-inheritance-rocks-single-inheritance-not-so-much/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 16:31:21 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[contracts]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linkedIn]]></category>

		<guid isPermaLink="false">http://josephbulger.com/?p=60</guid>
		<description><![CDATA[I&#8217;ve been having a lot of problems with my coding lately. I primarily program in C#, but I originally came from a C++ world. When I first learned Java, and was introduced to the idea of Single Inheritance, the sales pitch made a lot of sense to me. How can any class really derive from [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having a lot of problems with my coding lately. I primarily program in C#, but I originally came from a C++ world. When I first learned Java, and was introduced to the idea of Single Inheritance, the sales pitch made a lot of sense to me. How can any class really derive from multiple classes? I drank the kool-aid, and I’ve been living in a Single Inheritance world ever since.</p>
<p>Now, the caveat to all of this was that you had this thing called an interface that actually allowed you to define declarations of behavior that could later be implemented. This could be done any number of times. This also made a lot of sense, and they would do some simplistic model that illustrates the concept. I imagine for purposes of this article we should probably illustrate something as well just to drive home the point. Let’s say you have a Coin. A Coin is a kind of Currency. So the simple inheritance chain would dictate that Coin inherits from Currency, and everything is fine. Of course, in order for this to matter at all, there needs to be some benefit to having Coin inherit from Currency. So let’s say that Currency has some behavior called CalculateBuyingPower that actually figures out what kind of buying power that particular Currency has. Ok, so now we have an inheritance chain, and we have a direct benefit, figuring out the buying power of the Coin.</p>
<p>If that’s as far as you take it, then everything’s all fine and dandy, and Single Inheritance is great. The problem is, that in the Real World, what we call Objects can legitimately “be” multiple things. This is equally true in the Software World. So, going back to the Coin, not only is the Coin a Currency, but the Coin is also a MetalConstruct. A MetalConstruct is just my way of saying something that is made of metal. Why do I care? Simple. At some point during the life of a Coin, it is entirely possible that the buying power of the Coin will reach a point that it would actually be better to melt down the Coin because the value of the Metal in the coin is much higher (look at what a penny is made of nowadays and you’ll see what I mean). Now, a lot of you are going to say, “That’s fine, just define a MetalConstruct interface and you should be good to go.” In a lot of cases that might be true, but in this example we fine a very big problem. The point of the MetalConstruct is to normalize the behavior of melting down the Coin. No matter what kind of MetalConstruct you have, the melting process for it is always going to be the same. Sure there are variations in melting temperature and what not, but the overall process is the same. The point being, that an interface can only declare that behavior MeltDown should exist, but not define the implementation of it. This is the problem with Single Inheritance. I now need a way for the Coin to be both a Currency and MetalConstruct, which provides the Coin with behaviors CalculateBuyingPower and MeltDown. Coin shouldn’t have to define how to do either of those behaviors, because that’s not it’s <a title="Single Responsibility Principle" href="http://en.wikipedia.org/wiki/Single_responsibility_principle">responsibility</a>.</p>
<p>During software development, when you’re working on defining your domain, this can come up quite often, actually. With the advent of extension methods in .NET, you’re able to ease the pain a bit in C#, but the fundamental problem is really still there. What I would like to see would be one of two things. It would be nice if you could inherit from multiple abstract classes, which would allow you to define Contracts at the abstract class level. Another idea would be to bring forward the construct of a contract as a <a title="First-Class Citizen" href="http://en.wikipedia.org/wiki/First-class_citizen">first-class citizen</a>, it would be similar to an abstract class and an interface in the sense that you could not create one directly, but would allow for definition of behavior while still being able to have a class implement numerous contracts. It would be a totally new way of defining an object, apart from class, struct, or interface entirely perhaps.</p>
<p>So now I’m looking back at C++ and I’m thinking it would be really nice if I had Multiple Inheritance so I can just get past this ridiculous wall I’m having to climb. Possibly with .NET 4.0, Microsoft is bringing forth the idea of Code Contracts , which might help when you’re trying to get around Single Inheritance issues when dealing with <a title="Design by Contract" href="http://en.wikipedia.org/wiki/Design_by_Contract">Design by Contract</a>, but for real domain model issues, I think the problem still remains.</p>
<p>Food for thought.</p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/c-had-it-right-multiple-inheritance-rocks-single-inheritance-not-so-much/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hurricanes among us</title>
		<link>http://josephbulger.com/technology/hurricanes-among-us/</link>
		<comments>http://josephbulger.com/technology/hurricanes-among-us/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 15:05:33 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Hurricanes]]></category>

		<guid isPermaLink="false">http://josephbulger.bulgerblog.com/?p=16</guid>
		<description><![CDATA[

In case you weren&#8217;t aware of this already, I&#8217;m located at the tip end of Florida in a city called Homestead.  So needless to say I&#8217;m very concerned about Hurricane forecasts!  I usually use the National Hurricane Center&#8217;s information when tracking hurricanes, but I recently came across this other tool that does a really good job [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>
<p>In case you weren&#8217;t aware of this already, I&#8217;m located at the tip end of Florida in a city called Homestead.  So needless to say I&#8217;m very concerned about Hurricane forecasts!  I usually use the <a title="National Hurricane Center" href="http://www.nhc.noaa.gov/">National Hurricane Center</a>&#8217;s information when tracking hurricanes, but I recently came across this other tool that does a really good job of visually presenting you the data.  The tool is called <a title="Storm Pulse" href="http://www.stormpulse.com/">Storm Pulse</a> and it gives a Flash representation of the Atlantic Basin.  You can look at historical tracks, weather models, wind models, etc. </p>
<p> Really cool Stuff.  Check it out if you get some time.</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/hurricanes-among-us/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Five Common SEO Mistakes</title>
		<link>http://josephbulger.com/technology/five-common-seo-mistakes/</link>
		<comments>http://josephbulger.com/technology/five-common-seo-mistakes/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 15:02:47 +0000</pubDate>
		<dc:creator>Joseph</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[linkedIn]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://josephbulger.bulgerblog.com/?p=12</guid>
		<description><![CDATA[I&#8217;ve come across this many times when building sites for clients.  ASP.NET is really great for building dynamic content pages, but not so great when you&#8217;re trying to expose those dynamic pages to a crawler or bot used by search engines.  Usually I&#8217;ve found myself having to index the crawler or bot to go find [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come across this many times when building sites for clients.  ASP.NET is really great for building dynamic content pages, but not so great when you&#8217;re trying to expose those dynamic pages to a crawler or bot used by search engines.  Usually I&#8217;ve found myself having to index the crawler or bot to go find specific pages if I wanted something to show up explicitly.  For instance, you might have a product that you really want to showcase and have searchable.  The product&#8217;s URL, however might be parameter based, something like <em>http://www.yourstore.com/productdetails.aspx?productid=5</em>.</p>
<p> Here are 5 common mistakes you should avoid when building sites that need to be Search Engine Optimized (SEO).</p>
<h2><strong>1. Overuse of Button Controls</strong></h2>
<p>The Button and LinkButton controls are handy for running server-side logic when a link or push button is clicked, but keep in mind that <strong>search engines can&#8217;t follow these links</strong>. These controls cause a postback via Javascript code that search engines are unable to execute.  I&#8217;ve seen more than one developer who&#8217;s standard method of linking from one page to another was to drag a LinkButton control onto the page and then place a Response.Redirect in the event handler, making the entire site completely uncrawlable by search engines.</p>
<div class="IME">It seems obvious, but when linking between pages try to use a plain text link or Hyperlink control whenever possible.</div>
<h2><strong>2. Duplicate Page Titles</strong></h2>
<p>With any dynamically generated site, it can be difficult to generate unique page titles for each and every page, but it really is important.  If you have a quality site, then the search engines are working hard to drive traffic to your site.  After all, that is their core business &#8211; to provide links to the best resources on whatever the searcher is looking for. </p>
<p>So you need to make it easy for the search engines to figure out exactly what your pages are about, and the page title is an important part of that.  Not only that, but once the search engine <em>does</em> rank your page highly, the title is the primary text that searchers will be seeing and using to determine whether to click on your listing or not!  </p>
<div class="IME">On dynamically generated pages, try to to use a keyword-rich page title, such as the full name of the product on a product page, for best results.  If you don&#8217;t have any appropriate field, provide the ability for the user to specify their own page titles for each item being displayed.  It&#8217;s worth their time and effort.</div>
<h2><strong>3. Duplicate Meta Descriptions</strong></h2>
<p>Much like the duplicate page title issue, the meta description tag should not be duplicated across your pages either.  Like the page title, this text is used (although to a lesser extent) by the search engines to determine the content of your page and also appears underneath your title in the search engine listing.  Depending on the number of pages of dynamic content on your site, it might not be practical to add multi-sentence descriptions for every single page.  In this case, simply remove the meta description tag altogether.  The major search engines are pretty good at improvising when the description tag is missing by displaying portions of the page body that match the user&#8217;s search keywords instead.</p>
<div class="IME">In my experience, the SEO benefit of adding a keyword-rich meta description is not enough to warrant spending a great deal of time creating custom descriptions for sites with 100+ pages.</div>
<h2><strong>4. State-Dependent Pages</strong></h2>
<p>Search engines rely heavily on the idea that every unique page has it&#8217;s own unique URL.  That means that if you are basing a page&#8217;s content on session variables or viewstate parameters, you are probably going to have problems getting that content indexed.  Once a search engine finds a URL, Google will continue spidering that page, but you can bet that the search engine robot will not navigate through your site again to get there.  So you need to make sure that any content you want indexed by search engines can be accessed by simply opening your browser and typing in the URL of that content.  That means unique URLs for every product in your ecommerce store, ever category in your directory, etc. </p>
<div class="IME">My recommendation is to use viewstate rarely and session variables almost never.</div>
<h2><strong>5. Duplicate Content When Rewriting URLs With ASP.NET</strong></h2>
<p>When you rewrite a URL, the browser is displaying a keyword-rich URL, but internally the URL of the page being displayed is still the ugly URL with the querystring parameters.  In technical terms, the Request.RawURL value might be something like:</p>
<ol>
<li class="alt">http://www.store.com/products/coffee-cup.aspx</li>
</ol>
<p style="padding-left: 30px;">but the Request.Url value would still be something like:</p>
<ol>
<li class="alt"><span><span>http:</span>//www.store.com/products.aspx?productID=15<span>  </span></span></li>
</ol>
<p>All of that is just fine, but a problem can arise if you have a Button or LinkButton control that posts back on that page.  <strong><em>By default, the button control will post back to the Request.URL value</em></strong>. causing the URL to change after postback.  This can be a problem if some users end up linking to your &#8216;ugly&#8217; URLs, because the search engines will find that link and spider it.  To the search engine the two different URLs signify two different pages and both will be indexed seperately, causing a pretty ugly duplicate content problem.  </p>
<div class="IME">Thankfully, starting with .NET 2.0, there is a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.postbackurl%28VS.80%29.aspx" target="_blank">PostBackUrl</a> property on the button controls.  Set this property to the Request.RawUrl value and your button will postback to the &#8216;pretty&#8217; URL.</div>
<p> The original article that I read this from was on this <a title="blog" href="http://www.dexign.net/post/2008/07/08/Five-ASPNET-SEO-Mistakes.aspx">blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://josephbulger.com/technology/five-common-seo-mistakes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
