ReBuildAll
LenardG's thoughts (mostly) on .NET development

Moving ASP.NET Identity model into another assembly   (ASP.NET)   
Visual Studio 2013 and MVC 5 has arrived (as well as the "One ASP.NET"), with ASP.NET Identity in tow. The new identity feature allows user profile information to be part of the ASP.NET Identity model. In essence, the identity data structure can be merged with whatever data your application has, creating a seamless integration of identity data and application data.

The result? You do not need to have two data models / entity models for your application (and as such, two Entity Framework DbContext's).

Microsoft also provides a description of how this can be achieved, using Entity Framework migrations.

But what if you want your data model to live in another assembly, not the default web application? Reasons for such a thing might be a shared data access layer between different applications. You could have a Web application and another service that does background processing, both of which need access to your data.

The default ASP.NET MVC 5 project will have an IdentityModel.cs file in the Models folder. This contains the expandable identity model. But it is included in your Web application.

This is a description of how you move the identity model to another DLL.

Add a class library
The first step in moving your data access logic to a central assembly is adding a new class library project to your solution. This new class library will contain the data access layer, and you will reference it from other projects that need data access.

Go into NuGet package management, and add the Microsoft ASP.NET Identity EntityFramework package to the project. This will also pull in some dependencies.

Now you are all setup to actually move the identity model here.

Move over the identity model
Next, take your Models/IdentityModel.cs file from the Web application and move it into the new class library. (Move, and do not copy it. It should not be in the Web application after this step).

Change the namespace in the file to match that of your intended data access layer.

Optionally, you might want to create a separate file for the data context class. This would be a good time to do that.

Add references and usings
Last step, go back to your Web project and add a reference for the data access library.

Open AccountController to add a new using statement for your new data access namespace.

Start working on the data access layer
And now you are done. You can now add your entity classes and add IDbSet properties to the data context class. Build your data access layer. You will have only one data context class, that has both your application data and your identity data together.

WoDalmanac   (Apps)   
So I had this idea that I will start publishing some of my so far private work as open source. I do not know how much time I will have supporting this idea, but it seems like something good to do. I decided to start a new blog dedicated to this effort (which does not mean I want to abandon this one).

As a first application I published WoDalmanac. It is a tool I did for our role playing game sessions. Very useful for Vampires and Werewolves :-)

Read more about this tool here: WoDalmanac

From there you can visit the Bitbucket repository or download in binary format. It is written in C# and runs as a Windows application.

WSDLMerge v1.2   (ASP.NET)   
WSDLMerge updated with small bugfix. Available from the project's google code page as usual. Both source and binary.

WSDLMerge updated   (Web services)   
I wrote about a tool I made in this blog before (see the original article here). The tool called WSDLMerge can merge WSDL documents and XSD documents that it references into a single file.

I just updated this tool. The updated source code and now also precompiled binary version is available from the project's site.

I ran into some problems with some WSDL files, which made me update the tool. Some people also wanted a binary version instead of just source, so that is now also uploaded.

I had a WSDL file that referenced different XSD files, but with the same targetNamespace. This made WSDLMerge ignore the second import.

Also, the include statements are now getting parsed as part of the XSD files. The included schema is inlined into the schema that invokes the include.

Extending MVC validation with new rules   (MVC)   
Did you ever want to extend MVC validation with new rules? For example in my work I need to validate fields that contain Finnish social security numbers, business identification numbers or IBAN bank account numbers. These have a well defined format. They also have check digits/numbers that can be used to verify if the number is actually valid.

While I could use simply regular expressions to verify the format itself, it is not possible to validate the check digits / numbers without actually coding them.

If you have used data annotations to create your ASP.NET MVC models, you know that it is very easy to add different kinds of validation rules to your data model. ASP.NET MVC will take care of generating all the needed client side validation logic for you (which uses jQuery Validation) and also makes sure the data is validated on the server side as well.

In this article I will show how to extend this mechanism and provide easy to use client and server side custom validation using the same mechanics. I will use MVC 4 in this article, but the core validation works with MVC 3 as well (some examples use bundles, which were not in MVC 3, but the actual validation logic will work with MVC 3).

