Tuesday, December 27, 2011

How to Eat an Elephant

Yep, it's been a little while.  New job, a trip to Mexico, then married off one of the kids.  Just a little busy.  I'm hoping to be a bit more productive on the posting schedule now.  Especially with my new project.  It's a bit ambitious, to say the least!  It's a product that I've been kicking around mentally for quite a long time - over ten years.  There have been a few minor starts.  An ERD and a basic specifications has been as far as I've been able to get.  But, it was a start, and now I'm falling back on those basic writings to lay the foundation for what I'm diving into.

While it would be nice to sit down and crank out a project in just a few weekends of work, that's just not reasonable.  Especially when the design calls for a very complex and process heavy database server platform, which will support multiple mobile clients - the amount of which is yet to be explored.  Currently, I don't plan on describing what the project is, however I do plan on describing the process that I'm going through, and the amount of time and effort it will require.  I will say that if you know my roots as a programmer and developer, then you can get a pretty good guess as to what market I'm aiming for.

So, now that I'm committed, I'll describe my past weekend.  Being 4 days long, it was a great opportunity to get focused, roll up the sleeves, and get to work.  I started by spending the first 3 hours trying to decide what programming language I would utilize.  Since the client side is going to be targeted for iPhone and Android devices, I already have an environment that I'm using for the beginning of the project.  I've always been a fan of NSBasic, ever since my old Apple Newton days.  While I've not used it extensively for the past 8 years, I've always kept an eye on it and the progress that George Henne and his team have made.  I'm impressed with their ability to adapt to changes in the industry and to keep the product alive and marketable.  I highly recommend taking a look at it as a development platform - especially if you want to crank out something quickly.  I'm not yet sure if it's going to take me all the way to a completed product, but it's a good start.  Even though it's a BASIC development environment, it produces HTML5 and Javascript code for the client side.  And knowing George, he'll be on the bleeding edge of advances in the technologies.

My biggest struggle was in selecting the environment I would use for the back end.  I knew that I needed to use a method of threaded communications with multiple clients.  Since I wanted to utilize the use of Websockets, I started my search for a good set of existing routines or a library as a starting point.  My criteria for my decision would be based on:
  • Existing websocket libraries
  • Will improve my ability to contribute technically to my "real" job
  • Must support MS SQL as a back end database
  • Can support multi-threaded, concurrent client connectivity
  • Must be a language I either already know or can get up to speed quickly
While I can work wonders with Excel VBA or VB itself, those environments are not even in the picture.  I knew that it would boil down to either Java or C#.  There are a ton of websocket libraries for Java and I've done a lot of Java work in the past.  However, I still have nightmares about trying to use Netbeans for binding my code to MS SQL views.  My employer utilizes a C#/ASP/.Net environment for their products.  So, after spending some time examining C# Websocket libraries, and doing some testing, I finally made a selection.  I decided to base my connectivity code on the Fleck Websockets library.  It is pretty much bare bones (easy to understand), and the developer has done a pretty good job of describing how it works, and how to use it.

Now for the proof of concept!  After figuring out how to use port forwarding on my local network, out through my Comcast modem, I configured the Fleck Websocket server code and launched the server.  Then I used the NSBasic Websocket sample code, made a few modifications, and then deployed it to my development web site.  I pointed my iPhone Safari browser to the client code.  Then came the whooop, as my client text was being received by the server and then echoed back to the client.  Connectivity proof of concept completed!  A milestone.

At least that is far enough to give my project a code name - Manta Ray.  (Why not?!  Apple likes cats, Android likes sweets.  I'll go with sea life!)

Completed: Proof of Websocket concept
Next: Database design & ERD

Keep writing. codito ergo sum