I write the Rails. you write the J2EE. lets make lots of honey. The popularity of Java and scripting languages
Aug 09

Dependency Injection: Vitally Important or Totally Irrelevant?

Ruby, Tech Add comments

Jim Weirich talked about the experiences that various people have had in the Ruby world, at migrating the popular IoC craze that started in Java-land via Spring/Pico/HiveMind.

It has been interesting to see Ruby frameworks such as Needle and co. jump into Ruby, to have a lot of people ponder if it REALLY makes sense.

I think the heart of it comes from his comparison:

Java Classes are “Hard”

  • Not Objects
  • (mostly) Source Code Constructs
  • Unchangable at Runtime
  • Class name directly identifies the class.

Ruby Classes are “Soft”

  • Just Objects
  • Runtime live
  • Changable at Runtime
  • Class name is just a label pasted on an object

… and that in general factories aren’t a pain in Ruby, and classes are open so you can sneak in and add mock behaviour whenever you want… ON that class/object.

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What is the number before 3? (just put in the digit)