Sapien amet…

(Planning the project)

Hi all, and sorry for the slow updates. My new job has had me so busy that I have not found any time at all to work on my plant watering project. In addition, with the release of Visual Studio 2013 the gadgeteer project that I had going no longer works, since the .Net micro framework and Gadgeteer API’s need to be upgraded for the latest version of Visual Studio! I also need to get a new mainboard for the project as the one I have does not support WiFi!!

Visual Studio Online – The project planning tool

Today, I want to tell you about using Visual Studio Online (VSO). That’s the new name to “Team Foundation Service” which was introduced a while ago.

VSO is free to use in projects up to five people, and if you are an MSDN subscriber, you do not even count towards those five. So, for all your hobby needs, you should need no more than this to get started on your next project. I will look at the agile planning part of VSO today, so this is not only for the .Net people!
Let me repeat this:

It does not matter what language you develop in, or even if you are a developer at all. VSO is a purebreed project planning tool that will see your Agile project needs fulfilled!

 

Planning

When you plan a project, you typically have some different areas and concepts that need to be defined. These areas, or features as they’re called in VSO (“epics” in Jira) allow you to group together a set of user stories for which you plan your work. My Water My Plants (WMP) project is split into the following epic parts:

image

Using features, it’s easy to find a home for all the backlog items in the project. As you can see from the image above, I have 6 main features in my WMP project, each with their set of backlog items. For a more general LOB application, you could have features such as “invoicing” or “maps”. Some books describe epics as user stories that represent too much work for one single sprint.

With the above list of features done, I can easilly just change viewmode to “features to backlog items” in order to start planning the user stories. This viewmode basically adds a huge plus-sign to the left of the highlighted feature and clicking it add a new user story below it. You can see in the next image that I’m working on “Windows Azure” and setting up some work that needs to be done there:

image

Backlog items are user stories, and not tasks. In a large project, you would plan for the features and backlog items together with the stakeholders of the project (such as the company owner, project lead etc) and once you’ve got a Product Backlogyou order it by priority so that the developer team can start planning their work.

Get sprinting

The sprint planning process is identical to backlog creation; assemble your developers, and walk through the backlog items having selected view “Backlog items to tasks”.

image

As you can see, now you’re clicking the big plus-sign on a backlog item in order to define what tasks need to be done in order to deliver the backlog item. The tasks are described and estimated. The smaller (in time/complexity) the task, the better, because smaller tasks are easier to estimate. Your team commits entire backlog items (with all the tasks) for a sprint – as may as they think they can manage in the alloted period.

It is important to remember that your team commits entire backlog items to the sprint, and not individual tasks! I can’t begin to tell you how many times I see teams trying to deliver individual tasks in sprints. This gives no value to the stakeholders, because as long as there is a missing task to the backlog item, then it cannot be delivered and tested.

Once your team has planned enough tasks to last the duration of the sprint, they can now focus on the work getting done, and follow their progress on the burndown graph.

image

What I like about VSO is the clean interface, and tight integration with Visual studio. Inside Visual Studio, I have a prioritized “Assigned to me” query that has been put in my team page:

image

Clicking on this gives me the work items that are either bugs or tasks todo or in progress. I can then easilly associate each check-in with the task that I was working on. The order of the tasks is, as you’d expect, the order of priority that I arrange the backlog items that the tasks belong to.

Systems like these are the recepy for success in any modern software project. I honestly believe that VSO has no match because of the tight integration with Visual Studio and MS Office.
(you can hook up Excel to this just as easilly).

So there you have it, this is how my plant watering project is managed on a larger scale.

Read more about this on Application Lifecycle Manage and Agile planning on the Visual Studio site

– and lets hope that the API’s for working with Gadgeteer comes to Visual Studio 2013 soon!

Merry Christmas!

P.

Faster and Slower

Growing concerns about the direction of Xaml-based applications

