I would like to announce the second gem from ObjectSource to the JavaFX Open Source Community – FxContainer
(For those that you have been following, we contributed FxObjects Command-Event-Controller framework and are developing next version)
Both projects can be accessed here: https://fxobjects.dev.java.net/

So what is FxContainer?

FxContainer is the only IoC container that is built using JavaFX and specifically meant for JavaFX applications to provide Dependency Injection.
But that is not its speciality really.

The world is already filled with dozens of IoC containers. Do we need another one? That is the question I pondered a lot before setting out to write a DI/IoC container in JavaFX

Writing a DI is fairly easy, but not completely trivial. So I looked at Spring, Guice and others as to how to apply them successfully for JavaFX

Spring supports XML and Annotation based Dependency Injection. Guice supports Annotation and binding & provider API based DI. Both support Constructor and Setter Injection.

Unfortunately for us, JavaFX does not support Annotations. JavaFX also does not support constructor injection. So we are left with XML based setter injection.

However setter injection feels artificial for JavaFX programming style (where variables are initialized during allocation. Variables are generally declared public-init)

In addition, Setter Injection introduces atleast one known side effect that can cause certain type of JavaFX objects not to work correctly. (More details here: http://weblogs.java.net/blog/srikanth/archive/2010/06/12/wiring-javafx-objects-spring-tread-caution)

A minimal Spring DI requires 3-4 jars that can add up and exceed 1 MB. My aim is to have one DI solution for all platforms (dekstop, mobile etc. i.e if JavaFX becomes a reality in mobile. I know you have some doubts about that. Me too), lightweight, powerful, small footprint and easy to use.

FxContainer is exactly that.

More details 

I will not repeat and bore you with details but you can read it up on my “other blog” at Java.net View it here and Vote for it if you like:

http://www.dzone.com/links/fxcontainer_ioc_container_written_in_javafx_for_j.html

And dont forget to provide feedback, ideas and contribute to the project on our discussion forum: https://fxobjects.dev.java.net/servlets/ProjectForumView