Behavior-Driven Development with NBehave
Published on December 11th, 2009.
What it Behavior-Driven Development (BDD)?
This new development technique is an evolution of the well-known Test-Driven Development. It encapsulates the idea of the Domain Driven Design to use a Ubiquitous language which should break the boundary between Business and Technology. That way, BDD makes sure that the business, developers, testers, analysts and managers use the same words with equal meaning
The BDD process looks like this:
A business user works with a business analyst to identify a business requirement. This is expressed as a story using the following template:
- As a Role
- I request a Feature
- To gain a Benefit
The speaker, who holds the Role, is the person who will gain the Benefit from the requested Feature. Dan North has written a great article about stories. I advice you to read it if you feel that it’s not clear enough. (more…)
Filled under Development Techniques. No Comments.
Untie the Connection String from DataContext (LINQ to SQL)
Published on November 27th, 2009.
When you work with LINQ to SQL you probably want your DataContext (and all the entities) to be in its own assembly. It’s a normal decision when developing n-tier applications.
The Problem
When you create your LINQ to SQL classes file (dbml) you have two options for your database connection string:
- In Settings.settngs file of the corresponding assembly
- Hard-coded in your DataContext desginer (.designer.cs file)
Well, when you have a web application or WinForms/WPF application you definitely would like to manage your connection string from the general config file (web.config or app.config). In this situation it would be a little pain. (more…)
Filled under .NET, ADO.NET, C#, SQL. No Comments.
Mapping a Stored Procedure to an Entity with Entity Framework
Published on November 23rd, 2009.
ADO.NET Entity Framework initially generates a 1:1 (one to one) mapping between the database schema and the conceptual schema in most of the cases. In the relational schema, the elements are composed of the tables, with the primary and foreign keys gluing the related tables together. In contrast, the Entity Types define the conceptual schema of the data. One is sure – ADO.NET Entity Framework makes it easy when it comes to work with a database. But is it sure?
Suppose you have created your entities using the Visual Studio 2008 wizard.

Filled under .NET, ADO.NET, C#, SQL. No Comments.
.NET Memory Management
Published on November 11th, 2009.
When you write managed code you propably think “Hey, .NET manages the memory, so I don’t care about it”. But you are not right. When you write code, no matter what the programming language is, you should always think about memory, especially when it comes to performance optimization. Although .NET provides a managed environment, memory leaks can still occur if you are not cautious.
Here is a great video explaining .NET memory management in details.
- Why memory matters
- .NET Memory and Garbage Collection
- Generational Garbage Collection
- Temporary Objects
- Large Object Heap and Fragmentation
- Finalization
- Memory Problems
- Summary
Filled under .NET, C#. No Comments.
Microsoft SDK for Facebook Platform
Published on November 10th, 2009.
Microsoft has just released a new SDK, which aims to empower the social networking development. This SDK combines the power of Web, client and social technologies to enable developers to spread their creativity. No matter what your application flavor is, the Microsoft SDK for Facebook Platform supports the development of applications across Silverlight, WPF, ASP.NET, ASP.NET MVC, and Windows Forms, enabling easy consumption of Facebook services delivered through the Facebook Open Stream API.
To get started you have to download the SDK and refer to the “How to” guides and the Facebook Developer Wiki to get familiar with these new resources.
- Download the SDK.
- Refer to the detailed instructions on the Facebook Developer Wiki. Here are some important links to use as a starting point.
Read more at the official site of the SDK.
Filled under Social Networking. No Comments.