I know it is not the traditional "WO way" of doing things, but from my experience using a dependency injection container in your app (Spring, Guice, etc.) is one single thing that you can do to dramatically improve the design quality, and produce flexible and maintainable code.

WO does a bit of that on its own (such as session and application injection in components), but doesn't bundle a container that a developer could use for the custom "services" (unlike say Tapestry, that does have a DI container at its core).

Say I have a WO application and I'd like to use Spring or Guice to inject custom services in the WOComponents, instead of looking them up in WOApplication (or worse - defining them as static singletons somewhere). This sounds easy on the surface. I don't remember all the component creation internals now (it's been a while since I poked around the framework code), but I am pretty sure I can create them with my own factory that is DI container aware. On the other hand (also because I've been out of the loop on WO for quite some time), I am sure I am missing some pieces of the puzzle that would make such setup less practical or outright painful.

This and the fact that DI capabilities don't seem to bother the rest of the community, I figured I'd ask the list on your opinions, while I am trying to wire this thing up in the background.

So anybody played with DI-on-WO in some form with any success?

Thanks,
Andrus

---------------------------------------------
Andrus (aka Andrei) Adamchik
Apache Cayenne ORM: http://cayenne.apache.org/
Creator, VP Apache Software Foundation



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to