structible

Standardize and ease conversions between different, environment-based representations of the same type.

Motivation

Applications nowadays typically integrate with a variety of environments (and thus their type systems) such as messaging formats, configuration (files) or databases.

While these environments usually support common types (e.g. primitive types, regular classes) out of the box, support for more refined types (e.g. timestamps or domain specific value classes) varies greatly or is lacking completely.

As a consequence, you end up writing lots of one-to-one integration code mapping between the two.

Overview

Structible addresses this issue in two steps:

1)
By way of its core library providing three type classes to standardize the aforementioned conversion:

  • Constructible: common type -> refined type (think read)
  • Destructible: refined type -> common type (think write)
  • Structible: Combination of Constructible and Destructible

2)
By way of a variety of satellite libraries each providing one liners to create the conversion(s) for a specific environment (usually type classes as well).

The source code for this page can be found here.