LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

VB.Net: Setter injection with StructureMap and the FI

I’m using the SVN version for this. Lets give an example of how to do this. First we create a few interfaces. vbnet Public Interface IPerson Function Name() As String End Interface vbnet Public Interface ITest Function Name() As String Property Person() As IPerson End Interface as we can see ITest has a property Person of type IPerson. Ideally we would like to inject the IPerson. Then we have the concrete classes.

Read More...

VB.Net: A better configuration for structureMap

There used to be time when you would configure StructureMap this way vbnet StructureMap.StructureMapConfiguration.ForRequestedType(Of ITest).TheDefault.Is.OfConcreteType(Of Test)() and then this to get your implementation vbnet ObjectFactory.GetInstance(Of ITest)() Fine that all worked nice and dandy but it had a drawback. Structuremapconfiguration was static/shared. This meant that this. vbnet StructureMap.StructureMapConfiguration.ForRequestedType(Of ITest).TheDefault.Is.OfConcreteType(Of Test)() ObjectFactory.GetInstance(Of ITest) StructureMap.StructureMapConfiguration.ForRequestedType(Of ITest).TheDefault.Is.OfConcreteType(Of Test)() ObjectFactory.GetInstance(Of ITest) would lead to an error because you could not add classes to structuremap once objectfactory.

Read More...

Why singletons are bad

I didn’t know that google actually had a policy about it, but they explain very well why you should avoid them. They even have an application that searches for singletons in code. Here is a little extract of that article. The use of singletons is actually a fairly controversial subject in the Java community; what was once an often-used design pattern is now being looked at as a less than desirable coding practice.

Read More...

Interview With Louis Davidson Author of Pro SQL Server 2008 Relational Database Design and Implementation

Pro SQL Server 2008 Relational Database Design and Implementation is one of those books that should be in the hands of every SQL Server developer. There are tons of SQL Server programming books around but none of them covers the fundamentals of a good SQL Server database, the design. If your design is ‘broken’ then it is a lot harder to fix it down the road, design is probably the number one reason people have all kinds of problems with their databases.

Read More...

Nice .NET Design Patterns Articles

The DotNetSlackers site has a nice series of articles about design patterns. The articles were written by Granville Barnett and are a very good read. Here is what is in the first four articles. Design Patterns – Part 1 Learn how to design more robust and maintainable code by incorporating design patterns into your software projects. 1 Introduction 2 The strategy pattern 3 Implementing our design 4 Summary Design Patterns – Part 2

Read More...

Behaviour-driven development and User stories

On Dan North‘s blog you will find a nice writeup on this subject the post is called What’s in a Story? and explains it a bit better. Compare to use cases where you describe the interaction between the stakeholder and the other stakeholder (mainly the system) this describes the desired behaviour of the system. This is an example of such a use case. Found here. Use Case Example Example for the Club Information System (CIS)

Read More...

Google Chrome Dev Channel: Early Access to Features and Fixes

If you want to get the new Chrome features as soon as possible then you are in luck; Google has launched the Google Chrome Dev Channel. The Google Chrome Dev Channel will give you early access to features and fixes. The Dev channel is useful for: Web developers who want to test their sites or scripts with pre-release versions of Google Chrome Testers who need to make sure they’re working with the latest bug fixes

Read More...

DATAllegro acquisition to enable SQL Server to scale into hundreds of terabytes of data

Microsoft just announced that they have finalized the DATAllegro acquisition: Microsoft Closes Acquisition of DATAllegro Some interesting thing in this press release: Microsoft will offer a new solution based on DATAllegro’s technology that extends Microsoft SQL Server to scale into hundreds of terabytes of data. The company will begin giving customers and partners early access to the combined solution through community technology previews (CTPs) within the next 12 months, with full product availability scheduled for the first half of calendar year 2010.

Read More...

FIX for A MERGE statement may not enforce a foreign key constraint when the statement updates a unique key column that is not part of a clustering key bug

FIX: A MERGE statement may not enforce a foreign key constraint when the statement updates a unique key column that is not part of a clustering key and there is a single row as the update source in SQL Server 2008 In Microsoft SQL Server 2008, a foreign key constraint may not be enforced when the following conditions are true: • A MERGE statement is issued. • The target column of the update has a nonclustered unique index.

Read More...

One Second Caching, Brilliant Or Insane?

Let’s say you get 1000 hits per second on your website’s home page, you want the users to feel that the site is as real time as possible without overloading your database. These hits on your site display some data from the database and are mostly reads; for every 10 reads there is one write. Yes you can cache it for 1 minute and the database won’t be hit that much.

Read More...