Javascript validation
Let us start by creating a validation method for IBAN account numbers in Javascript. We want to extend the jQuery Validation framework that comes with ASP.NET MVC project template. The following code directly adds a new validation method to jQuery Validation. First the code, then the explanation:
$.validator.addMethod("iban", function (value, element) {
    var conversion = {
        "A": 10, "B": 11, "C": 12, "D": 13, "E": 14, "F": 15, "G": 16,
        "H": 17, "I": 18, "J": 19, "K": 20, "L": 21, "M": 22, "N": 23,
        'O': 24, "P": 25, "Q": 26, "R": 27, "S": 28, "T": 29, 'U': 30,
        "V": 31, "W": 32, "X": 33, "Y": 34, "Z": 35
    };
    var numbers = "0123456789";

    var isValidIBAN = false;
    var ibanregex = /^([A-Z]{2}\d{2})\s?([A-Z0-9]{4}\s?)*([A-Z0-9]{1,4})$/;

    if (ibanregex.test(value)) {
        var iban = value.replace(/\s+/g, "").toUpperCase();
        iban = iban.substr(4) + iban.substr(0, 4);
        var convertediban = "";
        for (var i = 0; i < iban.length; ++i) {
            if (numbers.indexOf(iban.charAt(i), 0) == -1) {
                convertediban += conversion[iban.charAt(i)];
            }
            else {
                convertediban += iban.charAt(i);
            }
        }
        var reminder = 0;
        while (convertediban.length > 0) {
            var p = convertediban.length > 7 ? 7 : convertediban.length;
            reminder = parseInt(reminder.toString() + convertediban.substr(0, p), 10) % 97;
            convertediban = convertediban.substr(p);
        }

        if (reminder == 1) {
            isValidIBAN = true;
        }
    }

    return this.optional(element) || isValidIBAN;
}, "Check your IBAN number!");

$.validator.unobtrusive.adapters.addBool("iban");

The addMethod method will add our validation logic to jQuery Validate. This new function will receive the value to be validated. The actual validation logic might not be the nicest Javascript code, but what it does is check the value if it is indeed a IBAN number. I included a regular expression that does the format checking as well, so I do not need to add that separately.

After the jQuery Validate method is added, we also register the iban validation method with the jQuery Unobtrusive Validation framework. The addBool method adds a new validation that returns true/false based on the result.

Ideally you would put this code into your own Javascript file (for example, customvalidation.js). You need to include this AFTER jQuery, jQuery Validation and jQuery Unobtrusive Validation .js files have been included in your code. In a MVC view, you could add it as follows:
@section scripts
{
    @Scripts.Render("~/bundles/jqueryval")
    <script src='@Url.Content("~/Scripts/customvalidation.js")' />
}

And voila, client side IBAN account validation is now available to your HTML code. Add the data-val-iban attribute to the element where you want to test it. The following ASP.NET MVC sample demonstrates how to create a simple form with one field, that has iban validation enabled on the client side:
@using(Html.BeginForm())
{
    <div>
        <input type="text" name="ibanaccount" id="ibanaccount"
            data-val="true" data-val-iban="Check your IBAN number!" 
            data-val-required="Required"  />
        @Html.ValidationMessage("ibanaccount")
    </div>

    <div>
        <input type="submit" value="Submit" />
    </div>
}

I created the input field manually by typing HTML code and adding all the validation attributes. I exploited MVC's ValidationMessage() method to generate the needed span to display a error message in case validation fails.

You can use the following sample IBAN number from Wikipedia to test: GB29 NWBK 6016 1331 9268 19. Or just enter your own IBAN number :) The validation does not even require the spaces, so you can freely omit those if you like.

Our goal is however, that you would not need to write the attributes manually. Instead we want this to integrate with Data Annotations attributes.

Server side validation
In order to create a new server side validation we will derive a class from ValidationAttribute. To tell MVC that we support client side validation the class will also implement IClientValidatable.

The attribute will contain both the server side logic and the code needed to use the Javascript validation we created above.

Let's create the skeleton of the class:
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
    public sealed class IBANAttribute : ValidationAttribute, IClientValidatable
    {
    }

