View on GitHub

Java Modular Validators

to be used as a utility library in projects to avoid the overhead of writing custom validation frameworks

Download this project as a .zip file Download this project as a tar.gz file

Modular Validators

A lightweight validation framework for the JVM, allowing for internal and external validation logic to be combined in a transparent and reusable way.

Quality Gate Status All Contributors Test report JavaDoc


Goal

The goal of this project is to provide a lightweight rule enforcement and validation framework for Java projects, allowing for internal and external validation logic to be combined in a transparent and reusable way.

It will help avoid the need for writing complex custom validation solutions, by providing developers with pre-built rules and enforcers that can be combined in a modular way. The sections below describe the most common issues with existing (simplistic) validation frameworks, and how this project aims to adress them.

If you are interested in seeing potential use cases for this project, please refer to the ValidationDogfoodTest included in the src/main/test directory of the repository. These tests cases are intended to provide a real-world example of how the different parts of the framework can be used.

Value statement

Problem

The coding of validation logic is generally tedious. While many simple validation frameworks exist to date, most of them suffer from the same design issues:

Proposed solution

Our modular validator solution aims to remedy this, so developers have the option to chose their own style of validation. The aim is to simplify externally driven validation by providing extension points upon which developers can hook in their own api calls. On top of this, the validator objects will behave as monads. This means they will be usable in both the valid and invalid state. This allows to chain logic on top of the validator objects if so required, rather than being forced to write exceptional code paths.

The aim is to make validation of object state a first level concern when designing applicative flows, rather than a side-thought that is often forgotten.

References

Contributing

Thank you for your interest in this repository. If you would like to help out, consider the following:

There are various ways to contribute to this repository. You can help us out by:

If you would like to contribute code, please read the How to Contribute guide included in the repository.

Contributors

Ebenmelu Ifechukwu
Ebenmelu Ifechukwu

👀