Koen about .Net

September 5, 2011

Experiences building a Task based Silverlight application

Filed under: Development — Tags: , , — koenwillemse @ 21:30

I’ve been very interested in stuff like CQRS and Task Based user interfaces lately, but unfortunately I can’t work with it on the current assignment. So I decided to create a private project in which I can try out all the related technology, techniques and best practices I can find. So this is the list of tools and techniques I’m going to use:

Techniques / methodologies

  • CQRS
    I do like the idea of Command Query Responsibility Segregation which I first read about in posts by Greg Young on codebetter. If you want more info about that, read the posts by Greg Young or Udi Dahan also has some interesting blog posts about it. Other great sources of information are cqrsinfo.com and the DDD/CQRS google group.
  • Task based UI
    The idea behind a task based user interface is of course the focus on the user and making the user interface in such a way that it makes working with it easy from the perspective of an user. It also works great together with CQRS and is almost a prerequisite to doing DDD al the way.
  • DDD
    Domain Driven Design is a fundamental part when designing an LOB application I think. A great source of information is Applying-Domain-Driven Design and Patterns by Jimmy Nilsson.
  • TDD
    Test driven development… What more is there to say about that. If you don’t know what it means. Go read about it!!!
  • ATDD
    This one is not that well known as TDD, but it stands for Acceptance Test Driven Development. Unfortunately I haven’t had the change to work on a project at a customer where it’s used, but I’ve been trying it out in an MVC project I’ve been doing and I’m convinced that it definitely helps creating better software and preventing regression problems.


  • NuGet
    NuGet just makes your life a lot easier regarding installing packages en it’s dependencies.
  • Caliburn.Micro
    I’ve been experimenting with Prism in the past and it was pretty big to get started with. A colleague of mine talked about Caliburn.Micro several times and I wanted to give it a spin to see if it is easier.
  • AutoFac
    I need an IoC container in the Silverlight client and I now of two that I’ve heard of and that is Unity and Autofac. Some recent blog posts I’ve read about their performance made me decide to ditch Unity and give AutoFac a spin.
  • StructureMap
    I’ve worked with StructureMap in the previous project and I really liked it. Next to that it looks pretty good in performance comparisons so I wanted to use it as the IoC container in my web application project hosting the services.
  • Silverlight
    In my opinion Silverlight is a very logical choice when implementing a LOB application which should be available using the web. Especially when there is no need to target a very wide range of users, with all kind of operating systems and browsers. Otherwise I would probably have chosen for ASP.NET MVC with jQuery, but Silverlight is the best match for the application I’ll be building.
  • WCF
    I will be using web services build using WCF for the communication of the Silverlight client with the web server to get the data from the SQL Server Express database. I will be looking at both plain WCF services and WCF data services.
  • SpecFlow
    I’ve been trying out Specflow as the way to write my ATDD tests using Gherkin syntax. It integrates nicely with Visual Studio so I will be using that again.

When looking at the architecture of the application, it will have a lot of similarities with the Silverlight Cookbook application on codeplex which my colleague Dennis Doomen created.

I will update this post with links to other blog posts when I have some experiences worth sharing with any of these points.

Follow up posts:

  1. Testing and deployment

February 22, 2010

Reply to ‘The State of Data Access in Silverlight’

Filed under: Development — Tags: , — koenwillemse @ 11:28

Shawn Wildermuth wrote an interesting post about the state of Data Access in Silverlight. As I’m currently working on a Silverlight application which can serve as a reference architecture for applications using RIA Services, I think I can say something about that.

The ‘Add Service Reference’ kind of functionality which he points out could be very interesting, especially when working on large projects. The more projects there are in your solution, the longer it takes to compile, so this could potentianally improve the speed of development. I think it might be interesting in scenario’s where you have a simple model which doesn’t expose much functionality or information, other than what that client needs, but when working on a bit more complex applications, I wouldn’t want to expose my domain model outside the services.

The points he makes about Validation attributes, eager loading and navigation are not really points that are interesting for me (now). Reason is that I don’t want to expose my domain model using RIA services. As I look at it now, it exposes a lot more information than needed. So I use Dto objects to transfer information to the client with the simple validations which can be done using the attributes.

The point he makes about the loosely coupled application when developing with RIA services is true. There are some difficulties to overcome when working with it. It is especially difficult when you want to do development in a TDD way. For instance, to work with a MVVM pattern and RIA services for instance, in a TDD fashion, you will need to create an interface for the generated context so you can intercept calls to the framework. I will write about this in a future post.

So, wrapping it up, adding a ‘Add Service Reference’ kind of solution would be very interesting. Next to that, it would be a good thing if the generated code would be more TDD and mocking friendly. Right now it’s very difficult, because a lot of classes are sealed, or only have internal constructors (like the LoadOperation for instance). This results in the need to define some other ways to work around this.

EDIT: Right after writing this post, I found this blog post from Brad Adams about splitting the project in different solutions. Seems a reasonable work around.

February 17, 2010

Silverlight Reference Architecture

Filed under: Development — Tags: , — koenwillemse @ 20:53

I’ve been working on a Silverlight application which uses RIA services. Most of the blog posts I see out on the web are using DataSources directly etc. This is not a solution which is enterprise ready, testable, maintainable etc…. Off course it’s obvious that when people are demonstrating new technologies, they won’t do this in a very complex scenario, but I’m a bit disappointed that there aren’t much posts about using RIA Services in combination with MVVM, TDD etc…

So I decided to do the development with a solid architecture in mind and start blogging about it. But I noticed that my colleague Dennis Doomen was working on the same thing, which he will use on the session he is going to host, and published a nice picture about how he envisions his default Silverlight architecture. The good thing about this is that I had almost the same thing in mind, so we’re pretty much on the same track here. The thing that’s maybe is a bit doubtfull is that he is sitting about 5 meters away from me at the customer where we are working now ;-).The picture as he drew it can be found here.

So as I’m working on this architecture of mine, I’ll try to blog occasionally about it, when I’ve made progress or added some important / infrastructure functionality.
Hope that it helps some of you guys. If it’s helpfull, pelase let it know.

September 7, 2009

Silverlight – Invalid or malformed application

Filed under: Development — Tags: — koenwillemse @ 23:57

Well, i was working on a silverlight project and was refactoring some namespace names.
Next, started a debug run and got a javascript error: “Message: Invalid or malformed application: Check manifest”. What???

Now what was the problem… a very small thing. The startup object of the silverlight project was referencing the old object. The refactored namespace wasn’t refactored here. Took me some time to find it, but was easy to fix. Open the project properties -> Silverlight tab. Check the value of ‘Startup project’. Change this to the correct value and check again.

July 14, 2009

Silverlight 3 is available – look at the text rendering!

Filed under: Development — Tags: — koenwillemse @ 00:49

I started playing around a it with Silverlight 3 today. One of the thing I was very happy see was the improved text rendering. I started a small project a few weeks ago to build the application we created for my current customer (in ASP.NET with AJAX) in Silverlight. I stopped with it when I saw some text redering which really didn’t look good (simply because I didn’t want to show them that).

Today I installed SL3 on my laptop and looked at it again (without doing anything else) and it looked normal now :-). When I’ve got some time left again I will try to do some more work on it, to show them how it could look in silverlight, cause I hope to impress them now. I was very excited about the improved rendering so I just had to write a small blog post on it.

Download SL3 now and start playing with it: www.silverlight.net and www.seethelight.com

Create a free website or blog at WordPress.com.

%d bloggers like this: