Archive for October, 2008
…Should I use Silverlight? Part 2: A Mapping API
I searched for a while tonight but was unable to find a mapping API for Silverlight. I found several examples of maps built with Silverlight, but I’m not finding great references for building one of my own. I know that I won’t be able to make much progress without a solid guide.
I found a few paid solutions. The best one seems to be http://www.componentone.com/SuperProducts/MapsSilverlight/ but I have no intention of paying for any of my development tools. So that’s a no.
It seems that I could write plain JavaScript for Silverlight and therefore I could use the Google Maps API or the Live Maps API. I have already enumerated my reasons for avoiding those though, and don’t plan on changing directions on that right now.
It looks like I’m going with Flex. But…you guessed it! The next step is not to start coding, and it is not to start learning Flex. I have started coding before designing before in my life, and it just does not work.
So…on to design. I will write myself a pseudo design document, which I will follow. It seems silly to write a document which only I will read, but it helps infinitely. I’ve learned this the hard way, both in academic and professional settings, and I won’t mess that up again.
No commentsShould I use Flex or Silverlight? Let’s decide together…
thSo obviously as soon as I ruled out Silverlight and decided to stick with Flex, Silverlight 2 was released, and I now have to go back and re-evaluate its usefulness. I still maintain that I have limited my decisions to RIA. In other words I have to decide between Flex and Silverlight. So, I will do a full comparison of the two.
First, let me "define my terms", as the history majors say. There are a few things that I will aim for, and a few that I will explicitly not aim for.
- Easy for the end user, for example
- A large install base OR a very simple install
- A familiar UI
- Should work on every browser, without too much work
- Easy to code for me
- in particular, the UI should be easy to code, since I hate writing UI code
- a familiar language would help. I know several
- a nice and clean IDE would be nice. I have grown accustom to programming in real environments
- Existing frameworks for key elements
- I will need a mapping API
- I will need a slider (really a Dual Slider) already written. I wrote one of those and it wasn’t fun
- I will need a way to make HTTP requests asynchronously
- Easy to test for me
- debugging is the most important: I need to be able to do basic things like tracing and maybe breakpoints (though that is not absolutely essential)
- compatibility testing: there are tons of browsers, and I don’t want to have to test in more than, say, 1
So I will step through that list and compare the two, one by one.
| Goal | Flex | Silverlight |
| Ease of Installation | Yes: Everyone has youtube | Yeah I guess: kind of a pain |
| Familiarity of UI | Yes: youtube | Yes: controls are WMF |
| Browser compat | Yes: all | Yes: all |
| Familiar Languages | Not really: mxml | Yes: JavaScript and XAML |
| Easy and free IDE | Not really: Expensive | Yes: Visual Studio Web |
| UI Framework | Yes | Yes |
| Mapping API | Yes:Google Maps for Flex | Not really! Uh oh… |
| Dual Slider | Yes: I found one | Yes: I found one somewhere else |
| HTTP requests | Yes: built in | Yes: built in |
| Basic Debugging for free | Not really | Yes: In Visual Studio |
In the course of doing my research, I found out a few features that I had not originally considered, so I add those to my considerations.
App Storage:
Silverlight offers application storage, which the user has to approve. I could use this to make loading and unloading maps much easier, and I could use it have users create their own historical content. And I’m sure I could find other users too.
I found and read this fantastic comparison early on but didn’t want to cloud your judgment. You should read it though. He concludes that Flash should be used, but none of his reasons overlap my reasons. He cites the low cost of Flash as a plus:
For under $1000.00, Adobe sells the full web development CS3 kit, which will give you all the tools you need to develop a dynamic website with scripting, AJAX, and Flash.
By budget is about $1,000, give or take $1,000, so I don’t think I will be spending it on the fancy Flash IDEs that he suggests.
That only leaves one thing: Mapping
I had trouble finding a mapping API for SilverLight, but will keep looking for a few days before I make any more decisions.
No commentsChoosing the Stack: Part 1: Researching Your Options
After getting all my notes together and organized, I realized immediately that the next step had to be choosing an architecture, or stack. (Those two are not synonymous, but its ok).
To start, I looked at the components of the stack of the proof of concept version, from bottom to top:
- OS: Linux - as chosen by my web host, and not likely to change
- Back end database: MySQL - the only one I know well
- Back end code: PHP - my host does not support Python in a way that will help me, so this is pretty much locked in
- Back end to front end link: JSON - (not exactly part of the choice, but interesting)
- Front end language: JavaScript
- Mapping API: Google Maps
- AJAX framework: Yahoo! User Interface (YUI)
- UI pieces: YUI
I know that I am basically stuck with PHP, MySQL and Linux on Apache (aka LAMP) and am cool with that. So I checked those off the list.[¥]
That leaves the front end or the part that a regular user sees. I have a few choices, as far as I know. There are three different types of application, and some choices within each type.
- Desktop application
- this might make sense for some cases, but not for me
- Verdict: No
- AJAX
- What the proof of concept used
- No installation necessary, so a lot of users can use the site by default
- Good libraries exist now (YUI, JQuery…)
- A little tough to do good UI work, especially debuggin on multiple systems
- RIA or Rich Internet Applications (e.g. Flash or Silverlight)
- Full featured UI sets
- Full featured IDEs - the program I program in
- Well documented
- Fairly widely installed, especially since YouTube uses Flash
Now that I have laid out my options, I need to ask myself what goals am I trying to solve, and which tool does the best job. I personally happen to be much better at logic and "core" programming, and much less good at user interface coding. To me it is therefore important to choose a tool that makes UI programming much easier. Since this is a not-for-profit, complete side project, I don’t mind so much if I make my users install Flash. I don’t have any users at al right now, so I’m not too worried about that. I also do not have resources (time, money, or hardware) to test on any combinations of machines, so would like to make the platforms my app might run on as minimal as possible.
All those points push me to RIA, and so that’s my decision. That’s not to say AJAX solutions aren’t perfect for a lot of people (e.g. Gmail), it just isn’t my best option.
Basically the two RIA options are Flash/Flex or Silverlight. Flash has a higher install rate, and I work for Silverlight’s owner, so I am choosing Flash/Flex.[±] Flex can interact with Google Maps, too, which is crucial. I certainly am not writing a mapping API by myself.
So there you have it. My preliminary decision is to go with Flex. Next I will look at Flex in great detail to make sure I have made the right choice, before I jump into coding or planning (or learning Flex, for that matter).
[¥] I didn’t actually. I would love to use Python and when my hosting ends in a few month I will seriously consider to switching. I don’t like my hosting that much right now, but will deal with it for now.
[±] Flash is the player that you are probably used to seeing (think youtube). Flex is a free SDK that lets me write Flash .swf files for you to see in your player. I will refer to the combo as Flex from now on.
No commentsCollating some notes
When I was 15, I loved Debt of Honor, by Tom Clancy, and like the main character’s wife in the book, I believe that if you don’t write it down, it didn’t happen. So whenever I have an important thought about Visualize History, I write it down in whatever is handy. If that means a pad from a grocery store on top of the Alps, then so be it (that happened). If it means an email to myself, a file on my hard drive, a bookmark in Google Notebooks, or any of a number of other locations, so be it.
I have been organizing all those notes. Taken separately, you might think that (a) I am crazy and (b) I have no idea what I am doing. I sometimes think so myself. But I was amazed at the cohesive picture my notes make, when combined with each other. I love the human brain.
So, now that I have done that, the real work begins. Stay tuned.
No commentsThe blog is back
I resurrected the blog today with a little trickery and fancy SQL-ing. I have taken quite a liking to blogging so expect more from me.
No comments