Lets start with the client side validation first. The IClientValidatable interface defines a single member method that returns an enumerable collection of client side rules. We will use yield return to return a single rule:
        public IEnumerable<ModelClientValidationRule> 
                  GetClientValidationRules(ModelMetadata metadata, 
                             ControllerContext context)
        {
            yield return new ModelClientValidationRule()
            {
                ErrorMessage = "Check IBAN account number!",
                ValidationType = "iban"
            };
        }

The rule simply states what error message we would want and what is the validation type. The rule will generate a data-val-iban attribute similar to what we had in our HTML before on the client side.

Finally, lets create the server side validation method.
        public override bool IsValid(object value)
        {
            if (value == null) return true;

            Dictionary<char,int> conversion = new Dictionary<char,int>();
            conversion.Add('A', 10);
            conversion.Add('B', 11);
            conversion.Add('C', 12);
            conversion.Add('D', 13);
            conversion.Add('E', 14);
            conversion.Add('F', 15);
            conversion.Add('G', 16);
            conversion.Add('H', 17);
            conversion.Add('I', 18 );
            conversion.Add('J', 19);
            conversion.Add('K', 20);
            conversion.Add('L', 21);
            conversion.Add('M', 22);
            conversion.Add('N', 23);
            conversion.Add('O', 24);
            conversion.Add('P', 25);
            conversion.Add('Q', 26);
            conversion.Add('R', 27);
            conversion.Add('S', 28 );
            conversion.Add('T', 29);
            conversion.Add('U', 30);
            conversion.Add('V', 31);
            conversion.Add('W', 32);
            conversion.Add('X', 33);
            conversion.Add('Y', 34);
            conversion.Add('Z', 35);

            bool isValidIBAN = false;
            Regex ibanregex = new Regex(@"^([A-Z]{2}\d{2})\s?([A-Z0-9]{4}\s?)*([A-Z0-9]{1,4})$");

            if (ibanregex.IsMatch(value.ToString())) {
                var iban = value.ToString().Replace(" ", "").ToUpper();
                iban = iban.Substring(4) + iban.Substring(0, 4);
                var convertediban = "";
                for (var j = 0; j < iban.Length; ++j) {
                    if ( char.IsDigit ( iban[j] ) == false ) {
                        convertediban += conversion[iban[j]];
                    }
                    else {
                        convertediban += iban[j];
                    }
                }
                var reminder = 0;
                while (convertediban.Length > 0) {
                    var p = convertediban.Length > 7 ? 7 : convertediban.Length;
                    reminder = int.Parse(reminder.ToString() + convertediban.Substring(0, p)) % 97;
                    convertediban = convertediban.Substring(p);
                }

                if (reminder == 1) {
                    isValidIBAN = true;
                }
            }

            return isValidIBAN;
        }

Notice how similar the code is to the Javascript version (thanks to the var keyword, for example). Except maybe the dictionary filling code, which is longer to do in C#. The method check the format using the same regex, and then validates the argument. It returns a boolean value based on the result.

This is all we needed to have both client and server side validation added for IBAN account numbers. Similar methods can be used to add validation to just about any kind of custom validation logic. As a last step, we will test how this works.

Putting our new attribute onto a model
Lets create a new model to test our validation logic.
    public class SimpleTestModel
    {
        [Required]
        [MaxLength(50)]
        public string Name { get; set; }

        [IBAN]
        [Required]
        public string AccountNumber { get; set; }
    }

And create a new action method that will use this model and also accept it back on POST requests.
        [HttpGet]
        public ActionResult TestIban()
        {
            SimpleTestModel model = new SimpleTestModel();
            return View(model);
        }

        [HttpPost]
        public ActionResult TestIban(SimpleTestModel model)
        {
            if (ModelState.IsValid)
            {
                // save
                // ..

                return RedirectToAction("Index");
            }
            else
            {
                return View(model);
            }
        }

And finally add a view. I will only show you the part that renders the account number field. You can easily generate the view based on the model class using MVC's scaffolding feature (use the Create or Edit template).
        <div class="editor-label">
            @Html.LabelFor(model => model.AccountNumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.AccountNumber)
            @Html.ValidationMessageFor(model => model.AccountNumber)
        </div>

As you can see, it does not differ from any other field you would have used previously in MVC. And now when you try this, you will see client side validation working. If you want to test server side validation you need to either disable the client side validation (just remove the interface from the attribute class) or use a tool like Fiddler to manipulate the request before it gets to the server.

