background preloader

Castle Windsor

Facebook Twitter

Blog - Primitive Dependencies. Primitives are also dependencies There are tons of examples of how Dependency Injection (DI) can be used to decouple clients and services.

blog - Primitive Dependencies

When the subject is DI, the focus tends to be heavily on the Liskov Substitution Principle (LSP), so most people think about dependencies as polymorphic types (interfaces or abstract base classes). Primitive types like strings and integers tend to be ignored or discouraged. 10 Advanced Windsor Tricks - Introduction. I love speaking at the developer days held at Microsoft UK's Reading campus.

10 Advanced Windsor Tricks - Introduction

The next one is going to be on the 30th January, so make sure you get in there quick when the registration opens on the 15th. Overreaching myself again, I've put forward three talks: An Introduction to IoC Containers with Castle Windsor Enterprise Integration with MassTransit 10 Advanced Windsor tricks I've presented the first two before, but the '10 Advanced Windsor tricks' is new. As a way of preparing I thought I would spend the next 10 days blogging about the 10 tricks that I plan to talk about.

IHandlerSelector

Inline dependencies - Castle Project. Most components in your application will depend on services exposed by other components or have no dependencies at all.

Inline dependencies - Castle Project

Some components however require dependencies which would either be illegal as services, or make no sense as components in the container. Those may be int dependencies, for example retry-count when attempting to query a third party REST API (say Twitter or Github), a string representing API key for the API, a TimeSpan for timeout, or a TwitterApiConfiguration object encapsulating all of the above.

Windsor obviously supports these scenarios. The registration API has a .DependsOn() method for that. The method takes a value returned by one of the static methods of Dependency class.