Microsoft, what the hell do you think you are doing by diverging WPF, Silverlight and Silverlight for WP7?? None of those 3 destination platforms have any solid foothold as of yet. By making different options of XAML available in different destination platforms, you’re only doing one thing: pissing off developers. Stop doing that, this is really simple:

WPF

imagesCA28TSXTWPF should be the mother of all xaml based apps and have every available technology to it – including webcam support as in silverlight, MEF, etc. WPF needs to be that “unlimited” target platform from which both silverlight and WP7 pick their features from.

Silverlight

imagesCA197ISS

Why oh why can I not use data triggers in SL? What is the reasoning for it? I know MS has “shifted focus” for Silverlight. This, in my ears, is bull. Silverlight on iOS and Android will give developers reason to use it. WPF alone cannot succeed as the only xaml-based platform, and SL makes sense for servicing the current craze of tablets and smart phones. Very few people will disagree when I say that MS powered devices (tablets and phones) are lagging far, far behind. For SL to be a success, it needs to penetrate iOS and Android. End of story. rest is just bull.

Silverlight for WP7

phone7I accept that SilverLight for windows Phone 7 will offer different capabilities from Silverlight as a xap, but what I don’t get is why this version of Silverlight has to be a framework behind the current release of Silverlight web?? It makes no sense, whatsoever to keep developers in confusion station by not holding back releases until the technology is ready on all platforms!

Converge now!

What Microsoft needs to do, is to hold back releases, so they can do a unified XAML platform upgrade targetting windows, SL and WP7 with the same developer options and syntax. No data trigger support for WP7 means dont release it for Windows or SL either! This is FAR better for developers than the mess you’re giving us now! XAML as a developer platform, needs a unified version number, we dont want to have WPF for .Net 4.0, Silverlight 5.0 for web and SL 3.5 gutted for WP7. 

So, where was I?

You may have notice that digitaldias was down for a week or two.

I’ve been using an SHDSL line (Single-Pair High-speed Digital Subscriber Line) for the last 6 years, giving me a whopping 2Mbit in both directions!

Recently, though, I’ve been on the lookout for higher download speeds, as iPads, laptops, and even the PS3 consume more and more information from the web. When I was offered the option of 20Mbit down, and 1Mbit up for much less moolah, I took it.

My blogs will load at half speed (as if you care!), but then again, I dont connect back to my office over VPN anymore, so I dodn’t have any good excuse to pay that much for a decent speed out anymore.

I still want higher output speed, for using skype in HD, but that’ll have to come when the prices (and availability) fits.

Logo

My ISP, Nextgentel delivered fast and reasonably priced this time. For that, they get a nice, well deserved kudos from me Smile

Hosting a Silverlight app in Azure

A quick introduction to how you can get up and running with Microsoft Azure – It is a hands-on guide into creating a silverlight application that uses a REST api to manage SQL data in the cloud.

Who should read this:

This article assumes that:

  • You know (and love!!) the SOLID programming principles
  • You know what WCF is and how to host and consume such services through IIS
  • You have some knowledge of the Entity Framework ORM
  • You want to get something out on windows Azure, but you’re not quite sure how to

 

The concept

I am writing an inventorizer application. The idea is to keep track of my movies and to know where in my house they are supposed to be. This way, I know where to put a stray movie, as well as check that all movies that are supposed to be in a specific shelf actually are there.

Later, I will extend the application to access my movie list from mobile devices, so it’s going to require a REST api right from the start.

Entities and storage

To get started, I defined 3 basic entities for my application:

Entity Detail
Location Room / Area in my home
Storage Shelf, drawer, box, etc. Exists inside a Location
Movie Stored inside a piece of storage

 

Using Entity Framework, I started by creating a model from a blank database:

image

I’ve explicitly given the entities the prefix “Db” in order to separate the objects from my C# domain objects.  Automapper does the conversion for me – pretty straightforward. I keep my domain objects clean, and clear of the Sql Server, as you should too.