Summary
Adding client and server side validation to ASP.NET MVC is an easy task if you follow the steps outlined here. You can add as many different kinds of validations as you need.

Blog engine update, hopefully content follows as well   (Bl0g)   
I updated my blog engine once again, migrating it from MVC 2 to MVC 4. It was a real pain doing the migration, especially since I used ASPX View Engine back in the good old days :) Nevertheless, it was a good opportunity to learn and practice.

I did not change the view engine that was used, but updated other parts. Now using MVC 4, and newer script libraries. I also updated some components, like the source code highliter and of course the theme. The page is now (hopefully) more mobile friendly as well. Tablets, mobile phones should scale as needed.

Hopefully I will have time this year to create some new articles. I have been playing a lot around Javascript, and there are some real headaches that I would want to write about.

Tomorrow I will be talking about Typescript at TechDays 2013 Finland. The talk is in Finnish, but it required some work on my part - again potential blog articles. ;-)

I will also need to respond to some comments, because they seem to be coming still to older articles.

Ludum Dare #25   (CubeHead)   
Long time no posts here. Will have to try and revive this blog. Maybe after I finished my Ludum Dare game :) The game is written in HTML5 and Javascript. As per LD rules, source code will be available after it has been submitted.

You can read more about my entry here:
More info here

Visit the Ludum Dare pages if you are interested in playing or want to grab the source.
Villanus Haerfest

As mentioned above, the game uses HTML5 and Javascript. I recommend Chrome, but IE9+ or FF should work also.

UI Kompositio   (ASP.NET)   
This article is only available in Finnish. It relates to my talk at Tech Days Finland 2012.

8.3.2012 pidetyssä Tech Days 2012 Finland tapahtumassa olin puhumassa UI Kompositio aiheesta, miten rakennetaan käyttöliittymää käyttäen Javascriptiä pienistä paloista. Tästä löydät esityksen PowerPoint sekä PDF muodossa, ja demo sovelluksen.

Kun lataat demo sovelluksen, muista lukea asennus.txt tiedoston mikä kertoo miten tietokannat ja ympäristö rakennetaan.

UI Komposition esitys (.pdf)

UI Komposition esitys (.pptx)

UI Komposition demo (.zip)

Windows 8 Consumer Preview   (Windows)   
The Consumer Preview version of Windows 8 (fancy name for public beta) became available yesterday. I installed it into a virtual machine. This article summarizes my first impressions. I will updating this as I explore more features of Windows 8. My initial very negative opinion on the UI is now not so negative, resulting from the exploration and learning I did. But this also means that there is a learning curve, without it, with just intuition alone, you will not be able to "enjoy" the new UI, in my opinion.

Overall, apart from some usability complaints (which are explored in the rest of this article), I could probably imagine working in Windows 8. The UI still feels strange and a little bit clumsy. Probably this is because I do not think the Metro style UI and applications are in harmony with the desktop paradigm. Anyhow, there are improvements compared to the developer preview, but I still find it is not as smooth of a user experience as Windows 7 is today.

Update: If you are a heavy keyboard user, here is a list of keyboard shortcuts that come in very handy with Windows 8. Very useful! Windows 8 keyboard shortcuts.

If Windows 8 would be released today, I do not think I would want to upgrade. The mix of Metro-style and regular applications is not as smooth as I would want it to be. Frankly, I do not think this new Metro-style thing belongs to the desktop, and I for one do not see as an improvement.


Features of Windows 8

I will not try to introduce the features of Windows 8, because there are tons of articles with pictures. Please refer to Engadget for one such article. And I really like the punch line for that article:

We really liked Windows 7 when it launched. It felt like a big step forward in the short time that had passed since Vista. Now, as we creep closer to a likely release near the end of this year, we can't shake a sense of doubt. Windows 8 still feels like two very different operating systems trying to be one. The potential is hugely alluring -- a single OS to rule both the tablet and the desktop -- and with each subsequent version we keep hoping this will be the one that ties it all together. Sadly, as of the Consumer Preview, we're still seeing a lot of loose threads.

As it stands, Windows 8 is a considerably better tablet operating system than any previous version has managed to be. However, it's still a clumsier desktop OS than Windows 7. That's a problem Microsoft must fix before release.
(from Engadget)


