DataFX – @Named support (accepted)

During the christmas and new year holidays I implemented the @Named feature for DataFX.

It’s already accepted and merged into the validation branch of DataFX (Thanks to Hendrik Ebbers).

This feature enables a user to inject different instances of a bean into a controller, distinguished by a resource name via @Named annotation.

You can, for example,  introduce multiple flows from a starting point that will modify different sets of the same kind of data. It’s also possible to use an application scoped bean or pojo for sharing information between different flows or views and have a flow scoped instance that allows you only to manipulate the data for this specific flow.

How to use

The usage is quite simple

The MasterController has to sub views, GeneralDataController and SpecialDataController, both have access to the general data set ( @Named(“general”) ), But only the SpecialDataController will have access to the the special data set ( @Named(“special”) ). The transportation and further handling of both data models can be done in the SpecialDataController or the MasterController.

(I will publish a complete example on bitbucket for this during the next week)

Further plans

Because @Named is stated as simple kind of qualifier, I will add the full support of qualifiers in the next pull request.

At the moment I’m playing around with the introduction of @Produces mechanics. A very simple (but already working) approach is available in my Bitbucket fork of DataFX in the branch producerExtension.

1 Kudos

Leave a Reply

Your email address will not be published. Required fields are marked *