Home » Dependency Injection

Tag Archives: Dependency Injection

Rich domain objects with DivineInject

DivineInject is a .net dependency injection framework, designed to be simple to use and easy to understand. You can find the source for DivineInject on github. In this second part in the series we’ll look at creating rich domain objects, the first part covers getting started with Divine Inject. Simple Domain Objects As an example, imagine I have a simple ...

Read More »

Your DI framework is killing your code

I read a really interesting post recently looking at the difference between typical OO code and a more functional style. There’s a lot to be said for the functional style of coding, even in OO languages like Java and C#. The biggest downside I find is always one of code organisation: OO gives you a discoverable way of organising large amounts of ...

Read More »

Dependency injection in WCF

Dependency injection is a software design pattern that implements inversion of control for resolving dependencies and is highly recommended for building scalable, testable and maintainable applications. In this very blog we have seen many times this pattern, mostly in ASP.NET MVC and ASP.NET Web API related posts where for example dependencies (data repositories or middle services) were injected into MVC ...

Read More »

Remember RIA Services? Trackable Entities Can Fill the Void

Anyone remember WCF RIA Services?  It was a great idea: simplify n-tier development with a combination of libraries and tooling. Take something which is inherently difficult, namely data-centric web services consumed by rich clients, and make it easier.  Provide a client library that performs change-tracking without dependence on Entity Framework, and a service library that can persist batch updates.  But ...

Read More »

Dependency injection with PostSharp

I don’t really like IoC containers. Or rather, I don’t like the crappy code people write when they’re given an IoC container. Before you know it you have NounVerbers everywhere, a million dependencies and no decent domain model. Dependencies should really be external to your application; everything outside of the core domain model that your application represents.           ...

Read More »

Using NLog with Dependency Injection

In my last post I blogged about using Dependency Injection to break tight coupling between application components. This lets you to treat infrastructure pieces, such as data access or logging, as swappable entities, allowing your application to change with the times as new technology stacks replace obsolete or deprecated ones. In this blog post I will share how I took ...

Read More »