The Metro experience

Anyone reading about or trying out Windows 8 will probably know what Metro-style applications are. They can be started from the new Start screen, they run full screen, and cannot be removed from being full screen (other than using snapping). Running applications full screen seems natural for certain solutions. For web browsers, it is a natural way to operate. For some other applications, it just isn't.

Sidenote: Why kill windows in Windows? If everything is full screen, there are no windows anymore. Hmm? :)


Full screen

For some applications, running them full screen seems outright ridiculous. For example, take the default calendar application on a 24" screen. On a 10" tablet those might look nice, but it just does not work on big screens. Messaging application - I never-ever run chat/messenger in full screen. I like having it floating around above/near other windows. I can do work in my main window and follow the chat at the same time.

I have created some tools and small programs that run as quite small Windows. There would be no sense in making an application full screen, that requires 2 or 3 textboxes for input. I simply cannot imagine how such a tool could be reimagined into being a Metro-style application. Of course if I wanted to create a smartphone or tablet version, sure, no problem. But putting 2 textboxes and a small image on a 24" screen? Or 30" for that matter. I just do not think this is a universally good idea. (I am about to explore Windows 8 application development further, so I might revise this paragraph in the future)

You cannot switch Metro-style apps to run in a Window. Going back to the calendar application: I usually have a webpage, email, chat or something else opened to which the calendar would relate. Having windows side by side makes it much easier than having to alt-tab all the time. I have a high resolution 24" monitor at home, and two large displays side-by-side at work. I have them not because I enjoy looking at full screen things. I have big screen real-estate to actually use it for MULTIPLE WINDOWS at the same time. Forcing new apps (Metro-style) to run full-screen, it is a waste of screen real estate.

Snapping applications partially solves this problem. You can use Windows+. and Windows+Shift+. keys to snap application windows. You can even snap a Metro style app (the calendar) and then the remaining space can be used by the desktop. And mind you, snapping is not something you would figure out for yourself - I certainly didn't :)

Normally I can remove apps from full screen, and very easily put them side by side. Just press "Windows+left" and "Windows+right" and you can arrange your apps very fast in Windows 7. Or use the mouse and drag the title bar to the left side, top side or right side. Very very easy and very very fast. I was actually very impressed, how much thought went into the usability of Windows 7. With Windows 8, I do not find that Metro-style apps improved this in any way, even considering snapping.

I really do not care how much Microsoft tries to justify this new user interface. When Windows 7 came out, you could feel the improvement. With Windows 8, you can feel the setback in user experience.

When you look at the changes from the tablet perspective, it of course makes all sense. I can understand ALL of these choices and behaviors when using a mobile phone or a tablet. There I would even expect everything to work like Metro does. And I don't doubt that Windows 8 tablets will be very nice to use. BUT the desktop is different, and using the same paradigm for the desktop will hinder performance and efficiency.


Messenger

I seem to be signed in to messenger as soon as I sign in to Windows (because I used a Live account to sign in). Where do I began to list all my problems with this solution. From not being in control of when I am online, invisible and offline (signing in to Windows DOES NOT MEAN I am available for chatting) to my chatting account being different from the one I use to sign in (I have 3 live accounts) there are so many things wrong with this solution. I finally found the "Accounts" setting for the Messaging application, but I cannot add more live accounts, nor can I change the one I signed in with.

I installed the currently available version of Live Messenger from the Web, and then I can just use it like I did before. So disable Messaging live tile, install Live Essentials, and good go go :)


Task Manager

You have to love the new Task Manager. It really works well for the power user, shows lots of details and lets you dig deep into how the system is working, what is running. It shows per application network usage, lets you manage the system services. Wonderful improvement.


Application switching

I can now switch to the desktop right from the Start screen. No tricks needed (like last time). By default there is a tile in the start screen that switches to the desktop. You can also switch there if you have multiple monitors by clicking on the secondary display. Because the start screen is only visible on the primary display.

And yes, Alt-Tab now switches between ALL open applications, both Metro-style and traditional applications. Also very good.

And you can move your Start screen and full screen metro apps to another display as well.


Corner menus

