ObserverPattern - Basic Java observer API

  •        7

This repository contains a generic definition of the observer pattern for Java. Currently Java only contains the java.util.Observable class that is part since Java 1 and it's functionality and API don't use modern Java languages features and APIs like generics, functional interfaces or Optional. In additional this API will become deprecated in Java 9. Based on this it's quite hard to work with this implementation and mostly all modern Java framework don't use it. Instead custom implementations of the observer pattern can be found in mostly all frameworks. Even in JavaSE you can find custom implementations of the pattern as the JavaFX properties (see javafx.beans.Observable). Based on this distribution it's quite hard to understand the differences of all the implementations and combine several of them in a single project.

https://github.com/guigarage/ObserverPattern


Tags
Implementation
License
Platform

   




Related Projects

RxPY - Reactive Extensions for Python

  •    Python

Reactive Extensions for Python (RxPY) is a set of libraries for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in Python. Using Rx, developers represent asynchronous data streams with Observables, query asynchronous data streams using operators, and parameterize concurrency in data/event streams using Schedulers.Using Rx, you can represent multiple asynchronous data streams (that come from diverse sources, e.g., stock quote, Tweets, computer events, web service requests, etc.), and subscribe to the event stream using the Observer object. The Observable notifies the subscribed Observer instance whenever an event occurs.You can put various transformations in-between the source Observable and the consuming Observer as well.

icaro - Smart and efficient javascript object observer, ideal for batching DOM updates (~1kb)

  •    Javascript

icaro is really fast compared to the other reactive libs because it smartly throttles all the state changes. icaro will let you listen to all the changes happening in a javascript object or array, grouping them efficiently, and optimizing the performance of your listeners.

mobx-react-lite - Lightweight React bindings for MobX based on React 16.8 and Hooks

  •    TypeScript

This is a next iteration of mobx-react coming from introducing React hooks which simplifies a lot of internal workings of this package. Class based components are not supported except using <Observer> directly in class render method. If you want to transition existing projects from classes to hooks (as most of us do), you can use this package alongside the mobx-react just fine. The only conflict point is about the observer HOC. Subscribe to this issue for a proper migration guide.

SignalKit - SignalKit is a reactive Swift framework with focus on clean and readable API.

  •    Swift

SignalKit is a lightweight event and binding framework. The core of SignalKit is the Observable protocol. Each implementation of the Observable protocol defines the type of the observation thus an Observable can sendNext only one type of event. For example an Observable of type String can only sendNext String values. Another key protocol is SignalType which implements Observable and Disposable. Each SignalType implementation has a property disposableSource: Disposable? which points to a Disposable that comes before the current signal.


RxJava - Reactive Extensions for the JVM

  •    Java

RxJava is a Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-based programs by using observable sequences. It extends the observer pattern to support sequences of data/events and adds operators that allow you to compose sequences together declaratively while abstracting away concerns about things like low-level threading, synchronization, thread-safety and concurrent data structures.

Monix - Asynchronous Programming for Scala and Scala.js

  •    Scala

Monix is a high-performance Scala / Scala.js library for composing asynchronous and event-based programs, exposing high-level types, such as observable sequences that are exposed as asynchronous streams, expanding on the observer pattern, strongly inspired by ReactiveX and by Scalaz, but designed from the ground up for back-pressure and made to cleanly interact with Scala’s standard library, compatible out-of-the-box with the Reactive Streams protocol.

RxSwift - Reactive Programming in Swift

  •    Swift

Rx is a generic abstraction of computation expressed through Observable<Element> interface.This is a Swift version of Rx.

Fluent State Observer

  •    

The Fluent State Observer helps perform actions based on a pattern in an IObservable "stream". This library is developed in C# and uses the Rx (Reactive) Framework for it's implementation of the IObservable pattern and helper extensions.

RxLifecycle - Bind observables to the lifecycle of Activity or Fragment in a non-invasive way.

  •    Java

This library will actually unsubscribe the sequence (See here). It means that the downstream observer will not receive onComplete(), onError()... anymore when the unsubscription occurs. This library doesn't require you to inherit any activity or fragment. It will insert a non-gui fragment to your activity or fragment to listen the lifecycle events.

yall.js - A fast, flexible, and small image lazy loader!

  •    Javascript

yall.js is a featured-packed lazy loading script for <img>, <picture>, <video> and <iframe> elements. It works in all modern browsers including IE11. It uses Intersection Observer where available, but falls back to scroll, touchmove, resize, and orientationchange events where necessary. It can also monitor the DOM for changes using Mutation Observer to lazy load image elements that have been appended to the DOM after initial page render, which may be desirable for single page applications. It can also (optionally) optimize use of browser idle time using requestIdleCallback. To optimize decoding of <img> lazy loading for simple src and srcset use cases, yall.js uses Image.decode where available to decode images asynchronously before adding them to the DOM.

on-change - Watch an object or array for changes

  •    Javascript

It works recursively, so it will even detect if you modify a deep property like obj.a.b[0].c = true.Uses the Proxy API.

rxviz - Rx Visualizer - Animated playground for Rx Observables

  •    Javascript

RxViz simply visualizes a given Observable. Your JavaScript code will be evaluated, and, if the last expression is an Observable, a nice animated visualization will appear. RxViz treats the evaluated Observable as a black box. We rely only on the fact that Observable emits values over time. RxViz doesn't rely on the internals of RxJS. This will allow us to visualize TC39 Observables in the future.

Cortex - Powerful Observable Analysis Engine

  •    Scala

Cortex, an open source and free software, has been created by TheHive Project for this very purpose. Observables, such as IP and email addresses, URLs, domain names, files or hashes, can be analyzed one by one or in bulk mode using a Web interface. Analysts can also automate these operations thanks to the Cortex REST API. By using Cortex, you won't need to rewrite the wheel every time you'd like to use a service or a tool to analyze an observable and help you investigate the case at hand. Leverage one of the several analyzers it contains and if you are missing a tool or a service, create a suitable program easily and make it available for the whole team (or better, for the whole community) thanks to Cortex.

react-simple-img - 🌅 React lazy load images with IntersectionObserver API and Priority Hints

  •    Javascript

Image component working similar with standard img tag and with the following props. This function is only required, when you want to customise intersection observer configuration.

rails-observers - Rails observer (removed from core in Rails 4.0)

  •    Ruby

This Observer sends an email when a Comment#save is finished.This Observer uses logger to log when specific callbacks are triggered.

libGPS4j2me

  •    Java

A Java Framework for connecting to and exchanging data from GPS units to J2ME Mobile Devices. Serial and Bluetooth connections to GPS devices. Support for NMEA-0183 GPS Standard. An Observer-Design Pattern makes the library extendable. Based on GPSlib4j.

emittery - Simple and modern async event emitter

  •    Javascript

It's only ~200 bytes minified and gzipped. I'm not fanatic about keeping the size at this level though.Emitting events asynchronously is important for production code where you want the least amount of synchronous operations.

rxjs-spy - A debugging library for RxJS

  •    TypeScript

rxjs-spy is a debugging library for RxJS. The usual approach to debugging RxJS-based code involves sprinkling do operators and logging throughout composed observables. That's something that I find tedious, so I wrote this library and implemented an unobtrusive mechanism for identifying observables and logging and inspecting observable subscriptions.

RxJs Marbles- Interactive diagrams of Rx Observables

  •    Javascript

A webapp for experimenting with diagrams of Rx Observables, for learning purposes. This is a Cycle.js app. It helps to visualize example diagrams for each operator in Rx. Drag an item ("marble") on an Observable to see how the operator reacts.





We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.