SQL Azure

To work with SQL Azure, you need to have a valid Azure account and you also need to have created a database for the purpose. I won’t go into the details of the database creation process; basically, you follow a database creation wizard that does what you expect it to.

Once created, you want to connect your Visual Studio Server explorer to this newly created database. To do that, you first allow yourself through SQL Azures firewall, which is fairly simple, flip to the Firewall Settings tab and click on the button “Add Rule” which brings up this:

 image

Complete the firewall rule by setting your IP number then click OK and flip back to the databases tab to get a connection string:

imageThe connection string does not have your password in it. You’ll have to edit that in after you put it in your settings file. If you need help in pushing your model to Azure SQL, just drop me a line, and I’ll help you out.

Setting up the REST service

Setting up the REST service is a mattter of

  1. Defining your service interface
  2. Implementing the service in some class
  3. Setting up the service endpoint configuration in your service configuration file

Important note:
In order to implement REST and use WebGet and such, you need to include a reference to System.ServiceModel.Web. Make sure in your project properties that you’ve selected the full .Net Framework 4.0 and not the .Net Framework 4.0 Client profile as your target framework, or System.ServiceModel.Web won’t be visible for you to reference.

Defining the service interface

Not much hassle here, the special consideration is the REST way of making the endpoints accessible:

image

Implementing the service

Since we started with the EF model, implementing the service simply means creating a repository interface (for convenience) and then implementing it with the generated context class

image

Setting up the service endpoint configuration

To roll out a successful REST service that serves both POX (plain old xml) and JSON data, I had to actually create two different binding configurations even though they’re equal in configuration.

image
Second, set up a couple of behaviors, differenciating only in the default response format:

image
Finally, set up the endpoints you need:
image

Since we are hosting this in Azure, we do not specify any addresses.

Creating the client

Now that both the database and REST API is up and running, you only need to create a regular silverlight client, point it to the service, and you’re in business. I actually created a SOAP endpoint in addition to the POX and JSON addresses since I do not need to box data between .Net clients, thus my Silverlight client config has the following service reference:
image
Notice the relative address, since I’m hositing the Silverlight client from the same location as the service, I use the relative address to avoid cross-domain issues. This took me some time to figure out. I usually start out with a basicHttpBinding and then swap over to TCP/IP once everything is up and ok.

If you need more details on how to write a silverlight client, just drop me a message.

Azure considerations

So, having completed, tested, and debugged the project here on earth, it was time to deploy the pacakge to Azure. There was one last remaining thing to do, and that is to put a checkmark on your Sql Azure configuration screen in order to allow your services to connect to the database:

image
This is definetely another one of those “easy to forget, hard to figure out” things…

Integration Testing

I wanted to have a set of integration tests that directly referenced the SQL Azure database without destroying any data, so I opted for the transaction approach where you basically begin a transaction before each test, and then roll back all changes after running it. This led me to the following base class:

image

The base class basically implements the TestInitialize and TestCleanup methods to begin a transaction before each test, and roll it back (Dispose()) after each test has run. Any test that throws an exception will then automatically roll back the database.

TIP:
If you use the TestInitialize or TestCleanup in a base class, your derived test class won’t be able to use those attributes. This is why I added the virtual Given() function so that I can do my test setup there, should I need to.

An example of use:
image

The testclass above creates an instance of the class StorageRepositorySql and the test that is run is then packaged inside a transaction scope and rolled back so to not disturb my SQL server data. If you want more details on the base class, just let me know.

Running these tests is surprisingly fast, on my 2Mbit internet line, most of my tests run for less than 50ms each, which is pretty amazing, considering the transactions and that I’m in Norway while the Azure store probably is in Ireland!

Conclusion

Microsoft promises that “going Azure” should be pretty straightforward, and not much different from what you’re already used to. I tend to agree, it has been surprisingly easy to get something up there and running. Most of the challenges were actually in configuring the REST endpoints and figuring out how to allow the WCF services to access the SQL database, but other than that, the rest is straightforward.

