Android and javafx framework

My requirement is that I am looking for a lightweight event platform that is compatible with Android and Java Fx (the Windows and Linux platforms), so that it works smoothly in both technologies.

I explored existing event-based frameworks.
1) Alarm frame ambassador (by bennidi) -> compatible with android 4.0 (ice cream sandwich) as it works great with javafx and is lightweight, and the performance is also good.
2) Guava EventBus: - From the documentation, it seems to be compatible with Android, but what about performance and better than sent.

+7
java android event-handling events javafx
source share
1 answer

Eventing framework MBassador compatible with Android 4.0.
Guava Event Bus is lightweight and compatible with both technologies.

Both of the above frameworks are lightweight and provide a reliable mechanism for the Subscribe / Publish template and, as described by MBassador its initial design was inspired by the Guava Event Bus , but the strong listener link used in the Guava Event Bus was a problem in some scenarios.

According to the credits section in the GitHub MBassador description

The initial inspiration for creating this component came from testing the implementation of the Guava event bus. I liked the simplicity of its design, and I really trust the developers at Google, so I was glad to find that they also provided an event bus system. The main reason why it turned out to be unsuitable for our scenario was that it uses strong references to listeners, so that every object must be explicitly removed from the registration. This was tricky in our managed Spring environment. Finally, I decided to create a custom implementation, which then matured to be stable, extensible, and yet very efficient.

Both frameworks are reliable, lightweight and depend on your requirement to use.

I found a performance comparison on [comparison of Java bus libraries]] ( http://codeblock.engio.net/?p=37 ) (I got the results from the Google cache page of this site), where the structures of Google Guava, SimpleBus, EventBus were mapped both mred and MBassador were the clear winner .

EDIT: I deleted the snapshot and just focused on the final results,

The performance characteristics shown of the compared implementations show that,
1. Subscribing is a costly operation for all implementations, but MBassador and Guava
2. Simultaneous access usually slows down the bus due to higher approval / synchronization.
3. SimpleBus is by far the slowest implementation.
4. MBassador is by far the fastest implementation in all scenarios. It also offers better scaling capabilities, which means that higher concurrency rates do not slow down bus performance like others. This is because MBassador uses a specialized data structure with very fast write operations that do not block readers and at the same time do not copy existing data structures (most other implementations use CopyOnWriteArrayList).

To summarize Over the past few months we have used MBassador , and this meets our requirement that it works well in Android, JavaFX and works well in plain java also on Linux, Windows, Mac , etc. OS

+7
source share

All Articles