Dependency Injection

Castle Windsor Tips – say NO to private setter

Now, this is something that has stung me and every single one of my colleagues time and time again.. Imagine you have an interface called IMyConfiguration which has a get-only property: And the implementing class takes in a parameter called port in the constructor and sets the value of the property using a private setter …

Castle Windsor Tips – say NO to private setter Read More »

Castle Windsor Tips – specifying IEnumerable in config file

One of the more obscure things I have had to do inside a Castle config is to specify an IEnumerable<T> instance which required taking the technique I showed in this post a little further: I specified the lifestyle of this IEnumerable<T> to be singleton as in most cases where you would want to do something …

Castle Windsor Tips – specifying IEnumerable in config file Read More »

Castle Windsor Tips – specifying generic types in config file

If you have an interface like this: with a concrete class like this, which you want to wire up with Castle: Then here’s the syntax to specify the component in your Castle Windsor configuration file Similarly, imagine if you have more than one generic type parameter: Remember, you need to use the back tick (`), …

Castle Windsor Tips – specifying generic types in config file Read More »

Buzzword Buster – Dependency Inversion Principle

Definition: Dependency Inversion Principle refers to a specific form of decoupling aimed at rending high-level modules independent of the low-level modules’ implementation details. Its principle states: High-level modules should not depend on low-level modules, both should depend on abstractions. Abstractions should not depend upon details. Details should depend upon abstractions. Dependency Inversion Principle is often …

Buzzword Buster – Dependency Inversion Principle Read More »

Buzzword Buster – IoC

Definition: Inversion of Control (IoC) refers to the inversion of the flow of control (the order in which individual statements, function calls, etc. are executed) in a software. You’ll often hear the term Hollywood principle being mentioned in the same breath as IoC, it simply states "Don’t call us, we’ll call you" which more or …

Buzzword Buster – IoC Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close