Giter Club home page Giter Club logo

jeve's Introduction

Twitter Follow

Hi there ๐Ÿ‘‹

jeve's People

Contributors

skuzzle avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

blaizedsouza

jeve's Issues

EventProviders should not extend AutoClosable

EventProviders are not made to be used within try resources blocks. Its not even mandatory to close them (like it is for Streams and further IO classes). Extending AutoClosable also causes useless 'resource leak' warnings in some IDEs.

This should better be replaced by a Disposable interface which could be implemented by stores and providers.

Use slf4j for logging

There are some parts where logging would make sense, like when an Exception thrown by an ExceptionCallback is swallowed

Change signature of ExceptionCallback to pass the EventProvider

The dispatching EventProvider should be passed to the exception call back. A new default method exception(EventProvider<?> provider, Exception e, Listener source, Event<?, ?> cause) should be added to the ExceptionCallback interface, which calls the old exception method when not being overridden.

Update wiki

Wiki is out of date and should be updated for the 3.0 release

Add property map to Events

For extending legacy events where you can not extend the original code, the Event class should get a map to assign arbitrary properties to it

ListenerStores should be synchronizable

Stores should by default always be implemented without thread locking, to allow higher runtime performance. Instead of locking, they should provide a method which returns a synchronized view of the store which can be accessed concurrently without causing problems.

Extract ListenerSource interface from ListenerStore

The ListenerStore interface should be split into ListenerStore and ListenerSource, where the latter contains the Stream<Listener> get() method. This is because EventProviders must not necessarily know how listeners are added or removed but only how they are retrieved.

Add support for dependency injection of listeners

Implement a ListenerStore which gets its listeners injected instead of requiring to add each listener manually.

This probably should be implemented as extension artifact to not pollute jeve dependencies with any DI frameworks.

Add Event separation

EventProviders should get a generic parameter which denotes the super type of events it is able to dispatch. This would allow compiler checked separation of event categories. E.g. a frontend EventProvider would not be able to fire a back end event and vice versa.

New method for default events

Current 'DefaultTargetEvent' is clumsy to use because of the extra type parameter. Instead, normal events should have a defaultDispatch method which calls a dispatch method on a passed eventprovider

DefaultTargetEvent and EventProvider.dispatch(DefaultTargetEvent) and EventProvider.dispatch(DefaultTargetEvent, ExceptionCallback) will be marked deprecated. Will be removed as of #13

Separate EventProviders and Listeners

The registered listeners should not be a property of the EventProvider itself. Instead, Providers should get a reference to a ListenerStore at which listeners are registered.
This would allow different EventProviders to share a ListenerStore and to customize the delivery of the listeners to the Provider.

Add ChainOfResponsibility listener source

The new ListenerSource abstraction is a great way to build a chain of responsibilty in which listeners participate in a predefined order. This is a more safe way of notifying listeners in a certain order than using a PriorityListenerStore

Add DedicatedThreadEventProvider

That provider should dispatch all Events within a single dedicated thread. As only a single thread is used, this provider could also implement the new prevention mechanism.

EventProvider should not be generic

Adding the generic type of the used listener store to the event provider was a bad design decision. The user of the provider should not care what kind of store it uses. Thus, the generic parameter should be removed entirely again.

Add skip(Class<?> type) to Events

The skip method may register types of classes which should not be notified during the current dispatch action. For example event.skip(UserManager.class) would not notify sub classes of the UserManager

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.