Data Container
These container classes server several purposes:
this is where you place validation rules
authorization rules are applied when you try to extract the value in the container
it is possible to add labels and descriptions to containers (can be used by your UI)
it is possible to add tags to containers. This enables authorization rules like 'Top secret facts can only be read by 2-star generals and above'. It also enables queries like 'Show me all info about user X but omit any Personally Identifiable Information (PII)'.
they make it impossible to confuse parameters, e.g. a Username and a Password even though they are both Strings
you can use types that adds meaning to the data. E.g. let's say you have a DistanceMeters : DoubleContainer. Instead of hoping that all parts in the code that accesses its value treats it as meters, you can add a function like fun DistanceMeters.toMeasure(): Measure
= Measure(value, meters) Code that uses this function cannot misinterpret the unit.