When you move your mouse to one of the corners, something will happen. Upper left corner allows you to switch application, and even to list the metro-style apps for easy switching. Lower left corner will allow you to go to the start screen or the regular desktop. Lower and upper right corner will show the charms bar.

They are good until you have multiple monitors connected. When you have multiple monitors, the secondary monitor will be either left or right side of the first. These corner shortcuts will thus fall onto the BORDER between two monitors. So it actually becomes an aiming excercise with your mouse to aim for the primary display's corner that now lies BETWEEN two monitors. Good luck with that! :)


Start menu, Searching

Windows 8 removes the start menu. Thinking about it, I hardly ever went in there. Usually I opened it with the Windows key, and searched for what I want. So it is not a big loss for me.

Windows 8 changes searching in a way, that the default search does not always find what I am looking for. You know the sound dialog, where you can pick your playback and recording devices? I usually typed sound into the Start menu to find it. It was the first or second pick.

If you do this in Windows 8, it will not find it. Because this dialog is categorized as a setting, not as an application. You see, there are three searches now: Applications, Settings and Files. You have to know in advance, what you are searching for, because only those results are displayed. You can change that, but it requires extra clicks or keys. Anyhow, remembering the three quick keys for these makes search usable (Applications: Win+q, Settings: Win+w, Files: Win+f)


Hard to find options

Every wanted to shut down Windows 8 - did you succeed without using Bing or Google to look up how to do it? Intuitiveness is very important in user interfaces. It is something that should be very very important in every user interface. People are lazy reading manuals, and they will get frustrated when something does not work they way they expect it. Shutting down or restarting Windows 8 is one of these things.

Again, my analogy - in Windows 7 many options feel very natural, and you really do not need much learning to use it. You might say I am accustomed to the way Windows works, but I also use Mac OS. I did not have trouble finding things there either, and I certainly did not have to use Google to figure out how to turn off the computer.


Task bar in desktop mode

A small complaint, but the task bar is now visible on both monitors in multi-monitor setup. Hopefully there is an option in there somewhere, that can make it appear only on the primary monitor. Not a big deal though.


Further notes

Just some random observations.

My mice have back and forward buttons (one is a Microsoft mouse, the other is a Razer). They usually work even without any drivers. However, Windows 8 does not respect these buttons, for example, in the Store, when there is clearly a back button on the user interface. Pressing mouse buttons does not move you anywhere.


Summary

Compared to the Developer Preview, there are some advancements in usability. The start menu gone, but you can launch your applications and with time, find your way around Windows again. I just do not understand why Microsoft fails to see how the Metro-style operation is not something that seamlessly works with the desktop.

I will not say that you could not renew the way Windows works. By all means, there are probably always improvements to make. But a mouse and a touchscreen with a finger will require different ways to operate things, and I simply do not believe that you can get away by trying to use the same solution to both scenarios.

Nokia and Windows Phone   (Mobile)   
This article will discuss my opinion on Nokia and Windows Phone. If someone reading it notices that I got my facts wrong, please do correct me :-)

Updates to this article appended to the end.

A Hungarian proverb

There is a Hungarian proverb that translates roughly like so: one of my eyes if crying, the other is laughing. It refers to some kind of thing which is both good and bad for a person. And that is what I feel when I think about Nokia and Windows Phone adoption.

Crying? I am just not reassured, that Windows Phone will be so great for Nokia. This feeling might be caused by my previous clash with the Windows Mobile platform (pre-Windows Phone 7), that you can read about here. This obviously does not apply to Windows Phone 7 (or at least not entirely), but I can't help my bad feelings. There are some features of Symbian (we will get into this later) that are missing from WP7 (and also from iPhone or Android).

I will admit I never used a WP7 phone for more than a short time in a shop or lending it from a friend to try things out. I have also done some research (reading about it, reading phones manuals). My opinion is based on these facts. But I still have that same feeling which I had with Windows Mobile previously: that you are not in control. The phone (or Microsoft) does certain decisions on how you should use your mobile phone, and the restraints just make me more angry :) I know many would recommend Android to me based on these facts. Maybe. :) (I will also admit at this point, that some features I critisize here might already be available on Android, or might be available via separate apps, etc. My Android information is dated :))

