April 2009 Entries
I upgraded to ReSharper 4.5 recently, and when working with it I discovered new, cool feature. Having this (notice class Person does not exists yet, hence the red): You can do this: And get this: I’m pretty sure older version would say private static object person; And even if it’s not new, it’s still a nice little smart feature. I only wish that doing this… … would also generate the constructor and property in one go. ...
After a longish break we’re back to the Castle Dynamic Proxy tutorial.
The three kinds of proxies we talked about so far (class proxy, interface proxy with and without target) are the only kinds of proxies most users will ever use. There is however one more kind – interface proxies with target interface.
When I say most users will never use it, by most I mean roughly 99%. I, personally haven’t used it. Whole Castle project stack uses it in only one place that I know of – WCF facility. This proxy kind is used in really rare cases, and you can...
UserVoice is a very nice Web 2.0-ish web application, where users of different projects can speak their mind about projects in question. I like it for its clear interface, readability, and very low friction. Users can suggest improvements to projects, comment and vote on other suggestions. Project owners can give feedback to users, and official responses to suggestions. Some projects I use often like AnkhSvn, and StackOverflow use it as an official channel of feedback, and it seems to work very well. I thought Castle Project could use that too, so few days ago I created a site for...
I don't usually do that, but here's Ayende' presentation from last year's Oredev conference (yes, it says 2007, but it really is from 2008).
It's fun, very informative if you don't know Active Record, and of surprisingly good quality (means you can actually hear what Ayende is saying, and see the code). Most of all, this is an awesome presentation.
How many times have you gone to a presentation when presenter said "Give me a domain model that you want to work on" and then went and implemented it!
It's a must see. Highly recommended. And if you register to viddler, you can...
Quiz Consider the following piece of code (it shows Castle MicroKernel, but since Windsor is built on top of MicroKernel, it works the same way): IKernel kernel = new DefaultKernel();
kernel.AddComponent("sms", typeof(IAlarmSender), typeof(SmsSender));
kernel.AddComponent("email", typeof(IAlarmSender), typeof(EmailSender));
kernel.AddComponent("generator", typeof(AlarmGenerator));
AlarmGenerator gen = (AlarmGenerator) kernel["generator"];
Considering AlarmGenerator has a dependency on IAlarmSender, which one of two registered components will it get?
The answer is: the first one.
In this case we registered SmsSender first, so it will get injected. If we switched the order of registration, EmailSender would get injected. It does...
Patrik Hägne has an interesting post on removing compile time dependencies between assemblies, while still reaping benefits of using fluent interfaces to bootstrap AutoFac container (go read it, I’m not going to reiterate what Patrick wrote) using MEF. It inspired me to do similar thing for Castle Winsor. I created a simple solution with 3 project. One is the main application entry, which also holds a MefInstaller which we’ll talk about in a second. Second one: Services, contains interfaces that our application rely on. Impl contains implementation of these interfaces. Pretty simple huh? The...
This is part IX of my ongoing tutorial on Castle Dynamic Proxy. If you are new to it, you probably want to read previous parts first: Introduction The what, why and how Selecting which methods to intercept Breaking hard dependencies InterceptorSelector, fine grained control over proxying ...