At the end of this article, I’ve prepared a short Silverlight application that simply lists the locations in my SQL Server. It should be available through the following URL:

http://digitaldias.cloudapp.net

However, since this is work in progress, you may see a more advanced thing on this page as my application progresses, or something completely different, or, perhaps nothing at all – I make no guarantees, other than that it should be there if this article isn’t too old Smile 

P.

Ranting over change – an exercise in futility?

I’m an avid blog reader/commenter and have seen the rise of a wave of rants about Microsoft’s LightSwitch and Microsoft WebMatrix. These are products designed to make writing windows applications as well as web pages even easier than it already is, making the process of creation accessible to more people than ever. Some express direct rage about this, others are concerned about their bread & butter.

 

"State of the Art" Amiga Demo, winner of The Party 1992I’ve been around since the ZX81 (in excess of 26 years) as a developer, flipping through an endless plethora of developer languages.
In those days, developers learned assembler first, after a few months of punching in BASIC code from a dubious UK-based computer magazine.

Remember all those cool demo’s on the Spectrum/C64 and later Amiga scenes? 90% of’em were done in pure assembler! Pascal was hot for a short while before yielding to C/C++ .

 

I switched over to the Microsoft platform sometime during the MSDOS / Windows 3.11 era.
(i386SX without a floating point processor!)
In my opinion, the moment you loose control over the CPU’s registers and/or it’s memory, is the moment you lost control.

