Building a new Dependency Injection Framework
-
We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?
Maruf Maniruzzaman @ Dhaka, Bangladesh.
Maruf Maniruzzaman wrote:
How much does this worth? Waste of time?
Filling a niche? Making an improvement? Hard to say... They're usually easy to swap so adoption isn't too hard assuming you bring something beneficial to the table.
Todd Smith
-
We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?
Maruf Maniruzzaman @ Dhaka, Bangladesh.
Maruf Maniruzzaman wrote:
How much does this worth? Waste of time?
I've been using Spring.NET and Microsoft's CAB, and have been playing around with my own framework (see my articles on Cx). The two I've used are fine, but they are easily abused: 1. You can create complex instantiation graphs that take forever to initialize and slow down the startup of the application 2. The more complex the instantiation graph, the harder it is to debug 3. It would really be nice if these players invested the time into a designer tool so you can avoid all the mistakes that occur with editing XML directly (for example, I wrote a bare-bones designer for Cx, toot-toot) 4. It would be nice if these players wrote some tools so you could see the instantiation graph. It can take hours (from experience) to understand and document the dependencies 5. Ultimately, the point is to make it easier to swap components and do mocking. Frankly, there are simpler ways to skin that cat, IMO. Anyways, if you read Cx Part II[^], near the top of the article are some Best Practices I've identified. Hope that helps! Marc
I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner
-
What exactly is a dependency injection framework? :~ Judging by the name along, it doesn't look very useful.
-
Jörgen Sigvardsson wrote:
Judging by the name along, it doesn't look very useful.
Heh... If you think that now... wait'll you find out what they are! :rolleyes:
I don't know, every time I start a project that requires 'variable' dependencies I have to stop myself building a small one, so what's wrong with an already built one? I love the concept of IoC, but grant that it's often in the YAGNI arena.
I have been trying for weeks to get this little site indexed. If you wonder what it is, or would like some informal accommodation for the 2010 World Cup, please click on this link for Rhino Cottages.
-
We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?
Maruf Maniruzzaman @ Dhaka, Bangladesh.
look at LinFu, StructureMap, AutoMapper, etc... ad nauseum.
-
What exactly is a dependency injection framework? :~ Judging by the name along, it doesn't look very useful.
Martin Fowler - Dependency Injection and Inversion of Control[^] Basically, it's a way to remove hard dependencies in your code.
Religiously blogging on the intarwebs since the early 21st century: Kineti L'Tziyon Judah Himango
-
We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?
Maruf Maniruzzaman @ Dhaka, Bangladesh.
Maruf Maniruzzaman wrote:
We already have some good one- Spring.NET, Unity, Castle and more- How much does this worth? Waste of time?
As someone who has written no less than three of them (Click here[^], here[^], and here[^]), I'll have to say that writing your own IOC container can be a very enlightening experience, but be prepared to sacrifice hundreds of hours of your time to put one together. If you're going to build an DI/IOC framework just for the sake of learning how DI/IOC containers work, then go for it--but I don't recommend writing one unless you need to do something that the seven (?) other DI/IOC containers don't already do.
Do you know...LinFu?
-
I don't know, every time I start a project that requires 'variable' dependencies I have to stop myself building a small one, so what's wrong with an already built one? I love the concept of IoC, but grant that it's often in the YAGNI arena.
I have been trying for weeks to get this little site indexed. If you wonder what it is, or would like some informal accommodation for the 2010 World Cup, please click on this link for Rhino Cottages.
-
Jörgen Sigvardsson wrote:
Judging by the name along, it doesn't look very useful.
Heh... If you think that now... wait'll you find out what they are! :rolleyes:
:laugh: Always to the point, Shog9.
Personally, I love the idea that Raymond spends his nights posting bad regexs to mailing lists under the pseudonym of Jane Smith. He'd be like a super hero, only more nerdy and less useful. [Trevel]
| FoldWithUs! | sighist -
Yes- you create properties for interfaces and then set those value from config file- framework creates new object and set for you- you can switch between implementation of that interface just by changing the config file-you get close to 100% decoupled application- actually a lot more- it worth reading about DI/ IoC whether you use or not: Inversion_of_control[^]
Maruf Maniruzzaman @ Dhaka, Bangladesh.