Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

April/2024
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
2122232425 2627
282930    

[ Archives News
for 'Java Technology' ]

home > news > java technology > fxcontainer - ioc container written in javafx, for javafx applications

FxContainer - IoC container written in JavaFX, for JavaFX applications

NOTE: A  slidedeck with 20 slides of "How To" JavaFX Dependency Injection with FxContainer is available here.   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. I will briefly cover the facts that necessitated writing one and then show how to use it. Constructor Injection or Setter Injection? All IoC containers provide two type of dependency injection - constructor injection and setter injection. Constructor injection is technically impossible as the JavaFX language does not support overloaded constructors. While setter injection is possible, it does seem very artificial in JavaFX. JavaFX instance variables are typically declared as public or public-init etc. This means the initialization of these variable is typically as follows: var finder = MovieFinder { movieDao: MovieDao { } } A MovieDao is provided when the MovieFinder is initialized. Notice that this falls under neither constructor injection nor setter injection. Due to lack of a name, I call it Init Injection. If we were to use Spring to inject the Dao into the MovieFinder, then the MovieFinder class should look like this: public class MovieFinder { public-init movieDao:MovieDao; public function setMovieDao(dao:MovieDao) { this.movieDao = dao; } } Writing setters method for instance variables that are public-init seems v...


Date: August, 21 2010
Url: http://www.java.net/blog/srikanth/archive/2010/08/21/fxcontainer-ioc-container-written-javafx-javafx-applications


Others News

©2002-2019Java-Virtual-Machine.net website design software | bootstrap menu | bootstrap navbar template | free website generator | free bootstrap template