Simple mapping rules

Mapping rules are defined as usual assignments, but they actually work in both directions.

Mapping affectors/specificators, if exist, should follow the mapping rule they affect. Affectors specifies details of data transferring such as conversions, type hints, using different mapping cases. This will be covered in the rest of the documentation.

Do not forget to define mapping sides, classes to be mapped to each other. Let's start.

  mappingFor a: Person, b: Employee // this defines mapping sides

  a.name = b.name
  a.lastName = b.last

  a.birthDate = b.details.birth // we go deep through the object tree not limited with one level

  a = b.details // propagating the state of a instance to b.details and vice versa

Does Nomin have the ability to use some static value instead of value of a property? Of course!

  a.version = 1
  a.message = "Just some message"

  b.parsingDate = new Date()
  b.mappedBy = "Nomin"

Note that a.version and a.message will be set to the specified values during mapping b instance to a instance. And consequently b.parsingDate and b.mappedBy will be set during mapping a instance to b instance. Parts of mapping rules on the right are calculated only once during parsing a mapping, i.e. b.parsingDate will not be recalculated every time during mapping.