Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

All Blogs

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    Tags: structuremap

    comments

    One of the things that can burn you when using an IoC container is that if your objectgraph is big than it will take some time to instantiate everything at the startup of your application. But why would we not use Lazy(Of T) to prevent this? After all that is what Lazy(Of T) is for. To lazy initialize your objects.

    Read More...
    comments

    Time to try Autofac and see how it differs from structuremap.

    Read More...
    comments

    NSubstituteAutoMocker for StructureMap

    by Christiaan Baes (chrissie1) on Aug 16, 2010 in categories Microsoft Technologies, C#. Article views: 1621 views

    Introduction

    I use the Automocking feature of StructureMap quite a lot. But they only have support for Rhino Mocks and Moq. Now there is a new mocking framework, NSubstitute, and I would like to use that. But for that I needed an AutoMocker to take some of th...

    Read More...
    comments

    Git, TortoiseGit, Github and the rest

    by Christiaan Baes (chrissie1) on Aug 15, 2010 in categories Microsoft Technologies. Article views: 10284 views

    Introduction

    This weekend I felt the need to make myself an NSubstitute Automocker for StructureMap. The first thing to do was to download the sourcecode for StructureMap and NSubstitute. Both are being hosted on GitHub. because I wanted to fork StructureMap and add the Automocker to it I had to create an account on github,...

    Read More...
    comments

    StructureMap and Generics

    by Christiaan Baes (chrissie1) on Jul 05, 2010 in categories Microsoft Technologies, VB.NET, C#. Article views: 2384 views

    Introduction

    I don't need to tell you that IoC and an IoC-container is something you should use. My container of preference is StructureMap by Jeremy D. Miller.

    One of the more interesting things to map are generic interfaces and their implementations. Generics can save us a lot of typing and make life a lot easier. Less code usually means less bugs. But there are also 2 different ways in which generic interfaces can be implemented - one is open a...

    Read More...
    comments

    I've been using StructureMap 2.5x for some time, and I have been quite pleased with it. I'd read a bit about 2.6x, and the improvements to the registry DSL seemed cool but not quite cool enough to give me the motivation I needed to make upgrading the version used in my project a priority.

    A week or two ago, I found what proved to be my compelling reason. It's a method called

    csharp Sample Code (See Article for Rest)
    Read More...
    comments

    For my usercontrols I tend to use the StructureMap BuildUp feature. I will leave it to the big man himself to introduce you to this feature.

    I use property injection in this case because the designer doesn't like usercontrols that have constructors that are not empty, since it will try to execute the code in that constructor. So we revert to property injection and the BuildUp feature....

    Read More...
    comments

    So we have a windows forms application and some of these forms can only be used once. Like for instance a dashboard. Everytime we show the form we just want it to either show a new one, if it's the first time opened, or we want to show the one that already exists. In essence, this would be good case for a singleton pattern. But the singleton pattern is evil. Why is it evil? Because it is hard to unittest. And it makes us do something that we really don't want to.

    So having established that we got to find a better solution for this poblem. And we have. It's called StructureMap. Stru...

    Read More...
    comments

    So you have lots of forms in your winforms application and you have to open them from several places/forms. But you don't want to repeat yourself all the time. And you like to keep things centralized. You also want it to be flexible, if possible and easily extendable/extensible/extendingable, uhm, be able to extend it in an easy manner. I think this is a typical case for the command pattern. So let's start with that.

    Warning! what follows is a lot of code. So this will be a long post. But you can skip all the parts you don't like. Not that you will.

    Let's start by creating a...

    Read More...
    comments

    Using the structuremap Automocker

    by Christiaan Baes (chrissie1) on Feb 04, 2009 in categories Designing Software. Article views: 2863 views

    I was not really convinced in the past that I should use the Structuremap Automocker for any of my tests. I don't like using the container in my tests it makes them way to dependent on something not really needed to run the test. Of course I test to see…

    Read More...

    :: Next >>