Bitter Coder
sour code and astringent experiences
Thursday, June 19, 2008
Unity container comparison
If you recall many moons ago I posted a
series of articles
on the
Castle Project's IOC Container
"Windsor" teaching the fundamentals of IoC with a practical bent - lots of people liked them, and I still get feedback every now and then from people starting to use windsor and finding them useful.
At any rate
Michael McGuire
was once such person who read those tutorials a year or so ago and has now started a series of his own - mirroring my castle container tutorials but with the P&P
Unity
container instead - you can find it
here
.
As someone who has not given Unity much more then a brief skim it's a nice way to quickly get up to speed on some of the key differences.
So far after reading a couple of articles I've learnt.
You need to implement your own type converters for things like arrays or dictionaries in configuration.
Configuration syntax is not particularly human-friendly, obviously designed for management via a tool - requiring the entry of full types all over the spot like "Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration" - just to register a component!
Default lifestyle is transient... hmmm.. personally I think singleton is more-often the norm for me when writing applications, but it really depends on how the container is being used/abused I guess.
Support for multiple configurations looks a little more baked in - but this is trivial stuff to implement in most containers.
I'll be interested to see how decorator chains etc. are implemented in Unity.
Good work Michael.
.Net
|
castle
|
Unity
|
windsor
posted @ Thursday, June 19, 2008 12:45:04 AM (New Zealand Standard Time, UTC+12:00)
Comments [2]
|
Trackback
|
Tracked by:
"The container tutorials have a life of their own... " (Bitter Coder)
[Trackback]
Thursday, June 19, 2008 1:33:43 PM (New Zealand Standard Time, UTC+12:00)
I often abuse Windsor with predominantly transient components.
Bill Pierce
Thursday, June 19, 2008 7:40:56 PM (New Zealand Standard Time, UTC+12:00)
Yeah, I've certainly had projects that go that way as well, I was just thinking in regards to more mundane IoC usage... like repositories, services etc. in a Monorail/MVC app. I suppose being able to set a default lifestyle at the container level would probably solve the problem - though that defeats convention over configuration.
Alex Henderson
Comments are closed.
© Copyright 2008 Alex Henderson
Theme design by
Bryan Bell
newtelligence dasBlog 1.9.6264.0
| Page rendered at Wednesday, August 20, 2008 7:00:53 AM (New Zealand Standard Time, UTC+12:00)
Search
FeedCount
Tags...
.Net (75)
.Net Reactor (1)
.net user groups (9)
2008SummerRoadTrip (1)
ActiveRecord (1)
architecture chat (44)
ArchitectureCamp2007 (2)
asp.net (1)
Astoria (1)
base4 (9)
batching (1)
binsor (1)
blog (3)
books (1)
C# 3.0 (9)
cambodia (9)
CAML.Net (1)
castle (36)
china (8)
codecamp (2)
codeplex (3)
dapper.net (1)
DevDefined Ltd. (2)
DirectShow.Net (1)
DLR (1)
DSL (3)
EAUG (1)
Enterprise Architect (5)
Enterprise Library (1)
F# (1)
feedburner (2)
generics (1)
googlegears (1)
hacks (2)
hardware (2)
hongkong (2)
ideas (1)
IoC (19)
IronPython (13)
IronRuby (2)
jobs (1)
Languages (2)
laos (8)
LINQ (7)
Local Government (1)
MDA (1)
MDD (1)
Model Driven Development (1)
mono (1)
monorail (2)
Movies (1)
Music (1)
nDepend (1)
news (1)
NHibernate (2)
NUnit (2)
nvelocity (1)
OAuth (2)
office (1)
photos (1)
php (1)
PostSharp (1)
powerpoint (1)
presentations (1)
ReSharper (1)
REST (2)
rhino commons (2)
rhinomocks (5)
Ruby (1)
SaaS (1)
scm (1)
Screen Architect (1)
SharePoint (5)
silverlight (1)
Splicer (4)
SQL2008 (1)
supcom (1)
svn (1)
Syzmk (4)
thailand (6)
Tools (2)
Tortoise SVN (1)
trac (2)
Travel (36)
Unity (2)
vietnam (7)
vista (2)
volta (3)
VS2008 (1)
WCF (2)
wiki (2)
wikipedia (1)
Windows Server 2008 (1)
windsor (3)
WinForms (1)
wix (2)
WPF (2)
xmlrpc (1)
yahoo pipes (1)
Who am I?
Alex Henderson
Auckland
, New Zealand
Managing Director at
Dev|Defined Limited
"Self Confessed Coding Junky for 15 years"
Mobile:
+64-21-402-969
Email:
bittercoder 'at' gmail 'dot' com
MSN:
bittercoder_nz@hotmail
Skype:
alex.devdefined
Navigation
My Bookmarks (Delicious)
My GoogleReader - shared items
My Photos on Flickr
My Wiki
Catch NZ Limited
DevDefined Limited
tools.devdefined.com (Trac site)
New Zealand DotNet User Group
Screen Architect
Seismic Technologies (Syzmk)
Splicer - The .Net Video Splicing Library
On this page....
Blogs I read by New Zealanders...
Alex James
André Meurer @ Olympic Software
Andrew Dixon
Andrew Peters
Bennie Johnston
Blog:: Craig Pringle
Blogging is probably just a fad, but just in case...
Buzzrick's TileEngine Game Platform
Chris Auld
Chris Crowe's Blog
Chris Johnson
Clifton Johnston
Code Climber
Craig Box
Daniel
Daniel Wissa
Darryl Burling
Dave Dustin
Duncan Bayne
Floyd Burgess
Gabriel Smith
Geekzone blog
Grant Archibald
Grant Drake
Ivan Porto Carrero
Ivan Towlson
Jeremy Boyd
Jithen Singh
John-Daniel Trask
Josh Hektor
Juha Saarinen
Keith Nicholas
Kevin Daly
Mark Rees
Maruis Marais
Mauricio Freitas
Mindscape
My Blog (Alex Henderson)
Nathan Mercer
Nic Wise
Nick's Blog
Nigel Parker
Paul Andrew
Paul Lo
Peter Jones
Phil Cockfield
Public Address
Rod Drury
Sean McBreen
Simeon Pilgrim
Software Development and stuff
Stefan Schulz
Steve Schapel
Steven Kempton
The Blog of Dave5
The Book Diary
The Voice Of Reason New Zealand
Thoughts from Mirality
Tim Haines
Blogs I read on Castle...
Andrew Hallock
Ayende
Brian Romanko
Dan Bunea
Dru Sellers
Eleutian SpeakENG Development Blog
Gabriel Schenker
Hamilton Verissimo
Insane World
Insert Catchy Title Here
Jeff Brown
Ken Egozi
Marc-André Cournoyer's blog
Matt Berther
Nick Parker
Roy Osherove
Roy Tate
Technorati: http://castleproject.org
Wendy Friedlander
BlogMap
Del.icio.us
Wishlists
Sign In