Another solution to a complex object mapping written in Scala 3. This project uses an Expression Language Library from Spring SpEL to help with mapping.
Entity mapper strengths:
- Map deeply structured objects.
- Apply mapping from multiple definitions to map complex object.
- Load mapping configuration with custom implementation details
- Apply converters from source to target object.
- Works on domain objects externally.
Entity mapper weaknesses:
- All properties are mapped explicitly, as per configuration only.
- Mapping configuration is one way only. If you need to reverse the mapping, you will need to provide another configuration.
- Data models have to have mutable properties.
case class
are fine as long as they havevar
properties.
- Replace EL dependency with better native solution that is also null-safe. Avoid
@BeanProperty
decorator. - Research if immutable objects can somehow be also mapped per configuration
- Add yaml Configuration option
This is a normal sbt project. You can compile code with sbt compile
, run it with sbt run
, and sbt console
will
start a Scala 3 REPL.
For more information on the sbt-dotty plugin, see the
scala3-example-project.
- Best place to start is with a test MapperSuite
- Source of configuration XML
- Source of configuration YAML incomplete