Laughing? So why would I be happy about this move of Nokia? I have been developing in .NET since 2004, both professionally and for a hobby. I really really like the platform, and Microsoft's strategy to have the same programming APIs across a wide range of devices is just really tempting. I do not need new tools or new skills for that matter (as I have programmed Silverlight for example), I can just hop in and start coding Windows Phone 7 (I have written some apps in the emulator already). And I can soon run it on a Nokia, which sounds pretty interesting.


Profiles and groups - are features dying?

Wow, Windows Phone 7.5 Mango now supports grouping your users. That is awesome. Nokia phones did it 10 years ago, and in my opinion better too. In Mango groups serve only to be able to view a group of users together (their socials updates, etc) and to communicate with them. Granted, groups might not be integrated into the social aspects of newer Nokia phones, but what about basic "PHONE" settings? Like setting a ringtone for a group? Like selecting which groups will alert you (ring) in a given profile?

... Oh wait ...

Windows Phone does not have profiles? Well it sure seems so. Set a ringtone. Check. You can have it on silent. Check. You can have it on vibrate. Check. You can't use vibrate and silent at the same time. What?

If I want to have silent available, I have to TURN OFF Vibrate in settings? To have vibrate on again, need to set settings again. Otherwise, the volume down button will put you into either SILENT or VIBRATE. Frankly, that seems just stupid. And I wonder if anyone who wrote this part of Windows Phone has ever seen how Nokia does profiles? (yes, I doubt the person has seen that feature in action).

My only hope is, that Nokia will port these missing features from Symbian into their Windows Phone offering. That would give them a huge edge over other Windows Phone manufacturers too - at least for some time, as they have to contribute those changes back into WP7. But that would just make WP7 better. However, I am afraid this porting over features will not happen - but who knows?

And do not even get me started on things like "who needs profiles?" and "people do not use their phones to make phone calls anymore", because those things are just stupid.

To sum up this section, I think that Symbian offered a lot of control over your settings and a lot of settings to choose from and customize, how your phone works. Loosing these things in the transition to Windows Phone would be unacceptable to me, but we will have to see what the good guys in Nokia think about this. Granted, the settings were not logically organized and often hard to find, but they were still there. I dislike the "we know better than the user" design philosophy, which is visible in both Windows and Windows Phone.

If features from Symbian end up missing from the WP7 Nokias, that is just a downgrade, plain and simple.


Why Software Sucks?

But why does Nokias software suck?

As a side note, there is an excellent book called Why Software Sucks? I do recommend anyone involved in software development to read it :)

But back to Nokia. Why doesn't Symbian work so well? I would think this is because the systems core is ancient (at least by computing standards) and building on a not so solid foundation is just not that easy. But Nokia has some capable people, and you can see the results by looking at the N9 and MeeGo. You have to wonder where Nokia kept that software talent all these years, because that thing really works well. Also note, that my criticism is only for the software side of Nokia phones. Their hardware is really something to admire, especially recently. I just wished their software would been on par with the hardware they make.

Nokia handled some things concerning their software badly. The software development speed, update cycles and software philosophy left a lot to be desired. I have seen it many times, that old phones just do not get all the nice updates new phones have gotten. This is now changing. In the Elop world, Symbian^3 devices get all the updates that newer phones come out with. Sweet. I hated that you need a new phone every 6 months to get the new features. It seems now all manufacturers are updating - more or less - old models with new software. It might seem like loosing money, but it is building up customer satisfaction. Besides, people often get locked into contracts, and cannot upgrade their phone so often. By releasing new software for new phones only, you just make those people angry.

The software updates with Nokia are coming SO SLOOOOW. There are bugs to fix, applications to update, and the updates are just coming very slow. When Symbian Anna finally arrived in the summer, it arrived one operator, one phonemodel at a time, and many months later than promised. I have been reading Nokia forums and found out, that they need to test every variant of the software. Presumably by hand. And there are variants for different color versions of the phone. Yes. You read that correct.

I see Nokia wasting money here. Money and time. And by that, customer satisfaction.

Building packages for all phone models, variants and operators SHOULD BE automatic. These variants then SHOULD BE tested automatically. I would have expected that a company like Nokia can press a button at night, and in the morning see if everything went ok, without a single person being involved in the software testing process. All packages should be built and packaged automatically and then tested, also automatically. Judging from the speed they do things, it is just not how things progress. (The reality of testing mobile phone software might be more complex than what I described above, but still it should be more easier than it seems to be now.)

