Tag | BlogFeedList.aspx Posts

If you build Silverlight Applications, chances are you have seen this screen before. I’m talking about the default “To view this content, please install…” Screen shown below. The Default Installation Screen. This is the screen that your users see when they first visit your site without Silverlight installed. It’s just plain ugly and most users do not know what it means. Take this example below by Netflix, they have alerted the user with a friendly: “You’re almost ready to watch…” Install Now. This ...
Today at PDC 2010, they announced Asynchronous functions in C# and VB.NET. So what exactly does that mean? I’ll give you the definition first: Asynchronous operations are methods and other function members that may have most of their execution take place after they return. In .NET the recommended pattern for asynchronous operations is for them to return a task which represents the ongoing operation and allows waiting for its eventual outcome. You completely understand right? Me neither! I have been ...
I love Silverlight and have written / talked about it a lot. I can’t help but notice that a lot of people are new to Silverlight or may have played with it a few times. Well this post is for you. It is a list of 15 things that I’ve discovered since I started developing for Silverlight. If you are a full-time Silverlight developer than I would hope you know most of these. I promise not to scare off anyone with talks of MVVM, Prism or MEF. 1) The line highlighted below represents the MIME type and ...
I’ve blogged about the tools and have played with the hardware, now its time to put an application on the actual Windows Phone 7 hardware. I will guide you through the entire process step-by-step. Please note that I have an early version of the phone and had to get a Connect Login to download Zune 4.7. If you are reading this after the phone has launched then you can probably just go to the Zune web page and download it directly. You will also want to skip down until the next section that starts ...
One of the major peeves that Silverlight developers had in its earlier versions was the lack of printing support. Printing is an essential feature of many applications and more so in the case of LOB applications. Hence, when Silverlight 4 was released with a full featured Printing API, developers welcomed it with open arms. What’s included in the printing API: The System.Windows.Printing namespace This namespace provides printing services for a Silverlight application through its various classes. ...
These days, JetBrains (the manufacturer of ReSharper (R#)) released the beta version of a new code coverage tool – dotCover. Because I’m a big fan of the R# add-in, I was particularly curious about having a first look at the newest JetBrains child. Notably, I wanted to see how it would take advantage of its deep R#/VS integration to make code coverage an integral part of a developer’s working experience. Here are my first impressions about it… Note: Because I’m using NCover for Code coverage analysis ...
Update 29/04/10: In contrary to what I initially stated in this post, Moles is not only available as part of the Pex framework, but also stand-alone on Visual Studio Gallery, and this is completely free (no MSDN subscription required). - Thanks to Peli for the correction... Usual opensource mocking frameworks (like e.g. Moq or Rhino.Mocks) can mock only interfaces and virtual methods. In contrary to that, Microsoft’s Moles framework can ‘mock’ virtually anything, in that it uses runtime instrumentation ...
Lately, I exchanged some arguments with Derick Bailey about some details of the red-green-refactor cycle of the Test-driven development process. In short, the issue revolved around the fact that it’s not enough to have a test red or green, but it’s also important to have it red or green for the right reasons. While for me, it’s sufficient to initially have a NotImplementedException in place, Derick argues that this is not totally correct (see these two posts: Red/Green/Refactor, For The Right Reasons ...
One of my major points of interest as a software developer is in the various tools that are available to make a developer’s life easier (or at least more interesting…). This is also a very important aspect for me in professional terms, because one part of my job lies in recommending suitable tools to my customers, implementing them and make them part of a developer team’s workflow. Thus, a well organized link collection is an important part of my assets and has a considerable business value for me ...
These days, I’m doing a bit of end-to-end acceptance web testing using the Selenium framework. Selenium has a nice and handy add-on for the Firefox browser – the Selenium IDE. It automatically records your actions and produces the required C# code for you, as you click around in the browser window. But when I started the Selenium server and tried to run my first test (copied from the Selenium docs), it didn’t work (Sigh. It never works on the first try…) and I got a timeout and an exception. This ...
Most people - even the overwhelming majority of programmers - would say that the main activity of a software developer is "writing source code". But this is a (though quite understandable) misconception - and if you take a look at the available figures on the issue or if you - as a software professional - are honest to yourself, the misconception immediately turns out to be an enormous one. The world is full of software systems that are already in operation, and they have to be maintained - writing ...
While many of the single components of an ASP.NET MVC application are easy to test (-drive) in an isolated manner (e.g. controllers), this can be hard for some others (like e.g. model binders) - and sometimes it just doesn't make much sense to test a single piece of code in isolation (e.g. for security-related issues). In such a case, some sort of integration testing has to be done, which in the context of ASP.NET MVC typically implies the usage of a browser automation framework like e.g. Selenium ...
From the many available IoC containers out there, LinFu is the one that I like most. This is because it is extremely simple to use, needs almost no configuration at all, and yet it is highly flexible and extensible, if you need to do some more complicated things (you can read two good introductory articles about LinFu IoC here and here). During the last weeks, I was doing some stuff with the ASP.NET MVC framework, and I wondered how easy or complicated it would be to use the application's IoC container ...
Lets quickly have a look at how you can limit the entry to textbox and display the character input left to be keyed in. First things first, the script. <script type="text/javascript"> $(function() { var limit = 250; $('#dvLimit').text('250 characters left'); $('textarea[id$=txtDemoLimi... { var len = $(this).val().length; if (len > limit) { this.value = this.value.substring(0, limit); } $("#dvLimit").text(limit - len + " characters left"); }); }); </script> The $() ...
One of the single most influential cost factors for software projects is code readability and understandability - and the most important factor for readability in turn lies in the adherence to Coding Style Guidelines. To enforce such guidelines, Microsoft has provided a free tool which checks a given set of source code files against a given set of style and consistency rules: MS StyleCop. The tool comes with quite a lot of predefined rules - however, they mirror the coding practice at MS and not ...
Welcome to eBoard Hello and welcome to this series of application development using asp.net mvc, jquery, automapper, ninject. Though the world doesn't need another blog engine, but sometimes reinventing the wheel teaches you many unknown things and it's the learning experinece that counts more than anything else. I have been using asp.net mvc + jquery for about a year now. So, it's time to put down something which will help the beginner with this technologies get a good graps of the fundamentals ...
This post is a follow-up on my series about validating business objects throughout different layers of a software system - domain, persistence, and (ASP.NET MVC) GUI. It demonstrates how a self-written validation can be incorporated into a web page (using a bit of JavaScript) and how this can be mapped to a custom validation on the domain side. A short recap In the first part of the above mentioned series, we developed a simple, custom validation aspect that checks if a value really is a member of ...
This series of posts discusses the use of an Aspect-oriented programming approach for implementing the validation part of a business domain, using the ValidationAspects aspect library, that sits on top of the PostSharp aspect weaver and allows for placing Design by Contract - style attributes on properties and method arguments, as well as for easy runtime validation of an object's state. This is the third post of a three-part series that discusses the use of these validation aspects throughout the ...
This series of posts discusses the use of an Aspect-oriented programming approach for implementing the validation part of a business domain, using the ValidationAspects aspect library, that sits on top of the PostSharp aspect weaver and allows for placing Design by Contract - style attributes on properties and method arguments, as well as for easy runtime validation of an object's state. This is the second post of a three-part series that discusses the use of these validation aspects throughout the ...
Validation is one of the most important objectives when crafting a domain. You have to shelter your domain objects from undesirable property and method argument values as well as being able to explicitly validate an object's state in certain situations, for example to enforce business rules. My preferred way to do this is with the ValidationAspects aspect library, that sits on top of the PostSharp aspect weaver and allows for placing Design by Contract - style attributes on properties and method ...
When doing software development the lean/agile way, you don't have much requirement documents produced upfront - and right so, because they tend to become outdated and useless within a couple of days, after the 'real' development phase of a project has started. However, a developer might occasionally write down some informal specs on the fly while he's coding. Personally, I often do this, when I'm implementing a feature that spans more than some minutes of programming time and is somewhat more complex. ...
From time to time (and when there's room for it, of course), I'm doing a so-called Code Kata, a small to mid-size programming exercise that usually originates from some seminar or meeting. (Kata collections can be found here or here, for example.) What I especially like about them is the level of professional self-knowledge that they provide: When working on a Kata, you can experience how you deal with things without the usual business pressure. Lately, I did the KataPotter (you can download my solution ...
I am practicing Test Driven Development (TDD) now for some two years or so, and soon this technique of writing software felt so natural, that I hardly could imagine doing it another way or even imagine a reason why I should do so. But on the other hand, I know that not questioning something anymore and not being self-critical from time to time is a certain recipe for running into a disaster sooner or later. So I asked myself: What makes TDD such a natural way of writing software? and What are your ...
I love Test Driven Development. I use this development approach wherever I can. It makes my code a lot better and gives me the confidence that I indeed have crafted a good and reliable piece of code. However, some things are quite hard to test-drive, simply because they have so many dependencies that you would need to make extensive use of a mocking framework (and probably inspecting some things via Reflector...). In such a case, you usually decide to not have unit tests, because the time and amount ...
As a freelancer who is constantly selling his skills on the free market, I always have to be up to date and keep myself informed about the latest technologies - in a more cursory way to know what options are available in a certain situation, or more in-depth if I am actually working with a specific technology. Although you can go overboard with trying to stay on top of the IT industries' evolution (I talked about that in a previous post), I simply consider continuous learning to be a natural part ...
This series of posts is about overcoming a restriction, that O/R mappers like NHibernate have with respect to lazy loading and polymorphic type information. (Please refer to the problem description and example in part 1 and 1.5.) The previous part of this series demonstrated how we can fetch type-discriminating data from the db during the regular insert/update/retrieve lifecycle of an instance, along with its 'normal' data, and totally transparent from the domain perspective. This part now will show ...
Lately, there was a blog post by Joel Spolsky called "The Duct Tape Programmer", which is very opinionated and caused quite a lot of responses and discussions in the blogosphere. Basically, this post contrasted the duct tape worldview of developing software to the astronaut architect's, forcing programmers to decide between quick-and-dirty solutions on the one side and analysis paralysis on the other. The replies that I like most, are by (Uncle) Bob Martin, Ayende and Jeffrey Palermo. I think they ...
Usually, I'm not what you would call an early bird. That's why I have read about the new dynamic keyword in C# 4.0 only now. To say it clear: I was horrified. My first intuition was to write an FxCop rule to blame all its usages in the analyzed code. Instead, I wrote this post, which is basically a rant against dynamic - simply because writing a post is much quicker and I felt the urgent need to express my opinion on this, but I'm still thinking about the FxCop thing... The basic fact is in short, ...
In previous parts (see here and here, I will refer to the examples therein throughout the following), I described a problem with O/R-mappers like NHibernate that could possibly break domain code which is relying on type information in some way or the other (this is not only relevant for casting issues!). The problem occurs when NH creates a lazy loading proxy for a polymorphic object, not knowing the exact type of the proxy at creation time. - Sure, you can easily circumvent the described issue if ...
Yesterday I noticed that a new version of Gallio, my favorite Test and Automation platform, was released a few days ago. Although the official version number suggests only a small progression (we are coming from v.3.0.6 SR2 and now have v3.1), it is a major upgrade that brings not only some minor improvements, but a wealth of new features. Among the highlights are: VS 2010 Beta 1 and .NET 4.0 support full RSpec integration (used for Behavior Driven Development) a new plug-in model makes it very easy ...
Lately I played around a bit with Aspect Oriented Programming, especially with PostSharp. I wanted to see how I could use it to reduce the amount of infrastructural code that clutters a common class like this: public class Person : INotifyPropertyChanged { private string firstName; private string lastName; private int age; public string LastName { get { return this.lastName; } set { // check the argument value if (value == null) { throw new ArgumentNullException("valu... } if (value == "") { throw ...
Let's face it: Setting up NHibernate is not one of the easiest tasks. You need a good knowledge of the system, and you need to write some configuration xml to your config files (well, normally). This is not such a big deal for the main project, since you only have to do it once in a project's lifetime. But you also have to care about setting it up for each and every test project that uses NHibernate, and there might be a lot of them if you're consequently unit testing just about everything. So, wouldn't ...
A few days ago, I talked about a problem, that using an ORM like NHibernate could bring, when there's inheritance and lazy loading around (please refer to this post). Unfortunately, the example in this post turned out to be somewhat unclear. So here's a short follow-up with another example, that hopefully underpins my arguments a bit more precisely. The original example gave the impression that the problem occurs only when we would try to typecast around in some way or the other, which is in most ...
Almost every software project comes with a database. Sometimes it will be developed from scratch and in parallel with the actual domain model for a new (aka. 'greenfield') project, sometimes it will be a pre-existent datastore provided by the customer or coming from an already running software that has to be extended (then we can call it a 'brownfield' project). In either case, you will likely end up with a bunch of database scripts that need to be executed as part of your installation process. I ...
EDIT: It turned out that the original example herein is not very clear about the point I want to make. Therefore I posted a follow-up with a better and more precise example (see here). Recently, I came about this blog post, which describes an interesting problem about NHibernate, lazy loading, and polymorphism. My initial thoughts were that this would be another one of these fancy technical details that a developer has to deal with all the time. But after a while it grew bigger and bigger in my mind ...
NHibernate's EnumStringType is a custom user type to realize an arbitrary mapping between an enum in your domain code and a related set of strings in your database. While playing around with it, I stumbled over some strange behaviour that turned out to be a bug in NH's codebase. It took me two days to finally nail down the problem. This post is mainly intended to be a short recap of my findings. Hopefully I can prevent some other poor developer souls to get stuck with the same problem, providing ...
In some scenarios, you may have a database that contains text data in a column which is restricted to a certain set of discrete values. In such a case it is a good idea to use an enumeration for representing these data in your domain. - I occasionally came across this situation when I had to deal with legacy databases with large amounts of pre-existing data. - This post demonstrates an easy and effective way to put this "enum value vs. database string" mapping under test, using the xUnit.net unit ...
During the last days and weeks, there's an increasingly heated debate about the performance of NHibernate vs. some other commercial and noncommercial ORMs. This debate was triggered by the launch of a new website called ORMBattle.NET, which is allegedly "devoted to direct ORM comparison" (and hosted by a commercial competitor of NH...). The comparisons are largely based on batch processing tests like this one: protected override void InsertTest(int count) { using (var transaction = session.BeginTransaction()) ...
In large projects you may have have a big number of enumerations in your domain code that have all to be kept in sync with some corresponding database stuff. Ensuring this correspondence is boring, repetitive and error-prone. Because it is such a tedious task, chances are that you don't check this at all, opening the door for serious runtime failures - especially when the project is nearing the deadline and things generally tend to become a bit more chaotic. I love enums. I use them wherever possible. ...
If you are the minority who have been following my blog from the beginning you would know I am an avid practitioner and developer that centre on Microsoft SharePoint, and associated technologies. So some people may be thinking why write about Commerce Server? Is there any association between this and Microsoft Office SharePoint server (MOSS)? Well the answer is yes and no. In my earlier blog I briefly introduced Commerce Server, and this is hopefully the start of my series of articles introducing ...