Thursday, February 23, 2012

Principles for writing testable code

In order to write code that are easy to test then there are a few principles that must be followed:

  • Dependencies must be injected, use property- or constructor injection or an injected service locator.
  • Avoid static variables.
  • Avoid calling static methods unless they are only doing in-memory operations.
  • Mark public methods as virtual or use interfaces.
  • Classes and methods should be small. Preferably not longer than one screen size. Use the single responsibility principle to achieve this - a class should only be responsible for doing one thing = one public method (except from method overloads and facade classes).

Sunday, February 19, 2012

FluentData version 1.1 is out with support for MySQL

FluentData version 1.1 is out on CodePlex with support for MySQL. MS SQL Server, MS SQL Server Compact 4.0, MS SQL Azure and Oracle is already supported. Download it from here.

Wednesday, February 15, 2012

FluentData version 1.0 is out on CodePlex!

FluentData is a new open source Micro ORM framework that makes it easier than ever to query a database.

The existing ORMs frameworks on the market such as Entity Framework and NHibernate are overly complex and difficult to learn. The generated SQL from those frameworks are poor due their own abstracted query language and mapping from the database to .NET objects is difficult.

FluentData takes a different approach by being a lightweight framework with a simple fluent API that is easy to learn. Mapping between the database and .NET objects are simple and by using SQL which is the best database query language around you get fast and efficient queries.

Read more, see some code samples and download FluentData from