I recently wrote a post about how to set up CW’s IOC container for applications. This post covered the most basic implementation to get an IOC container up and running. It is now time to cover a proper architecture for using IOC specifically for web applications / sites. The main problem with the previous implementation [...]
Archive for the ‘IOC’ Category
Setting up Castle Windsor IOC for web applications
Posted in Architecture, Castle Windsor, Design Patterns, IOC, NHibernate, ORM, TDD, tagged c#, Castle Windsor, Design Patterns, domain, IOC, loosely coupled, Mapping files, NHibernate, ORM, separation of concerns, test driven design, web architecture on September 27, 2010 | 2 Comments »
Testing MS asp.net code behind
Posted in Architecture, Castle Windsor, Design Patterns, TDD, tagged Castle Windsor, Design Patterns, IOC, loosely coupled, separation of concerns, test driven design, web architecture on August 22, 2010 | 1 Comment »
Testing Microsoft’s web forms (asp.net) UI. Microsoft’s web form architecture is not particularly good for testing. The event driven architecture of ‘code behind’ means lots of logic gets stored in C# code that is tightly bound to the HTML code. This means you can’t write purely C# unit tests for it. The best solution is [...]
Setting up the Castle Windsor IOC framework for basic dependency injection
Posted in Castle Windsor, IOC, TDD, tagged Castle Windsor, Design Patterns, IOC, repository pattern on August 1, 2010 | Leave a Comment »
Using an Inversion of Control (IOC) framework such as Castle Windsor is very easy. Here I will show how to set up a very basic dependency injection using an external configuration file. The architecture in this example is a basic repository pattern allowing the (in this case the database) repository to be loosely coupled from [...]
Finding the repository with dependency injection
Posted in Castle Windsor, IOC, tagged Castle Windsor, IOC, loosely coupled, separation of concerns on April 12, 2010 | Leave a Comment »
One thing I noticed, when using dependency injection was that the calling class, i.e the one that instantiates the container to do the injection wont be able to find the repository unless part of your code calls into the assembly it resides in. If you have a) Assembly for domain b) Assembly for DAL c) [...]