inversion-of-control

What are "ForwardedTypes" in the context of Castle Windsor component registration?

As the subject says, really! What do they do? ...

Using Castle Windsor's fluent interface to register components in a decorator chain, when there are also specialised service-types?

I am trying to implement a decorator chain for my data-access based on IRepository. I have a Repository that does the data- access (at the moment just in-memory list) {1}, and I have one that does validation {2}. On top of that, I have a specialisation of my Repository, IUsersRepository {3}, which defines another method on the base int...

Any way to add some default assemblies to resolve types from in Unity / ObjectBuilder?

I'm working on my 1st project using MS Unity IoC framework. If I have this in my unity configuration: <container name="TestBusiness"> <types> <type type="PFServer.DataAccess.TestDataAccess" /> Then I get the error: Could not load type 'PFServer.DataAccess.TestDataAccess' from assembly 'Microsoft.Practices.Unity....

StructureMap and SqlCacheDependency

I'm trying to enable SqlCacheDependency through my StructureMap IoC, I'm using LinqToSql I have the code done to take care of the Linq Caching but not quite sure how to go about setting up the SqlCacheDependency as it requires putting this in a global.asa file void Application_Start(object sender, EventArgs e) { string connectionSt...

Flex Prana

I was wondering how many of you already used the Prana Framework for AS3 (Flex/Flash) or heard about it? I have found it very usefull but there doesn't seem to be a lot of developers using it... The link is PranaFramework Thx, Lieven Cardoen aka Johlero ...

.NET: Select concrete classes using config file

(This question specifically in C#, but applies generally to .NET) I have a largish application that has a fairly good design, and is broken into major sections over interfaces (this was done to assist parallel development). We now have a primary set of concrete classes that implement the required interfaces, but we also have additiona...

ASP.NET MVC Beta 1: DefaultModelBinder wrongly persists parameter and validation state between unrelated requests

When I use the default model binding to bind form parameters to a complex object which is a parameter to an action, the framework remembers the values passed to the first request, meaning that any subsequent request to that action gets the same data as the first. The parameter values and validation state are persisted between unrelated w...

DI- Dynamic parameter of type Type where type is the parent objects type

Hi guys I have a dependency that I need to inject into one of my classes. This dependency will be lifestyle of Transient. It inturn has a dependency of type Type. This type should be the type of the original class. I was just wondering if anyone has any idea how I might go about conducting this registration. See example: public interfa...

Smalltalk and IoC

I see a lot of IoC frameworks for .Net and Java. Does anyone know why there are no equivalent frameworks for Smalltalk. This is more a philosophy question than anything else. I'm wondering if there is something in the Smalltalk way of doing things that precludes the necessity of having an IoC framework. ...

Where & How Castle Windsor sets up logging facility

Hi guys I'm fairly new to Castle Windsor and am looking into the in's and out's of the logging facility. It seems fairly impressive but the only thing i can't work out is where Windsor sets the Logger property on my classes. As in the following code will set Logger to the nullLogger if the class hasn't been setup yet but when Resolve is...

Inversion of Control with .net

It's rare that I hear someone using Inversion of Control (Ioc) principle with .Net. I have some friends that work with Java that use a lot more Ioc with Spring and PicoContainer. I understand the principle of removing dependencies from your code... but I have a doubt that it's so much better. Why do .Net programmers not use (or use les...

Which Inversion of control (IoC) containers support .NET 1.1?

(see title) ...

StructureMap IOC/DI and object creation

I'm building small web shop with asp.net mvc and Structuremap ioc/di. My Basket class uses session object for persistence, and I want use SM to create my basket object through IBasket interface. My basket implementation need HttpSessionStateBase (session state wrapper from mvc) in constructor, which is available inside Controller/Action....

.config to constructor tricks?

I'm working on a quick project to monitor/process data. Essentially that's just monitors, schedules and processors. The monitor checks for data (ftp, local, imap, pop, etc) using a schedule and sends new data to a processor. They call have interfaces. I'm trying to find a sane way to use config to configure what schedule/processor each ...

Does Castle Windsor allow the resolution of value types?

I'm trying to pass a parameter into a component that requires a System.TimeSpan. I'm only able to get the 'long ticks' ctor to resolve. Here's a snippet of the config file: <component id="timeInForce" type="System.TimeSpan, mscorlib"> <parameters> <hours>0</hours> <minutes>15</minutes> <seconds>0</seconds> </parameters>...

Does Castle-Windsor support ForwardedTypes via XML configuration

I have a class that implements multiple interfaces. I would like to register these interfaces via XML. All I've found is documentation for the new Fluent Interface. Is this option supported via XML? What would be involved in adding this feature? ...

Abstracting IoC Container Behind a Singleton - Doing it wrong?

Generally, I like to keep an application completely ignorant of the IoC container. However I have ran into problems where I needed to access it. To abstract away the pain I use a basic Singleton. Before you run for the hills or pull out the shotgun, let me go over my solution. Basically, the IoC singleton does absolutly nothing, it s...

Does an IoC container replace the use of Factories

Hi I am just getting started with IoC containers so apologies if this is a stupid question. I have code like the following in an app internal static class StaticDataHandlerFactory { public static IStaticDataHandler CreateHandler(StaticDataUpdate staticDataUpdate) { if (staticDataUpdate.Item is StaticDat...

MVP and IOC in Windows Forms?

I’ve started using the MVP pattern in a Windows forms app for a couple of my forms. These forms create a presenter and pass themselves back to the presenter. I’m not using any particular framework and forms are still able to open other forms. Should I change this setup so that presenters can open other forms (via views)? I believe wou...

Is Dependency Injection possible with a WPF appliction?

I want to start using dependency injection in my WPF application, largely for better unit testability. My app is mostly constructed along the M-V-VM pattern. I'm looking at autofac for my IoC container, but I don't think that matters too much for this disucssion. Injecting a service into the start window seems straightforward, as I can...