Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Memoization as Dependency Injection

Reply
Thread Tools

Memoization as Dependency Injection

 
 
James Bowery
Guest
Posts: n/a
 
      11-19-2004
I'm probably missing something about the concept of dependency
injection (I'm sure I'm not the first) but what is it about DI that
isn't this reducible to memoization of getters?
 
Reply With Quote
 
 
 
 
Jamis Buck
Guest
Posts: n/a
 
      11-19-2004
James Bowery wrote:
> I'm probably missing something about the concept of dependency
> injection (I'm sure I'm not the first) but what is it about DI that
> isn't this reducible to memoization of getters?
>
> .
>


Well, DI is a lot more than caching the services that get created. For
example, in Needle, you can have prototype services, which are created
on every request instead of being cached.

In fact, memoization of services is not even directly related to DI.

That said, DI is all about some third party hooking up dependencies for
an application. Think of it as an online dating system for your
application components. _The container_ knows all the pieces, and it
knows how to couple them all together as needed.

Have you read Jim Weirich's article on dependency injection in Ruby?
http://onestepback.org/index.cgi/Tec...ionInRuby.rdoc

If you haven't, you really ought to. If you have, I'd be happy to put in
a few more words of clarification on the subject.

- Jamis

--
Jamis Buck
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.jamisbuck.org/jamis


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Immutable cyclic graph with dependency injection Philipp Java 8 06-29-2009 07:53 PM
Is it in the C++ culture to use Dependency Injection/Inversion ofControl? Danno C++ 12 04-10-2008 08:08 PM
What is Dependency Injection? Anonieko ASP .Net 2 10-14-2007 12:03 PM
Dependency Injection in C++ Michael Feathers C++ 5 10-13-2006 08:23 AM
How to build a dependency injection framework by myself? =?iso-8859-1?B?bW9vcJk=?= Java 4 08-24-2006 06:57 PM



Advertisments