Because the update process is such a big pain, of course they will not want to do it too often, so what we get is updates coming really slowly.


A new software platform again?

It was in the news that Nokia is making a cheap, simple, Linux based platform that it wants to put on the cheaper phones. And you know, this has me wondering. Why oh why do we need ANOTHER PLATFORM? You already have MeeGo, don't you? Instead of thinking about adopting that for cheaper phones, you go ahead and start developing something new again? Excuse my language, but that does seem like bloody stupid to me.

The whole technology industry is about product lines.

Take hardware. Intel processors. If in the production some processors do not qualify high enough, they have some features disabled and labeled cheaper/lower end models. Intel is even selling processors where you can unlock faster speeds AFTER you bought it by paying for an unlock code. I do think that practice is disgusting, but it does point out one key thing. They do not design and manufacture as many processor types are they sell. They simply lock out features of high end models to make them low end. Same goes for graphics cores.

Take software. You create a nice little program with a lot of feautes. Name it the Enterprise version. You lock some features down, that is your Professional version. You take away more features, Home version. And heck, make even a free Express version too. You can see it all over the place. Microsoft does it with Windows, and most independent software vendors do it too. It is much easier to lock certain things down than to create entire new versions. No one really thinks Windows Home Premium is a complete rewrite of Windows Ultimate, with certain things left out?

Why does not a company like Nokia go this way? Why make something new, when looking at the N9, you already have a very mature and good operating system. Use that. Lock things down, but use that.

The same argument goes for the now dying S40 platform. I never quite understood why you need a different platform.

There might be certain hardware restrictions to work with - like cheaper models not getting so strong hardware - but I will argue that having a single codebase is still cheaper than multiple code bases. Cheaper to make, cheaper to maintain and test.


A mistake?

I will go as far as to saying Nokia's decision to adopt Windows Phone seems like a mistake to me. Looking what Nokia has available today, it is very clear that these things have been in the making when they decided to go the Windows Phone 7 way. These offerings available now seem to me that these might have been the solution to their problem, and not adopting Windows Phone 7. Frankly, it makes you wonder about all the theories concerning why Elop chose his former employer's mobile platform.

I will explain.

Nokia now has MeeGo ready. N9 has appeared in stores. If there would be no Windows Phone 7 in the making, MeeGo devices could now appear one after the other. Read the reviews of the N9 over the internet. Praises. The user interface is compared to the iPhone, the user experience is said to be great. And some people are sad because it is not available in their country. The reaction would have been the same without Windows Phone 7. In fact, it would be even much much better, because everyone could look forward to improvements to the MeeGo platform and new devices. Not today.

On the development side, S^3 and MeeGo can be both targeted using the same development tools (Nokia Qt). So developers really do not need a lot of effort to transition. The development tools BTW also came a HUUUGE way forward, they are easy to install, maintain and use. Ovi Store is available today with lots of apps.

So right there, you already have a complete mobile platform and ecosystem available. But Nokia had to destroy it all. I do not believe for a second that four mobile ecosystems would have been too much.

Of course MeeGo cannot work in its current form, because both platforms (S^3 and MeeGo) are essentially dead ends. Current developers will work with them, but I really doubt anyone new will invest lots of time and money in training new developers for these platforms.

So, instead of the already ready and fine working MeeGo, we get Windows Phone 7 Nokia phones, that will maybe work OK, but will certainly need time to fine tune and get used to. I cannot even imagine when Nokia will be able to make a phone like the N8, with all those multimedia features: photo picture quality, video editing features, etc. As far as I know, WP7 does not have video editing?

Frankly I did not see the driving reason behind WP7 adoption back in the beginning of the year, and I see it even less now. I think Nokia threw away a tremendous opportunity by choosing Windows Phone 7, and I really doubt they can climb up to top spot again. Very sad actually.

I can really understand the comments by former Nokia chief Anssi Vanjoki who also said Windows Phone 7 was not needed by Nokia. If you understand Finnish, read his comments here.

Update 22.10.2011: Engadget just reviewed the N9, coming to similar conclusions: it is just a shame Nokia killed of MeeGo.