<?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>davebouwman.com</title>
	<atom:link href="http://blog.davebouwman.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.davebouwman.com</link>
	<description>Software Development with a Spatial Twist</description>
	<lastBuildDate>Tue, 09 Mar 2010 03:58:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>List of Entries in 2010 ESRI Mashup Challenge</title>
		<link>http://blog.davebouwman.com/index.php/2010/03/list-of-entries-in-2010-esri-mashup-challenge/</link>
		<comments>http://blog.davebouwman.com/index.php/2010/03/list-of-entries-in-2010-esri-mashup-challenge/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 03:58:42 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[ESRI]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2010/03/list-of-entries-in-2010-esri-mashup-challenge/</guid>
		<description><![CDATA[The entries really piled in during the last week of the contest. Now that it’s closed, I’ve created a YouTube Playlist of the entries by doing searches at YouTube for the required keywords (“ESRI 2010 Mashup Challenge”)
There were quite a wide range of entries – some that looked like they were done in 5 minutes, [...]]]></description>
			<content:encoded><![CDATA[<p>The entries really piled in during the last week of the contest. Now that it’s closed, I’ve created a YouTube Playlist of the entries by doing searches at YouTube for the required keywords (“ESRI 2010 Mashup Challenge”)</p>
<p>There were quite a wide range of entries – some that looked like they were done in 5 minutes, and others that clearly leveraged an entire team (China National Weather Service, I’m looking at you!). Interestingly, many entries did not put links to the live site in the details for their videos. If you entered the contest and your entry is not on the playlist here, just leave me a comment (and check the keywords on your entry!)</p>
<p>So, ch-ch-ch-check’em out…</p>
<p><a href="http://www.youtube.com/view_play_list?p=72BF1CF05A4DAD7E">ESRI 2010 Mashup Challenge YouTube Play List</a></p>
<p>Or, sit back and watch’em all right here…</p>
<p>
<p><a href="http://www.youtube.com/user/TheGISDeveloper"></a></p>
</p>
<p> <object width="480" height="385"><param name="movie" value="http://www.youtube.com/p/72BF1CF05A4DAD7E&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/72BF1CF05A4DAD7E&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2010/03/list-of-entries-in-2010-esri-mashup-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualizing Executive Compensation</title>
		<link>http://blog.davebouwman.com/index.php/2010/02/visualizing-executive-compensation/</link>
		<comments>http://blog.davebouwman.com/index.php/2010/02/visualizing-executive-compensation/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 22:30:59 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2010/02/visualizing-executive-compensation/</guid>
		<description><![CDATA[When we heard about the ESRI Mashup Challenge, my team and I knew we were going to enter – the question was just what should we build. About that same time there was another flare up in the righteous indignation about the bonuses paid to AIG executives. We got to talking about how awesome it [...]]]></description>
			<content:encoded><![CDATA[<p>When we heard about the <a href="http://www.esri.com/software/mapping_for_everyone/api/mashup.html">ESRI Mashup Challenge</a>, my team and I knew we were going to enter – the question was just what should we build. About that same time there was another flare up in the righteous indignation about the bonuses paid to AIG executives. We got to talking about how awesome it must be to get a million dollar bonus, and how abstract that really is. Most of us own homes, so we c have some appreciation for numbers in the $250,000 to $500,000 range, but we’re paying those off over 30 years. Making a million dollars in one year, or even better, as a BONUS in one year (regardless of whether or not you drove the global economy off the cliff) is nearly unfathomable. Then it clicked – we’d see if we can find some data that would let us visualize executive compensation packages in a way that we (relatively average folk) can relate to.</p>
<p>Some quick searching took us to a <a href="http://www.census.gov/Press-Release/www/releases/archives/income_wealth/012528.html">census report</a> stating that the median household income in the US was $50,233 in 2007. So, comparing compensation packages in the 10’s of millions of dollars in a way most people can relate to was going to be a challenge. </p>
<h1>The Data</h1>
<p>Any compelling mashup needs good data. After some Googling, we found <a href="http://projects.nytimes.com/executive_compensation">“Pay at the Top”</a> at the New York Times web site. This page listed the 2008 compensation packages for 200 executives at public companies. Now, a web page is not usually that convenient a data source, but this one in particular was built using reasonably clean html. We just grabbed the page source, cut out the section we were interested in, slapped in an XML header, and <a href="http://jeffgermain.wordpress.com">Jeff Germain</a> went after in using LINQ to Xml, and loaded the data into two tables in SQL Server.</p>
<p>Next up was finding some aggregate income data. Since we wanted to show this on a map, and have the display make sense, we needed to find total income by county. Conveniently the IRS has just such a dataset. Unfortunately the last year they provide data for is 2007. But since we don’t see wild fluctuations in median income levels, this would be close enough (and it was a CSV file, which made loading it painless). Once the data was loaded into SQL Server, we created a spatial view linking these numbers to a county layer in ArcSDE. I prefer using spatial views as opposed to using joins in the map document or actually adding the fields to the feature class because I know I can mess with the data using SQL without any problems.</p>
<p>At this point we could make maps showing all the counties in the country in which the all residents cumulatively made less than any one executive. </p>
<p>Since there are large variations in median income at the county level, we wanted to show, for a given county, how many households does it take to make the same amount as an executive. We were able to pull this data from the aptly name ESRI Median Household Income service on ArcGIS Online.</p>
<h1>Flexing the Mashup</h1>
<p>We used the Flex API because it’s something we’ve been doing a lot of work with, and the R&amp;D time would pay off on coming projects. The app is a pretty simple flex application, using the ESRI API. We load in a simple shaded relief tile cache as the background, and use a dynamic map service to show the counties.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mashup2" border="0" alt="mashup2" src="http://blog.davebouwman.com/wp-content/uploads/2010/02/mashup2.jpg" width="500" height="347" /> </p>
<p>&#160;</p>
<h1>Map Services</h1>
<p>We are hosting the county income map service (<a title="http://204.133.225.169/ArcGIS/rest/services/Mashup/CountyIncome/MapServer" href="http://204.133.225.169/ArcGIS/rest/services/Mashup/CountyIncome/MapServer">http://204.133.225.169/ArcGIS/rest/services/Mashup/CountyIncome/MapServer</a>), and it’s design is worth noting. We have two layers – one that shows the county outlines, and a second that shades the counties green. Of course we don’t want to show all the counties as green – just the counties where the total income is less than what the executive made. We simply setup the layer in the map with a default definition query of 1=0, which is never true, so no green counties will show up. When we have an executive, we use the Flex API to change the definition query for that layer (on a request by request basis) so that only those counties who’s total adjusted gross income (AGI) is less than the CEO’s compensation. This is a really handy technique which we use a lot.</p>
<h1>Web App &amp; Data Services</h1>
<p>As usual, we built the back-end of the web app using ASP.NET MVC. The web app has two roles – first, it detects if the request is coming from an iPhone or Android device, and routes the request to a different view that’s optimized for those devices. The second thing the web app does is provide a set of data services to the Flex and Javascript apps (the mobile app is just HTML and jQuery). The data services hit the compensation data stored in SQL Server, and return it to the flex app as JSON. </p>
<h1>Mobile View</h1>
<p>As I noted the app will present a different view to for iPhone or Android browsers – this is much simpler, but still conveys the same information. The map used is actually OpenLayers, so you can pan &amp; zoom. <a href="http://jeffgermain.wordpress.com">Mike Juniper</a> and <a href="http://briannoyle.wordpress.com">Brian Noyle</a> will be talking more about this technology at their <a href="http://esri.force.com/devcon2010/ideas/viewIdea.apexp?id=087300000007DvV">Dev Summit session</a> (1:45pm – 2:15pm Wednesday March 24th)</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mashup-iphone" border="0" alt="mashup-iphone" src="http://blog.davebouwman.com/wp-content/uploads/2010/02/mashupiphone.jpg" width="500" height="400" /> </p>
<p>&#160;</p>
<h1>The Video</h1>
<p>In order to enter the contest, you have to submit a video on YouTube. Here’s ours:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/a3dzn9ZxMw8&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/a3dzn9ZxMw8&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p> <a href="http://www.youtube.com/watch?v=a3dzn9ZxMw8">Link: http://www.youtube.com/watch?v=a3dzn9ZxMw8</a>
</p>
<h3>&#160;</h3>
<p>So that’s the app as it stands –  I also wanted to give a shout out to Michael Hayden and Bob Binckes who did the bulk of the Flex coding for this &#8211; Thanks guys! </p>
<p>There is a lot more that could be done, and there are a few design tweaks I’d like to make, but given the time we had, it came together really well. Check it out and let us know what you think!</p>
<h3><a href="http://mashup.dtsagile.com">http://mashup.dtsagile.com</a></h3>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2010/02/visualizing-executive-compensation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dev Summit Talks: Vote Now!</title>
		<link>http://blog.davebouwman.com/index.php/2010/01/dev-summit-talks-vote-now/</link>
		<comments>http://blog.davebouwman.com/index.php/2010/01/dev-summit-talks-vote-now/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 05:36:09 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[Dev Summit]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2010/01/dev-summit-talks-vote-now/</guid>
		<description><![CDATA[The Community presentations for the 2010 ESRI Developer Summit are now listed on-line, and are open for voting. Since these presentations are all recorded, you don’t have to be attending the Dev Summit to vote – just setup an account (free) and vote for what you want to see – either live or recorded. 
This [...]]]></description>
			<content:encoded><![CDATA[<p>The Community presentations for the 2010 ESRI Developer Summit are now <a href="http://esri.force.com/devcon2010/ideas/ideaList.apexp">listed on-line</a>, and are open for voting. Since these presentations are all recorded, <strong>you don’t have to be attending the Dev Summit to vote</strong> – just setup an account (free) and vote for what you want to see – either live or recorded. </p>
<p>This year I’ve submitted two talks, and Brian Noyle and Mike Juniper have thrown one into the mix. </p>
<p>First up – <a href="http://esri.force.com/devcon2010/ideas/viewIdea.apexp?id=087300000007Dvu">Ruby-Fu: Using ArcGIS Server with Rails</a></p>
<p>As noted in <a href="http://blog.davebouwman.com/index.php/2010/01/2010-a-good-year-for-in-the-dark-arts/">my last post</a>, I’m dabbling with Ruby on Rails, and so I thought I’d do a talk about using ArcGIS Server from a Rails application. The basic idea is to build a simple data view that sits in front of data hosted by ArcGIS Server. In reality you would likely pull the attribute data from a database, but in order to make it more interesting from the ArcGIS perspective, we’ll pull it from ArcGIS Server via the SOAP API. Unlike .NET, Ruby does not have much in the way of web service proxy generators that work from WSDLs. What little there is, can’t handle the complexity of the ArcGIS Server WSDL files, so we need to get a little lower-level. I’m using the Savon gem for this project, and it does a good job of handling things – I’ll go into the details in a subsequent post, and in the talk.</p>
<p>Now, some people would say that I should just use the REST API, and call it good. Unfortunately at 9.3.1, the REST API is still a limited (but powerful) subset of the SOAP API. And some of what I need to do (i.e. draw custom graphics on a map image) can not be done via the REST API, so SOAP it is.</p>
<p>I’m also going to build the app using Behavior Driven Development using <a href="http://cukes.info/">Cucumber</a>, and I’ll show how the behavior of the system can be described in plain English, and yet they run complex tests. Apparently Cucumber can be used to drive .NET tests as well, so that should be an interesting spin-off from this.</p>
<p>As noted in the talk description, all the code will be put up on ArcScripts and on <a href="http://github.com">GitHub</a>. I plan on using the <a href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer">Portland Landbase service</a> hosted by ESRI so that there is no ArcGIS Server setup required to play with the app.</p>
<p>Why vote for this? Ruby is a lot of fun, and offers a different point of view on development… and <a href="http://www.spatiallyadjusted.com/2010/01/20/voting-is-open-for-the-2010-devsummit-user-presentations/">James Fee says you should</a> <img src='http://blog.davebouwman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>&#160;</p>
<p>My second talk is titled <a href="http://esri.force.com/devcon2010/ideas/viewIdea.apexp?id=087300000007Dvf">Bloody Knuckles: Building Secure Applications with ArcGIS Server</a></p>
<p>We (somewhat) recently built an emergency response application based on the ESRI Javascript API, with lots of custom services (ASP.NET MVC if you care). When we were nearly done, we found out that “deployed on a DHS server” meant that everything had to be locked down. This means the full meal deal – all requests to the web server had to go over SSL and all ArcGIS Services used token based security. This would have been complex enough, but this particular application allows the administrators to dynamically add services from other ArcGIS Servers. Joy. Anyhow –we managed to whip this system into shape, and I’m going to run down the general ideas, and then dive into some of the code – particularly the proxy that handles the token security. You can watch a “high-level” version here <a href="http://vimeo.com/7557517">http://vimeo.com/7557517</a>&#160; (presented at the 2009 ESRI South West Users Group). The Dev Summit version will be much more “deep dive”</p>
<p>Why vote for this? Who knows when you’ll find yourself needing a SSL certificate and token based security. </p>
<p>&#160;</p>
<p>Brian and Mike have taken up the charge with “<a href="http://esri.force.com/devcon2010/ideas/viewIdea.apexp?id=087300000007DvV">There’s an App for That: Building iPhone applications with OpenLayers and ArcGIS Server</a>”</p>
<p>Why build a native app when you can build a pretty cool web app that leverages WebKit and the iPhone extensions? HTML5 here we come! Actually, I’m sure that Brian will have some sort of post on the details of what these guys are planning, so I’ll leave it at this for now. And, we’re going to try and work in an edge-cached, cloud front image service that some friends are cooking up. H-h-h-h-ot. We’re also going to try to get this working on Android as well.</p>
<p>Why vote for this? We’ll have the app up and running and you can bang along on it with us, and (if possible) we’ll be sharing the source.</p>
<p>&#160;</p>
<p>So – that’s it – as usual these will be zen-style presentations, and we hope they will be entertaining. I hope you’ll head over to the voting site, check out all the talks and give us some love. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2010/01/dev-summit-talks-vote-now/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2010 &#8211; A good year for the Dark Arts</title>
		<link>http://blog.davebouwman.com/index.php/2010/01/2010-a-good-year-for-in-the-dark-arts/</link>
		<comments>http://blog.davebouwman.com/index.php/2010/01/2010-a-good-year-for-in-the-dark-arts/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 23:47:27 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2010/01/2010-a-good-year-for-in-the-dark-arts/</guid>
		<description><![CDATA[Ruby on Rails may not be on a Lovecraftian list of “Dark Arts”, but for someone who’s been developing on the Microsoft platform for the last 10 years, it’s close enough.
As anyone who’s read this blog in the last 2 years knows, I’m a pretty big fan of Microsoft ASP.NET MVC – it’s simple, gets [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.davebouwman.com/wp-content/uploads/2010/01/WindowsLiveWriter2010AgoodyearforintheDarkArts_1397Dchthulu-rails_4.jpg"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 15px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="chthulu-rails" src="http://blog.davebouwman.com/wp-content/uploads/2010/01/WindowsLiveWriter2010AgoodyearforintheDarkArts_1397Dchthulu-rails_thumb_1.jpg" border="0" alt="chthulu-rails" width="216" height="240" align="left" /></a>Ruby on Rails may not be on a <a href="http://en.wikipedia.org/wiki/Cthulhu_Mythos">Lovecraftian</a> list of “Dark Arts”, but for someone who’s been developing on the Microsoft platform for the last 10 years, it’s close enough.</p>
<p>As anyone who’s read this blog in the last 2 years knows, I’m a pretty big fan of <a href="http://asp.net/mvc">Microsoft ASP.NET MVC</a> – it’s simple, gets out of your way, and gives you total control of the output. And it’s 1000% better than the mystery meat known as Web Forms – a nirvana so to speak. So, why would I take up Ruby on Rails?</p>
<h2>Why Rails?</h2>
<p>First, unless you’ve been under a rock for the last 5 years, you’ve likely heard that <a href="http://rubyonrails.org/">Ruby on Rails</a> is <a href="http://www.urbandictionary.com/define.php?term=teh+awesome">*teh awesome*</a>, so that counts for something. Then there is the fact that <a href="http://highearthorbit.com/">Andrew Turner</a> (<a href="http://twitter.com/ajturner">@ajturner</a> for the Twitterati) / <a href="http://finder.geocommons.com/">GeoCommons</a> crew as well as <a href="http://twitter.com/pbissett">Paul Bissett</a> / <a href="http://twitter.com/cageyjames">James Fee</a> and the <a href="http://www.weogeo.com/">WeoGeo</a> team are all smart as hell, they all love Rails.</p>
<p>And the other reason is that realistically, Apache and Linux have won the web. Yeah there is a large slice of the pie (mainly Government) that runs Windows, but if you are starting a web based business, you’re likely going to run open source because of the costs to start and scale. Sure Microsoft is semi-mitigating this with <a href="http://www.microsoft.com/BizSpark/">BizSpark</a> and a few other programs, but regardless, the difference was put in sharp contrast as I tried to negotiate may way around the Microsoft Open Licensing site while at the same time installing RedMine on Ubuntu Linux. For those who have not had the <span style="text-decoration: line-through;">pain</span> pleasure of dealing with the maze of <a href="https://www.microsoft.com/licensing/servicecenter/">Microsoft Licensing sites</a>, they are among the least usable, obtuse sites anyone could imagine. It’s like they set out to win an award for painful web experiences. Really – I don’t mind paying for software – I love Visual Studio, but why, why, why must it be a living hell to actually login, locate, assign and activate licenses? I’m not joking here – I’m really considering changing from full MSDN subscriptions over to just buying Visual Studio because then we own it outright and don’t have to deal with this crap licensing site every year.</p>
<p>Anyhow… back to my point. On Ubuntu installing software is crazy simple – “sudo apt-get install &lt;software of choice&gt;”. Yes, the command line syntax is slightly more complex than a “Ok-Next-Next-Next” windows installer, but it’s also free, immediate and you’re always getting the latest and greatest.</p>
<p>When the main reason we use MSDN over just Visual Studio is for the SQL Server and OS licenses, it makes me question things – I can install MySQL in about 5 minutes, it’s 100% free and I don’t have to fight with the Microsoft sites? The OS is free, and Aptana RadRails (free) covers the IDE side of things? Why is it that I’m shelling out $15,000 a year in licensing, only to have the entire Microsoft interaction be painful? Ok this is degrading into a rant, but what the heck, I don’t rant very often, and it’s my blog anyhow… moving on <img src='http://blog.davebouwman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Ruby on Rails. Yeah. So, it seemed that expanding my horizons a little may be interesting, and worth some evening time. I started with <a href="http://pragprog.com/titles/cerailn/rails-for-net-developers">“Rails for .NET Developers”</a> from Pragmatic Press. This is a perfect read if you’re a WebForms developer, and pretty good if you’ve elevated your game to MVC. From there I moved onto “Agile Web Development with Rails” and this is a great follow up. If you like Pragmatic Press books, these are perfect.</p>
<h2>Patterns nom nom nom…</h2>
<p>Since Rails is  based on the MVC pattern, and a major influence behind ASP.NET MVC, it’s not surprising that the carry over from ASP.NET MVC is huge. The View syntax is very very similar, the the extent that many of the HTML helpers are very similar. This is great because I was immediately comfortable with the general structure of things. However there are some differences… namely data access (aka ActiveRecord)</p>
<p>Because this post is rife with asides, let’s have another… It’s interesting that <a href="http://blog.wekeroad.com/">Rob Conery</a>, of Hawaii and various levels of internet fame (creator of <a href="http://subsonicproject.com/">SubSonic</a>, an ex-Microsoftie and now <a href="http://tekpub.com/">TekPub.com</a> dude) seems to have been going through a similar thought process / experience as I have, although he seems to be a few weeks ahead of me. You see, while I really like ASP.NET MVC, there is still WAY too much time spent thinking about data access. In the last year, we’ve used the Repository pattern, with a mix of SubSonic, NHibernate and plain ADO.NET. On every project there is much hand wringing and thought about how the data access tier should work – how “POCO” should the POCO’s be, what handles the transition from the data tier to the models etc etc etc. In <a href="http://blog.wekeroad.com/2009/12/26/thoughts-on-ef-vs-nhibernate-redux">this post</a> about Entity Framework and NHibernate Rob makes the point that we should be waaaaay past thinking about the data tier. It should be “done” – the fact that there are still flame wars about data persistence options is sad. Isn’t a framework supposed to *help* you with the mundane stuff?</p>
<h2>I can haz Data Nao?</h2>
<p>I my mind, time spent futzing with the data tier is time wasted. Yes, there are projects where you don’t control the database, and some DBA’s do some really wack stuff (if we meet, ask me about this, have I got stories!), but in an ideal world you turn down those projects. Any database that makes it a royal pain to get to the data the users need, is poorly designed in my opinion. The app is about users, and it succeeds or fails based on them, not based on some idealized 4th normal form, so let the app dictate the data model!</p>
<p>What rocks about Rails is that data access is “just done”. No thinking, it’s just done. And it works. Let me say that again – the data access is “just done”. You can go from zero to editing data in your database in about 30 seconds. Sure the styling of the scaffold sucks, and it’s not the best workflow, but the key feature – create / edit / update / delete data in your database is DONE. All that time you would have spend thinking about NHibernate caching or optimization can be spend working out a better workflow or UI styling. Under the covers, I’m sure there are more elegant solutions, and there are likely some performance issues, but realistically 99.99% of web apps are not FaceBook or Twitter, so the performance / scalability arguments are moot – we’ve got trivial numbers of users and heinously powerful servers. Let’s NOT sweat performance mmmkay?</p>
<p>The other thing about Rails that’s great is that it’s opinonated. And not just mildly, it’s got some really strong opinions, but if you can work with them, and not against them things flow so smoothly. I know, I know, I heard this same speil for a few years, but I have to say it’s true. If you can live in the 80% case, Rails makes things so smooth it puts a grin on my face.</p>
<h2>What Now Brown Cow?</h2>
<p>So, am I forsaking all that Redmond hath wrought? Not quite – this is good kool aid, but I’m not about to throw out ASP.NET MVC just yet (we did just shell out for another year of MSDN after all!) but Rails provides an exciting alternative that’s close enough to the tooling and workflow of my day job that it’s providing inspiration and ideas about how to be a better ASP.NET MVC developer. It’s a great developer exercise to learn a new language or framework, and I heartily recommend checking out Ruby and Rails.</p>
<p>Anyhow, to close out this rant of a post, I’ll be throwing more Ruby into the mix here and on GeoGeek.tv. At this point I’m certainly still very NOOB in terms of Rails, but what I’ve done, I’ve liked. Alot. And as far as “on my own time” projects, I’m sensing a definite shift to the dark side. Welcome to 2010!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2010/01/2010-a-good-year-for-in-the-dark-arts/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Zen and the Art of ServerObjectExtensions</title>
		<link>http://blog.davebouwman.com/index.php/2009/12/zen-and-the-art-of-serverobjectextensions/</link>
		<comments>http://blog.davebouwman.com/index.php/2009/12/zen-and-the-art-of-serverobjectextensions/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 23:53:57 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[ArcGIS Server]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2009/12/zen-and-the-art-of-serverobjectextensions/</guid>
		<description><![CDATA[I was going to cook up a full SOE example, but that was going to take way more time that I don’t have, so here’s the abridged version – just the major points…
&#160;
Projects in the Solution
SOE’s have a lot of moving parts, so let’s think about all the parts in terms of servers &#38; assemblies.
First [...]]]></description>
			<content:encoded><![CDATA[<p>I was going to cook up a full SOE example, but that was going to take way more time that I don’t have, so here’s the abridged version – just the major points…</p>
<p>&#160;</p>
<h2>Projects in the Solution</h2>
<p>SOE’s have a lot of moving parts, so let’s think about all the parts in terms of servers &amp; assemblies.</p>
<p>First – the SOE project. We’ll create the actual SOE’s in here. We can have references to all the ArcObjects / ADF goop we want in here, since this will of course be running on the SOC machine.</p>
<p>In the “client” application (ASP.NET MVC in my case) we’ll use an interface to access the SOE. Since we’ll want the interface definition on both the SOC machine(s) and the “client” machine, we put this in it’s own assembly. Remember that anything that moves between the SOE and the “client” is really doing DCOM under the covers, so all types need to be serializable.</p>
<p>Next up is the Utility assembly. We have a mess of static classes in here that are pure ArcObjects. This assembly will be used on the ArcGIS SOC box, by the SOEs. An upside of keeping this code “pure” ArcObjects (by that I mean there is no ServerObject cruft in here) we can use these same utility classes in ArcEngine or Desktop development.</p>
<p>Finally, we’ll want that “client” application I’ve be talking about. I’m a big fan of ASP.NET MVC, so I’ve been using that to host services. It’s worth noting that you can put standard ASMX SOAP web services into an MVC project. This is nice because you can expose your SOE methods as SOAP or JSON from the same project. Remember, this project will be using the ESRI ADF library to create the connection into the SOC and get access to the SOE, so it will need to run on a box that has these libraries accessible. Note that at 9.4 the ADF components are re-distributable with out incurring additional licensing.</p>
<p>&#160;</p>
<h2>Building</h2>
<p>The build process can be a little hairy. First off, make sure you have ArcGIS Server on your development box – this way your build/test cycle will be manageable. If you need to copy dll’s to another server as part of your debugging process you will lose your mind. </p>
<p>So – we need to register all the COM assemblies – that would be the SOE, the SOEInterface, and the COMUtility assemblies at minimum. While you *CAN* tell visual studio to register these assemblies for COM interop, DON’T! That will register the assembles in \bin\debug.</p>
<p>A better plan is to copy these dll’s to a separate folder, and install them there. We call ours _install_ComUtilities. We have a post-build event that copies the SOE and it’s dependencies into that folder, and does all the dirty work. Jeff Germain just threw up a good <a href="http://jeffgermain.wordpress.com/2009/12/12/post-build-event-for-custom-server-object-extensions/">post on a Post-Build Event</a> that does all this, but here’s the basic process:</p>
<ol>
<li>Stop the ArcGIS SOM Process (SC STOP ArcServerObjectManager) </li>
<li>Un-register the dll’s (regasm /unregister…) </li>
<li>delete the type libraries (*.tlb) </li>
<li>delete the dlls </li>
<li>copy the new dll’s from the build output folder into _install_ComUtilities </li>
<li>run regasm on them to create the type libraries </li>
<li>re-start the ArcGIS SOM process (SC START ArcServerObjectManager) </li>
</ol>
<p>Now, of course you don’t want to do this every time your solution builds, as it takes ~15 seconds, so use the visual studio configuration manager to not build the SOE project automatically.</p>
<h2>Registering the SOE with the Map Service</h2>
<p>Get <a href="http://viswaug.wordpress.com/soexplorer/">Vish’s SOExplorer</a> app, and use that. You can do this manually or write some code to do it, but just use Vish’s tool. It rocks. Moving on…</p>
<h2>Logging</h2>
<p>Since you’ll likely have a bug or two in your code, having some logging is really important. We use Log4Net on the client side, but have never gotten this to work smoothly in COM land. Again, Jeff has saved the day with a ComLogger utility that he whipped up for this. I’ve asked him to post about this, but he has not gotten to it yet. If you want this, go to <a href="http://jeffgermain.wordpress.com/">his blog</a> and hassle him.</p>
<p>The upside is that when debugging the app, I’ve got two logs to watch – the log on the client (MVC) and from the SOC (via ComLogger). The ComLogger simply creates a \log folder next to the SOE dll – so you have to watch for permissions on this – make sure that the ArcSOC process has write permission to the folder where you install your dll’s!</p>
<p>Here’s an example of what I get in my SOE Log:</p>
<p>12/14/2009 3:11:37 PM&#160;&#160; INFO&#160;&#160; LrsSOE::GetRoute&#160;&#160; LrsSOE::GetRoute called.    <br />12/14/2009 3:11:37 PM&#160;&#160; INFO&#160;&#160; LrsSOE::GetRoute&#160;&#160; params: routeId: 002B     <br />12/14/2009 3:11:37 PM&#160;&#160; INFO&#160;&#160; LrsSOE::GetRoute&#160;&#160; whereclause: Route = &#8216;002B&#8217;     </p>
<p>What shows up in here is up to you, but make sure you stuff all exceptions into the log because that’s where this will save you a ton of time. If you don’t you’ll just get an InteropException on the client side, and that’s completely useless. Also worth mentioning, I use NotePad++ and just keep these two files open in it. When they change, and you change focus to Notepad++, it will ask if you want to refresh the files. Vish is a big fan of BareTail, but from what we’ve see, it’s got wacky behavior on multi-monitor setups. Moving on…</p>
<h2>SOAP and JSON in MVC</h2>
<p>As noted above I needed to provide services to different clients – one is a Flex app where JSON is convenient, and the other is another MVC app that can speak SOAP fluently. To do this, I just created a standard MVC project, and created a /SOAP folder, inside of which I created a standard asmx web service. By default MVC maps all urls to routes, and so /SOAP would normally route to a class called SOAPController. However, we don’t want that behavior, so we tell MVC to ignore anything under /SOAP (this is in global.asax.cs)</p>
<pre class="code"><span style="color: blue">        public static void </span>RegisterRoutes(<span style="color: #2b91af">RouteCollection </span>routes)
        {
            routes.IgnoreRoute(<span style="color: #a31515">&quot;{resource}.axd/{*pathInfo}&quot;</span>);
            routes.IgnoreRoute(<span style="color: #a31515">&quot;SOAP/{*pathInfo}&quot;</span>);
            routes.MapRoute(
                <span style="color: #a31515">&quot;Default&quot;</span>,
                <span style="color: #a31515">&quot;{controller}/{action}/{id}&quot;</span>,
                <span style="color: blue">new </span>{ controller = <span style="color: #a31515">&quot;Home&quot;</span>, action = <span style="color: #a31515">&quot;Index&quot;</span>, id = <span style="color: #a31515">&quot;&quot; </span>}
            );
        }</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p>For the Json stuff, I setup a JsonController and thus we have routes like <a href="http://server/json/getroute?routeId=25b">http://server/json/getroute?routeId=25b</a>, which of course maps to a the GetRoute method on the JsonController, passing in a routeId of 25b. The logic in the JsonController is pretty simple – we just pass the arguments over to the SOE, and return the response.</p>
<h2>Getting the SOE</h2>
<p>Getting the SOE itself is a two step process. First you need to get a server context – ideally one that has your SOE registered with it, and then get the SOE from that. We’ve written a lot of these things, so we have lots of handy utilities to handle configuration sections, Identity etc etc. But it boils down to two methods:</p>
<pre class="code"><span style="color: blue">public static </span><span style="color: #2b91af">IServerContext </span>GetServerContext(<span style="color: blue">string </span>arcGISServerName,
                                            <span style="color: blue">string </span>serviceName,
                                            <span style="color: blue">string </span>serviceType,
                                            ESRI.ArcGIS.ADF.<span style="color: #2b91af">Identity </span>identity)
{
    <span style="color: green">//Connect to ags
    </span>ESRI.ArcGIS.ADF.Connection.AGS.<span style="color: #2b91af">AGSServerConnection </span>agsConnection
        = <span style="color: blue">new </span>ESRI.ArcGIS.ADF.Connection.AGS.<span style="color: #2b91af">AGSServerConnection</span>(arcGISServerName, identity);
    agsConnection.Connect();
    <span style="color: blue">if </span>(!agsConnection.IsConnected)
    {
        agsConnection.Dispose();
        <span style="color: blue">return null</span>;
    }

    <span style="color: green">//Get the som
    </span><span style="color: #2b91af">IServerObjectManager </span>som = agsConnection.ServerObjectManager;

    <span style="color: green">//Get the server context and the mapserver
    </span><span style="color: #2b91af">IServerContext </span>serverContext = som.CreateServerContext(serviceName, serviceType);

    <span style="color: blue">return </span>serverContext;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>and…</p>
<pre class="code"><span style="color: blue">private </span><span style="color: #2b91af">ILrsSOEInterface </span>GetSOE(<span style="color: #2b91af">IServerContext </span>serverContext, <span style="color: blue">string </span>soeName)
{
    <span style="color: green">//Get the server object extension
    </span><span style="color: #2b91af">IServerObjectExtensionManager </span>serverObjExtMgr = serverContext.ServerObject <span style="color: blue">as </span><span style="color: #2b91af">IServerObjectExtensionManager</span>;
    <span style="color: blue">if </span>(serverObjExtMgr == <span style="color: blue">null</span>)
    {
        <span style="color: blue">throw new </span><span style="color: #2b91af">ApplicationException</span>(<span style="color: #a31515">&quot;Failed to get the ServerObjectExtensionManager from the server context.&quot;</span>);
    }

    <span style="color: #2b91af">IServerObjectExtension </span>serverObjExt = serverObjExtMgr.FindExtensionByTypeName(soeName);
    <span style="color: blue">if </span>(serverObjExt == <span style="color: blue">null</span>)
    {
        <span style="color: blue">throw new </span><span style="color: #2b91af">ApplicationException</span>(<span style="color: #a31515">&quot;Failed to get the ServerObjectExtension by extension type name&quot; </span>);
    }

    <span style="color: #2b91af">ILrsSOEInterface </span>lrsSOE = (<span style="color: #2b91af">ILrsSOEInterface</span>)serverObjExt;
    <span style="color: blue">if </span>(lrsSOE == <span style="color: blue">null</span>)
    {
        <span style="color: blue">throw new </span><span style="color: #2b91af">ApplicationException</span>(<span style="color: #a31515">&quot;Failed to create a reference to the {0} server object extension.&quot;</span>, soeName));
    }

    <span style="color: blue">return </span>lrsSOE;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>Notice that the second method returns the SOE typed as the interface we defined in the interfaces assembly.</p>
<h2>Serialization</h2>
<p>The last step is to get the results from our SOE back to the client. This is easy for simple types, but as usual Geometry is a pain. The Geometry we get back from our SOE is the SOAP Value type geometry. And as far as we know there is no open API for converting this into a Json geometry. Of course, using Reflector you can *see* that ESRI has all the handy methods you may want to use for this in the REST assembly, but alas they are all internal. What’s a dev to do? I’ve asked ESRI to provide public methods for this, and Morten mentioned being able to do this using the WPF components, but again, the needed methods are internal (and they don’t handle the SOAP value types). If you are working with GeoJSON, the Vish (did I mention Vish rocks?) whipped up <a href="http://viswaug.wordpress.com/2008/05/11/geojsonnet-a-net-library-to-produce-geojson-output/">GeoJson.NET</a>, which you can get from SVN at Assembla (<a title="http://svn2.assembla.com/svn/GeoJSON/" href="http://svn2.assembla.com/svn/GeoJSON/">http://svn2.assembla.com/svn/GeoJSON/</a>) . It cleanly handles the ESRI –&gt; GeoJson formatting. All hail Vish. <img src='http://blog.davebouwman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>So – that’s a pretty shot-gun style round up of SOE related stuff. If you have questions or ideas, just drop me a line and I’ll see what I can do.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2009/12/zen-and-the-art-of-serverobjectextensions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Re-mixing the Flex Sample Viewer</title>
		<link>http://blog.davebouwman.com/index.php/2009/11/re-mixing-the-flex-sample-viewer/</link>
		<comments>http://blog.davebouwman.com/index.php/2009/11/re-mixing-the-flex-sample-viewer/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 23:57:24 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[ArcGIS Server]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2009/11/re-mixing-the-flex-sample-viewer/</guid>
		<description><![CDATA[The ESRI Flex Sample Viewer is a great starting point for creating map centric RIA&#8217;s. The widgetized nature of the starter kit facilitates significant re-use of components, and there are a couple dozen plug-and-play components available from the Flex Code Gallery. Woot!
The downside of this ease of re-use is that we are seeing a new [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&amp;scriptID=15905">ESRI Flex Sample Viewer</a> is a great starting point for creating map centric RIA&#8217;s. The widgetized nature of the starter kit facilitates significant re-use of components, and there are a couple dozen plug-and-play components available from the <a href="http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGallery">Flex Code Gallery</a>. Woot!</p>
<p>The downside of this ease of re-use is that we are seeing a new wave of cookie cutter sites out there. It&#8217;s great that these sites can the whipped up so quickly, but it&#8217;s pretty clear that (for the most part) little or no thought is given to how the user should interact with the site. We see hordes of menus and tons of widgets, all gloriously trying to pseudo replicate ArcMap. Let&#8217;s be clear &#8211; if your users need ArcMap, give them ArcMap. If they actually know the data model to the point that an ad-hoc query tool will be useful, chances are they will need more functionality than you can build into the Flex app anyhow. Right tools, right place and all that&#8230;</p>
<p>Where was I&#8230; oh yeah&#8230; remixing the sample viewer. When I&#8217;m designing an application, I want to build it as focused as possible. Every mouse click and menu drop down I can remove, the better it is for the user. So &#8211; here are a few of the things that I wanted from a UI/behavior perspective&#8230;</p>
<ul>
<li>I want top level menu items that do something on-click. I don&#8217;t want a pull down with a single item on it &#8211; I want a print icon that opens the print dialog when it&#8217;s clicked.</li>
<li>The shortcut menu is a great idea, but I want to have things that &#8220;only&#8221; appear on the short cut menu. Having something in two places in a UI is counter intuitive in most cases, and wastes UI space.</li>
<li>I want to have a limited set of base maps available, and I want them to be displayed as top level icons on the menu. Clicking them will turn on the layer. Active layer should have a &#8220;glow&#8221; indicating that it&#8217;s&#8230; well&#8230; active.</li>
<li>I want widgets that can&#8217;t be closed. One thing I&#8217;ve seen when letting clients run a Flex app is when they close widgets they are confused about how to re-open it. Thus I want a sub-type of widget that can only be minimized and not closed.</li>
<li>I want a full width banner across the top of the page &#8211; providing more room for top level items.</li>
<li>I want a search box in the top banner so it&#8217;s easy to search.</li>
<li>I want a zoom to / book mark tool on the top bar so it&#8217;s easy to jump to commonly accessed extents </li>
</ul>
<p>And I want all the same level of flexibility in terms of configuration, and the ability to leverage existing widgets. Now. <img src='http://blog.davebouwman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<h2>Design Sketches</h2>
<p>In coming up with this list of things I wanted, I did some sketches&#8230;&nbsp; (apparently my scanner is crap!)</p>
<p><a href="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-sketch1.png"><img border="0" alt="remix-sketch1" src="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-sketch1_thumb.png" width="484" height="343"></a> </p>
<p><a href="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-sketch2.png"><img border="0" alt="remix-sketch2" src="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-sketch2_thumb.png" width="467" height="331"></a> </p>
<p>In the past I&#8217;ve used visio or balsamiq to create wireframes, but more recently I&#8217;ve been getting back into sketching simply because it&#8217;s so fast. I&#8217;ve been using Jason Robb&#8217;s wireframe templates as a starting point (<a href="http://www.uxbooth.com/blog/tools-for-sketching-user-experiences/">article</a> and <a href="http://uxbooth.s3.amazonaws.com/uploads/2009/11/Wireframe-templates-JasonRobb.pdf">direct download of pdf</a>).</p>
<h2>More Tile Caches&#8230;</h2>
<p>Since ESRI is changing their caches over to Web Mercator, I wanted to start working with some web mercator tile caches. ESRI has *some* services available now (<a href="http://www.google.com/search?hl=en&amp;as_q=102113+mapserver&amp;as_sitesearch=arcgisonline.com">google search here</a>), but realistically most of these are pretty weak for base maps. So, I created tile layers for OpenStreetMap and CloudMade. Once I finish a few tweaks to these layers (need to display the copyright statements on the map) I&#8217;ll release them &#8211; likely to the ESRI Code Gallery, but I also want them on a SCM somewhere. Maybe GitHub? Thoughts?</p>
<h2>Let&#8217;s take a peek&#8230;</h2>
<p>Things are not fully dialed in yet, and I really need to focus on detailing this out for my client, but this is the generic starting point. I&#8217;ll post some live links when my client&#8217;s site is ready for beta testing.</p>
<p><a href="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-mc.png"><img border="0" alt="remix-mc" src="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-mc_thumb.png" width="500" height="307"></a></p>
<p>This shows the full width banner, the address search, zoom to drop down (needs skinning), an &#8220;Always Open&#8221; widget, the two base map icons, and the top level print widget. The tiles are from the CloudMade Midnight Commander cache.</p>
<p><a href="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-2.png"><img border="0" alt="remix-2" src="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-2_thumb.png" width="500" height="307"></a> </p>
<p>This one shows the locate dialog that&#8217;s opened by running a search from the banner bar. As you can see there are still a few issues with this widget. Since &#8220;locate&#8221; is not the key focus of the app, this widget can be closed. I&#8217;m also going to work on the actual search logic &#8211; right now it&#8217;s parsing out the address based on commas, and then sending to the ESRI geocoder. I may look at using another service that has more matching logic on the back end so I don&#8217;t have to figure out how to de-construct the address.</p>
<p><a href="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-3.png"><img border="0" alt="remix-3" src="http://blog.davebouwman.com/wp-content/uploads/2009/11/remix-3_thumb.png" width="500" height="307"></a> </p>
<p>This shows the print widget, accessed by just clicking the printer icon (no drop down required). Oh, and the Open Street map cache in the background.</p>
<p>What&#8217;s nice about this is that the user does not need to go digging around in menus to access the functions they need. This template will be used for very focused applications &#8211; do one thing, and do it well is the mantra for the project &#8211; and so keeping things up front will really help out. </p>
<h2>Behind the Scenes</h2>
<p>So &#8211; the real question is &#8211; can we share this? Good question! I&#8217;ll be blogging more about how we (big shout out to Jeff Germain who whipped up the &#8220;toolbars&#8221; stuff) created various aspects of this, and at the very least, you can re-implement most of this stuff pretty quickly. We had to hack at the core of the Sample Viewer (specifically ControllerManager.as) and added a bunch of additional controls for our &#8220;toolbars&#8221;. At this point things are &#8220;working&#8221; for the scenarios we need right now, but I suspect we&#8217;ll have some refactoring in our future. I&#8217;ve got at least 3 apps that will build on this, and by the time all 3 are released, we should have tracked down all the weirdness, and have something that supports all the out-of-the-box Sample Viewer stuff, as well as our extensions. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2009/11/re-mixing-the-flex-sample-viewer/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Usability for Emergency Response Applications</title>
		<link>http://blog.davebouwman.com/index.php/2009/11/usability-for-emergency-response-applications/</link>
		<comments>http://blog.davebouwman.com/index.php/2009/11/usability-for-emergency-response-applications/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 05:09:24 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[ArcGIS Server]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2009/11/usability-for-emergency-response-applications/</guid>
		<description><![CDATA[I finally got around to loading a video of my talk on Usability in Emergency Response Applications, given at the ESRI South West User Group (SWUG) meeting. In this talk I give a walk-through of an app we built using the ESRI Javascript API, focusing on design aspects that helped streamline the end-user experience. I [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to loading a video of my talk on Usability in Emergency Response Applications, given at the ESRI South West User Group (SWUG) meeting. In this talk I give a walk-through of an app we built using the ESRI Javascript API, focusing on design aspects that helped streamline the end-user experience. I also discuss the performance impact of token secured services and SSL.</p>
<p>It’s up on Vimeo at <a href="http://vimeo.com/7557517">http://vimeo.com/7557517</a> or you can just watch it below…</p>
<p> <object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7557517&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7557517&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a href="http://vimeo.com/7557517">Usability for Emergency Response Applications</a> from <a href="http://vimeo.com/user963897">Dave Bouwman</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2009/11/usability-for-emergency-response-applications/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Log4Net in ArcMap COM Extensions/Commands etc</title>
		<link>http://blog.davebouwman.com/index.php/2009/10/using-log4net-in-arcmap-com-extensionscommands-etc/</link>
		<comments>http://blog.davebouwman.com/index.php/2009/10/using-log4net-in-arcmap-com-extensionscommands-etc/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 21:49:27 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ArcGIS Devt]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2009/10/using-log4net-in-arcmap-com-extensionscommands-etc/</guid>
		<description><![CDATA[I was building an edit task for ArcMap today, and got to a point where I had the geometry operations solid (using Test-Driven-Development for them) but when I got to iterating over sets of real data, I though it would be really handy to use a logger to kick out more detailed debug information. We [...]]]></description>
			<content:encoded><![CDATA[<p>I was building an edit task for ArcMap today, and got to a point where I had the geometry operations solid (using Test-Driven-Development for them) but when I got to iterating over sets of real data, I though it would be really handy to use a logger to kick out more detailed debug information. We use log4net in our web applications, so I thought I&#8217;d try dropping it in.</p>
<p>Turns out it took all of 5 minutes to get it working, so here&#8217;s the how-to (there&#8217;s some sample code at the end)</p>
<h2>Get log4net</h2>
<p>Get log4net from <a title="http://logging.apache.org/log4net/download.html" href="http://logging.apache.org/log4net/download.html">http://logging.apache.org/log4net/download.html</a> &#8211; simple.</p>
<h2>Add the Reference</h2>
<p>Now that you have the log4net zip archive, copy the log4net.dll from the \log4net-1.2.10\bin\net\2.0\release folder in the zip file into your \lib folder. I always have a \lib folder for external assemblies that are used in a project. This is preferable to storing these in a central location because the \lib folder get&#8217;s stored in source control along with everything else that your project required. So &#8211; if you don&#8217;t have a lib folder, make one!</p>
<p>Now that it&#8217;s in the create a reference to log4net from your project in Visual Studio. </p>
<p><a href="http://blog.davebouwman.com/wp-content/uploads/2009/10/ref-log-for-net.jpg"><img border="0" alt="ref-log-for-net" src="http://blog.davebouwman.com/wp-content/uploads/2009/10/ref-log-for-net_thumb.jpg" width="266" height="444"></a> </p>
<h2>Configure It</h2>
<p>The easiest way to use log4net is with the standard log file appender which just writes to a text file. In order to configure this, we need to edit the ArcMap.exe.config file (located in \ArcGIS\bin). Of course you can store the log in other places (databases etc) &#8211; just Google for the details.</p>
<p>By default, this configuration file is almost empty, so you&#8217;ll need to add in the configSections as well as the log4net section.</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">configSections</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">section </span><span style="color: red">name</span><span style="color: blue">=</span>"<span style="color: blue">log4net</span>" <span style="color: red">type</span><span style="color: blue">=</span>"<span style="color: blue">log4net.Config.Log4NetConfigurationSectionHandler, log4net</span>" </pre>
<pre class="code">       <span style="color: red">requirePermission</span><span style="color: blue">=</span>"<span style="color: blue">false</span>" <span style="color: blue">/&gt;
&lt;/</span><span style="color: #a31515">configSections</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>&#8230;lower down in the file&#8230;</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">log4net</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">appender </span><span style="color: red">name</span><span style="color: blue">=</span>"<span style="color: blue">LogFileAppender</span>" <span style="color: red">type</span><span style="color: blue">=</span>"<span style="color: blue">log4net.Appender.FileAppender</span>"<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">file </span><span style="color: red">value</span><span style="color: blue">=</span>"<span style="color: blue">.\\Logs\_log.txt</span>" <span style="color: blue">/&gt;
    &lt;</span><span style="color: #a31515">appendToFile </span><span style="color: red">value</span><span style="color: blue">=</span>"<span style="color: blue">true</span>" <span style="color: blue">/&gt;
    &lt;</span><span style="color: #a31515">lockingModel </span><span style="color: red">type</span><span style="color: blue">=</span>"<span style="color: blue">log4net.Appender.FileAppender+MinimalLock</span>" <span style="color: blue">/&gt;
    &lt;</span><span style="color: #a31515">layout </span><span style="color: red">type</span><span style="color: blue">=</span>"<span style="color: blue">log4net.Layout.PatternLayout</span>"<span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">conversionPattern </span><span style="color: red">value</span><span style="color: blue">=</span>"<span style="color: blue">%date [%thread] %-5level %logger [%property{NDC}] - %message%newline%exception</span>" <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">layout</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">appender</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">root</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">level </span><span style="color: red">value</span><span style="color: blue">=</span>"<span style="color: blue">ALL</span>" <span style="color: blue">/&gt;
    &lt;</span><span style="color: #a31515">appender-ref </span><span style="color: red">ref</span><span style="color: blue">=</span>"<span style="color: blue">LogFileAppender</span>" <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">root</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">log4net</span><span style="color: blue">&gt;</span></pre>
<p>Now we have to wire log4net into our code. In order to be useful, we&#8217;ll want to have access to the &#8220;logger&#8221; throughout our class, so we&#8217;ll make it a private member. Ideally we&#8217;d pass in the logger from a dependency injection framework, but we&#8217;ll keep things simple for this example (sometimes DI *is* overkill). Thus, we&#8217;ll setup the logger in the constructor of our class.</p>
<p><span style="color: blue">private </span>log4net.<span style="color: #2b91af">ILog </span>_logger;</p>
<p><span style="color: gray">/// &lt;summary&gt;<br />///</span><span style="color: green">Constructor.<br /></span><span style="color: gray">/// &lt;/summary&gt;<br /></span><span style="color: blue">public</span>LRSEditTask()<br />{<br />&nbsp;&nbsp;&nbsp; log4net.Config.<span style="color: #2b91af">XmlConfigurator</span>.Configure();</p>
<p>_logger = log4net.<span style="color: #2b91af">LogManager</span>.GetLogger(<span style="color: blue">typeof</span>(<span style="color: #2b91af">LRSEditTask</span>));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />} </p>
<h4>&nbsp;</h4>
<h2>Logging</h2>
<p>Would not be very much help if I did not show how to actually write to the log! Now that we have _logger, we can just pump data to it. There are a number of levels you use to send out data, depending on the severity. During development, I&#8217;ll use the Debug(&lt;info&gt;) method to see what&#8217;s going on inside the code, but you&#8217;ll also want to use the Warn, Error and Fatal methods when your code experiences errors. Using the different methods allows you to control what&#8217;s output to the log file via the configuration section. This way you can leave all that debug stuff in the code, but not have log files piling up on production systems.</p>
<p>In the sample code, I&#8217;m just pumping out examples of each type of log.</p>
<pre class="code"><span style="color: blue">public void </span>Activate(<span style="color: #2b91af">IEditor </span>Editor, <span style="color: #2b91af">IEditTask </span>oldTask)
{
    _logger.Info(<span style="color: #a31515">"Task Activated."</span>);
}

<span style="color: blue">public void </span>Deactivate()
{
    _logger.Warn(<span style="color: #a31515">"Task Deactivated."</span>);
}

<span style="color: blue">public string </span>Name
{
    <span style="color: blue">get </span>{ <span style="color: blue">return </span><span style="color: #a31515">"Log4Net Example Task"</span>; }
}

<span style="color: blue">public void </span>OnDeleteSketch()
{
    _logger.Fatal(<span style="color: #a31515">"On Delete Sketch Called"</span>);
}

<span style="color: blue">public void </span>OnFinishSketch()
{
    _logger.Error(<span style="color: #a31515">"On Finish Sketch Called"</span>);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>&nbsp;</p>
<p>In the log file you&#8217;ll see something like this&#8230;</p>
<p>2009-10-15 15:32:25,631 [1] INFO&nbsp; Log4NetDemoTask.LogEditTask [(null)] &#8211; Task Activated.<br />2009-10-15 15:32:29,205 [1] ERROR Log4NetDemoTask.LogEditTask [(null)] &#8211; On Finish Sketch Called<br />2009-10-15 15:32:33,003 [1] FATAL Log4NetDemoTask.LogEditTask [(null)] &#8211; On Delete Sketch Called<br />2009-10-15 15:32:38,182 [1] WARN&nbsp; Log4NetDemoTask.LogEditTask [(null)] &#8211; Task Deactivated. </p>
<h2>Post Build Tasks</h2>
<p>This is a subtle thing, but as far as I can tell, if you want your code to be able to &#8220;see&#8221; the ArcMap.exe.config file, your dll must reside in the \bin folder right beside ArcMap.exe. This is easily accomplished by adding a post-build event in Visual Studio</p>
<p>copy $(TargetDir)*.* &#8220;c:\program files\ArcGIS\bin&#8221; </p>
<p>Now, every time you build the project, it will copy your dll and any dependencies (log4net in our case) into the \bin folder. </p>
<p>A final note &#8211; when you start using logging, you&#8217;ll want to be able to look at the log without re-opening the file all the time. Thanks to <a href="http://viswaug.wordpress.com/">Vish</a> I&#8217;ve been using <a href="http://www.baremetalsoft.com/baretail/">BareTail</a> for quite some time now &#8211; this app will let you watch the file as lines are added to it. </p>
<p>Here&#8217;s a simple <a href="http://dl.getdropbox.com/u/765191/Log4NetDemo.zip">sample editing task</a>, along with an ArcMap.exe.config file. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2009/10/using-log4net-in-arcmap-com-extensionscommands-etc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Speaking at ESRI SWUG Next Week&#8230;</title>
		<link>http://blog.davebouwman.com/index.php/2009/10/speaking-at-esri-swug-next-week/</link>
		<comments>http://blog.davebouwman.com/index.php/2009/10/speaking-at-esri-swug-next-week/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 13:12:51 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2009/10/speaking-at-esri-swug-next-week/</guid>
		<description><![CDATA[ Just a quick note that I’ll be giving two talks next week at the ESRI South West Users Group (#SWUG09) meeting in Pueblo, Colorado. It will be nice to attend another conference that I don’t have to fly to!
I&#8217;ll be giving an updated talk on Usability as related to “GeoWeb” applications on Thursday&#160; morning [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="swuglogo" border="0" alt="swuglogo" align="left" src="http://blog.davebouwman.com/wp-content/uploads/2009/10/WindowsLiveWriterSpeakingatESRISWUGNextWeek_6569swuglogo_3.png" width="228" height="240" /> Just a quick note that I’ll be giving two talks next week at the ESRI South West Users Group (#SWUG09) meeting in Pueblo, Colorado. It will be nice to attend another conference that I don’t have to fly to!</p>
<p>I&#8217;ll be giving an updated talk on Usability as related to “GeoWeb” applications on Thursday&#160; morning at 10:30am (Room “MR 4/5”). This will draw from some previous usability talks, but without the hard-core developer content, and more focus on the process of arriving at a usable application using ESRI technologies.</p>
<p>On Friday morning at 9:30am (also in room MR 4/5), I’ll be giving a talk for my usual accomplice, <a href="http://briannoyle.wordpress.com">Brian Noyle</a> (he got an elk tag, so he’ll be up in the mountains stalking large animals) that will also be about usability, but in the context of an emergency response application we built. I’ll go into the design decisions, the application architecture, and some of the complexities we ran into when building a highly configurable, high-security application that can consume remote map services. If you want to see how far you can push the ESRI Javascrip API, drop by.</p>
<p>Assuming the wireless is stable, we will also be streaming some of the sessions and hope to chat with people on <a href="http://www.geogeek.tv">GeoGeek.tv</a>. At the very least, we’ll be recording my talks and hosting them somewhere. </p>
<p>I’ll also be tweeting about the various happenings using <a href="http://search.twitter.com/search?q=swug09">#SWUG09</a> as a hash tag, so you can follow along that way.</p>
<p>Hope to see you there! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2009/10/speaking-at-esri-swug-next-week/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GeoGeek.tv: Talkin Flex with Royce Simpson</title>
		<link>http://blog.davebouwman.com/index.php/2009/10/geogeek-tv-talkin-flex-with-royce-simpson/</link>
		<comments>http://blog.davebouwman.com/index.php/2009/10/geogeek-tv-talkin-flex-with-royce-simpson/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 04:42:18 +0000</pubDate>
		<dc:creator>Dave Bouwman</dc:creator>
				<category><![CDATA[GeoGeekTV]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.davebouwman.com/index.php/2009/10/geogeek-tv-talkin-flex-with-royce-simpson/</guid>
		<description><![CDATA[UPDATE: Apparently Royce has been slammed by the flu and will be re-scheduling &#8211; we&#8217;ll still talk Flex, and other random stuff though
Tomorrow, Oct 9th, we will be chatting with Royce Simpson, the developer who built the award winning City of Greeley “ORIGIN” mapping applications.
 
(Royce is on the right, Brian is on the left, [...]]]></description>
			<content:encoded><![CDATA[<h2>UPDATE: Apparently Royce has been slammed by the flu and will be re-scheduling &#8211; we&#8217;ll still talk Flex, and other random stuff though</h2>
<p>Tomorrow, Oct 9th, we will be chatting with Royce Simpson, the developer who built the <a href="http://events.esri.com/uc/2009/sag/list/?fa=Detail&amp;SID=1001">award winning</a> City of Greeley <a href="http://www.greeleygov.com/GIS/default.aspx">“ORIGIN” mapping applications</a>.</p>
<p><a href="http://blog.davebouwman.com/wp-content/uploads/2009/10/WindowsLiveWriterGeoGeek.tvTalkinFlexwithRoyceSimpson_13F1Bimage_2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.davebouwman.com/wp-content/uploads/2009/10/WindowsLiveWriterGeoGeek.tvTalkinFlexwithRoyceSimpson_13F1Bimage_thumb.png" width="404" height="290" /></a> </p>
<p>(Royce is on the right, Brian is on the left, and Jack is givin’ out the hugs)</p>
<p>We’ll talk about his background as a developer, what got him interested in Flex development, we’ll have him take us through the app and discuss various tools and how they were implemented. </p>
<p>Check out the apps, and join the chat to ask questions. </p>
<p>When: Oct 9, 2009 4:00pm MT</p>
<p>Where: <a href="http://geogeek.tv/live.aspx">http://geogeek.tv/live.aspx</a>&#160;</p>
<p>Follow Royce: <a href="http://twitter.com/roycesimpson">@roycesimpson</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.davebouwman.com/index.php/2009/10/geogeek-tv-talkin-flex-with-royce-simpson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
