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

Authors

Search

XML Feeds

Google Ads

Tags: structuremap

comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

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
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

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
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

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
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

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 if the container is well configured and if the objects are created by the container when it is well configured (this has saved me several times before). I really only have myself to blame because I didn't really try it and only suspected what it was doing.

Well apparently I was wrong, and lucky for me I read the right blogs.

Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

In my previous post I already mentioned the BuildUp method in StructureMap and how cool that can be. And now I want to show you how to do this in VB.Net. As we all know VB.Net doesn't like Multiline lambdas or void lambdas. But we will kill somebody for that later. In this example I also used a real form and it didn't get hurt by the designer this time.

The code is pretty much the same as my previous post.

Here are the services and their interfaces.

Read More...

:: Next >>