Dataflow is a Kotlin™/JVM library that combines reactive programing, functional programming and the observer pattern to simplify the presentation of data in your program. Let the programmers focus on the logic of the application while we do the hard work.
The main advantages of using this library are:
- Always consistent state between UI and data
- Single point of truth: think only about the main source of data and let the library manage the rest
- Express in a few lines of code data transformations that will usually require hundred
It aims to be as simple as possible, while being fully featured and highly efficient. In particular:
- Thread safe
- Automatic lifecycle handling, to avoid memory leaks
- Lazy by default
- Automatically detects and avoids useless computations
- Atomic changes
Dataflow has several extensions that provide more features. For example, the async extension, provides the following features:
- Automatically moves most of the work on background threads
- Associate a state with data (loading, error, etc.)
- Performance optimizations on collections
The main reasons for the choice of Kotlin™ as the main language for this library are:
- Becoming the new standard: Kotlin™ is quickly eroding market-share from Java™. Even Google™ in its latest I/O 2019 said that it's going to adopt a kotlin-first mentality for the Android™ platform.
- Open-source: the language is open-source and supported by the Kotlin™ foundation, in which Google™ and JetBrains™ actively take part.
- Conciseness: one of the main advantages of using Kotlin™ is the fact that the language is a lot more concise then Java™, making writing code a more pleasant and elegant task. You'll see for yourself in the examples how much redundant code is needed in Java™ and how much compact Kotlin is, while maintaining a high degree of legibility.
- More advanced features: when it comes to new cool features, Java™ really falls behind. Operators overload, infix notation, extension functions, generics variance, data classes, internal visibility modifier, distinction between read-only and mutable collections, sealed classes and singleton support are only some of the features that make life easier and allow to construct more powerful apps and libraries.
- Less baggage: being a newer language, Kotlin™ doesn't suffer from old decisions that have been proven being problematic. Two striking examples are null-safe types and checked exception: the absence of the first and the presence of the latter complicate things in Java™.
- Based on JVM: while Java™ is becoming older and older, the JVM has always shined. It allows programs to run on all different kinds of hardware, can perform a lot run-time optimization that simply couldn't be done by compiled languages and offers robust and well-tested APIs.
- Java™ retrocompatibility: by being completely retrocompatible with Java™, you can start developing in Kotlin™ right away without ever changing a single line of old Java™ code. Also, you can take advantage of the immense number of Java™ libraries written all over the world.
Get started now!link
Go to the setup page to start learning how to use Dataflow!