Dev Summit Talks: Vote Now!

Posted by Dave Bouwman | Posted in Dev Summit, Presentations, Rails | Posted on 20-01-2010

2

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 year I’ve submitted two talks, and Brian Noyle and Mike Juniper have thrown one into the mix.

First up – Ruby-Fu: Using ArcGIS Server with Rails

As noted in my last post, 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.

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.

I’m also going to build the app using Behavior Driven Development using Cucumber, 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.

As noted in the talk description, all the code will be put up on ArcScripts and on GitHub. I plan on using the Portland Landbase service hosted by ESRI so that there is no ArcGIS Server setup required to play with the app.

Why vote for this? Ruby is a lot of fun, and offers a different point of view on development… and James Fee says you should ;-)

 

My second talk is titled Bloody Knuckles: Building Secure Applications with ArcGIS Server

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 http://vimeo.com/7557517  (presented at the 2009 ESRI South West Users Group). The Dev Summit version will be much more “deep dive”

Why vote for this? Who knows when you’ll find yourself needing a SSL certificate and token based security.

 

Brian and Mike have taken up the charge with “There’s an App for That: Building iPhone applications with OpenLayers and ArcGIS Server”

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.

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.

 

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.

2010 – A good year for the Dark Arts

Posted by Dave Bouwman | Posted in ASP.NET MVC, Personal, Rails | Posted on 13-01-2010

8

chthulu-railsRuby 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 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?

Why Rails?

First, unless you’ve been under a rock for the last 5 years, you’ve likely heard that Ruby on Rails is *teh awesome*, so that counts for something. Then there is the fact that Andrew Turner (@ajturner for the Twitterati) / GeoCommons crew as well as Paul Bissett / James Fee and the WeoGeo team are all smart as hell, they all love Rails.

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 BizSpark 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 pain pleasure of dealing with the maze of Microsoft Licensing sites, 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.

Anyhow… back to my point. On Ubuntu installing software is crazy simple – “sudo apt-get install <software of choice>”. 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.

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 ;-)

Ruby on Rails. Yeah. So, it seemed that expanding my horizons a little may be interesting, and worth some evening time. I started with “Rails for .NET Developers” 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.

Patterns nom nom nom…

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)

Because this post is rife with asides, let’s have another… It’s interesting that Rob Conery, of Hawaii and various levels of internet fame (creator of SubSonic, an ex-Microsoftie and now TekPub.com 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 this post 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?

I can haz Data Nao?

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!

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?

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.

What Now Brown Cow?

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.

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!