JavaFX Event Bus Recommendations
zonski at gmail.com
Thu Oct 25 13:56:20 PDT 2012
I'm on the side that says this shouldn't be in JFX and should be done via OSS projects.
There are many different flavours and styles to this problem and some fit some apps/domains better than others. eg you could have a shared, app-wide model (or tree of models) backing your views with observable properties that you can listen to. This flavour is a kind of state-full event bus that you can query for current state at any time and works well for full client side apps, like an IDE or 3d model editor. It works less well with a client-server system where your 'model' is effectively on the server. Heaps of other options exist with pros and cons. Which one should jfx choose?
Also, in general OSS projects will be able to adapt much faster to changes than jre/jfx, make use of other libraries, and be easier for contributors to get involved with (compare fxextras project to oracle fx).
It also reduces jfx bloat (eg smaller downloads, less to port to mobile platforms, etc) and keeps the jfx team free to focus on things that need to be done at the platform level, like high speed graphics, 3d rendering, media, *deployment* and cross-platform ports (like mobile).
Everything that can be done outside of jfx should be IMO. I'd vote the same for things like validation frameworks (and charts and FXML but too late on those fronts). Core fx should provide lower level hook-ins (like ways to add Node highlights which can be leveraged for validation frameworks).
Java is an operating system, not an application framework. That's been part of its long term success. The app frameworks should be built on top of it (like spring, struts, GAE, etc, etc - none of those are part of the jre thankfully!).
On 26/10/2012, at 7:00 AM, Mark Fortner <phidias51 at gmail.com> wrote:
> Hi John,
> I had the same problem trying to connect to Greg's project. I've used the
> SimpleEventBus (another google code project) before on a Swing project:
> http://code.google.com/p/simpleeventbus/ but not in JavaFX.
> On Thu, Oct 25, 2012 at 12:13 PM, John Smith <John_Smith at symantec.com>wrote:
>> There are a couple of forum threads on Event Buses you could read to see
>> what other people have done around this:
>> One of them includes a link to a simple JavaFX implementation which Greg
>> Brown created http://code.google.com/p/sjmb/ (unfortunately the link
>> doesn't work for me as I am not authorized to view it).
>> -----Original Message-----
>> From: openjfx-dev-bounces at openjdk.java.net [mailto:
>> openjfx-dev-bounces at openjdk.java.net] On Behalf Of Mark Fortner
>> Sent: Thursday, October 25, 2012 11:31 AM
>> To: openjfx-dev at openjdk.java.net
>> Subject: JavaFX Event Bus Recommendations
>> In my current application we're using the standard point2point eventing
>> that comes with JavaFX. To create support for a new type of event we:
>> - Create an EventType class.
>> - Create an Event class
>> - Create an Event Listener interface for it.
>> - Add a mixin that makes it easier to add/remove/notify listeners.
>> Since there are several developers on the list who make heavy use of the
>> Spring framework, I was wondering if anyone had tried using the Spring
>> Eventing framework
>> http://blog.yohanliyanage.com/2012/09/eventing-with-spring-framework/ as
>> more scaleable approach to adding support for new events? Or if there
>> were any other Event Bus frameworks that the community could recommend for
>> use with JavaFX?
>> Also, are there any plans to more directly support an Event Bus in JavaFX?
More information about the openjfx-dev