MSIL/BYTECODE languages (java, C#, VB…), interpreted languages (ruby, python) are not ,  by that definition, "pure" languages. They take away control from the developer in order to prevent the developer from making mistakes that tear down all of it’s surrounding applications (and often, the OS). Actually, when I come to think of it, even Assembler takes away some control in that you can no longer address invalid registers, or shift memory to non-existing locations without a compiler error.

Time, money, and big feet

How often do I read how "messy" C++ is because you have to handle the memory yourself. The fact of the matter is that C++ requires a strong sense of discipline; if you understand the language, then you can write Greedy brains!applications that make the best Java and .Net apps look really, really neandrathal, in terms of anything! (performance, memory footprint, program size…) – at the cost of time!

And let’s just say, when people started enrolling in developer classes in the 90’s, it wasn’t because they had a sudden geek awakening, they saw money in software business, and wanted to be a part of it. Today, they’re the vast majority of developers out there. Microsoft makes money on software licenses. It is only natural that they write code for these masses.

But at the cost of performance and memory footprint, C#, Java and other languages make our everyday easier; I can whip out a complete, working business application mockup in a day or two using modern tools (SilverLight/SketchFlow). I used to be employed in a large consultant business where the vast majority of solutions delivered were MS Access "applications".

 

So what makes it all good enough?
Solving the customer’s problem.

 

Conventional Purist Pattern Pride

In all our purism, dogmas, theorems and idelogies, the fundamental truth is: The customer doesen’t give a rat’s jewels about how you solve his problem! He looks at you as being a huge expense that has to be made, nothing more. If you can satisfy his needs with a technical solution that is less expensive than the competition, then you’re more than likely to have a satisfied customer. Ayende has a great image on his rant on this – really boils it down to the essence!
I am a purist myself, make no mistake about that,  I do take pride in my software craftmansship, but I’ve also seen so much “bad” sofware out there, and the customer is happy!
– At the end of the day, that’s really all that matters!

For long running, or high-risk software that requires quality;
I more than often see that it really just boils down to convention. Patterns tend to be tweaked around to circumvene technical limitation, or even more common, user ignorance. Who does not have a “Tweaked” MVP pattern, or a “somewhat modified version of” MVC.. recognize yourself? 

My opinion is that it is you, and not the software, that sets the standards. Just like a carpenter, if you do not have pride in the work you do, you simply cannot deliver quality software, regardless of how good tools you have. Granted, using a nailgun instead of a hammer, you can still produce cleaner looking wallboards without the dents and bruises of 60 missed hammerhits, but if your nails are spread around shotgun style, you know that wall aint gonna last long anyway.

MetaProcess, MetaDeliver, MetaWin:

Microsoft is making it easier and easier to shovel out software that requires less skill to develop with products like LightSwitch. Is this bad?
I say – “No, that isnt necessarily bad”

ANY “good” software has undergone the following metaprocess:

  • Have a clear definition of application’s domain (what does it do?)
  • Plan for re-use and upgradeability(modularity) where possible
  • Make the application as maintainable as possible (clean code, clear intentions, refactor)
  • Cover your application’s functionality with tests(TDD, DDD, DDT)

Neither language, nor technology have any impact on this metaprocess.

meta-tag-seo

What is important, is that the technology’s operator understands the technology (a question of syntax and experience). If it helps me deliver software at a lower cost without compromising my craftmansship, then by all means, give it here!

In my view, WebPrism and LightSwitch must also undergo the same metaprocess in order to be developer platforms that are usable for corporate offices.

 

Some references (Links go directly to the articles):

InfoQ article

The Inquisitive Coder

Jason Zanders WebLog

PCWorld.com

Ayende’s Blog

Painful correctness

Catching up

Back to work again to my new employer, this time (back) in the role as an IT consultant and a senior one at that. It is refreshing to work in an environment that is constantly challenging my knowledge about various technologies. Now if I only could figure out how to get used to having a laptop computer with me back and forth every single day and I’ll be one happy camper..

Away, fatness!

Managing to work out in the morning without sweating down my clothes afterward is a challenge. As spinning classes now are back to their normal 3-day per week schedule, I need to figure out how to stop sweating after the shower!

Look sharp! Look dry!

A thing that is bugging me, is that it really isn’t easy bringing a gym bag, a laptop backpack AND dress nicely all on top of my mountain bike on the way to the train station. This is getting to the point where I am seriously considering taking the car to the train station just to avoid the hassle. Clearly, being environmentally aware is not compatible with being a commuter – not in the consultant business!

Rough waters

The basement is now dry after the flood now and ready for a fresh coat of paint. We still haven’t moved anything down there, as we are hoping to do something with the roof while we’re going to paint/lay new flooring there.

Chip! chip! chip! chip!

Photography has been dead the last month or so. With the new job taking up all my available brain power, and Stargate SG-1 taking up the spare time, I am saving most of my creative energy for work, but I still have managed to push forward a project for controlling my Pre-Amplifier. Expect a dedicated home page soon. I had a similar project far too many years ago, written in C++ using MFC and virtually no knowledge about agile software development. The new version is being written in C# using a 3-tiered model, complete with a separate unit testing project, installer, user documentation, and scrum as the project management methodology. The thing is practically writing itself!

Tell me about myself!

Oh, I woke up this morning thinking that I have really never written an “about-me” page in spite of having had a home page on the internet since around 1995! Of course, you cannot wake up a Sunday morning thinking a thing like that without immediately scratching your groin, jumping out of bed, and writing one, so.. I did, and here is the result.

Live and learn

Starting out with a new will for photography, now that May month is here and is almost done filling me up with much needed vitamine D, I have began to look at photography again, currently looking at how the use of flash in various ways can improve the way I shoot.
Quita in the garden
It should follow, naturally, that I have purchased yet another studio light (500w this time) as well as a cheap, chinese remote trigger that actually works! Viva Kaffebrus in Sweden for making amateur studio photography possible!
New Job!
After much talking about what to do and what not to do, I decided to end my work at FotoWare and instead go back into consulting, where I feel that I belong. This means that from August, I will be working as an employee of Mesan as a consultant specializing on the Microsoft platform. I do believe it will be a good swap, but time will tell, I remain sceptical.