This is a new implementation of the setup/configure/finalize code which drastically simplifies internals and makes it possible to easily extend ROM with more component types. This could be simplified further but a prerequisite is to simplify command compiler first, which I'll most likely do in a separate PR.
This is meant to be backward compatible, I'll test it out with other adapters and apps to ensure things work.
Here's a simple example of how things work internally now:
This is a gigantic improvement because it demystifies how rom loads its components and isolates component-specific setup/build code in dedicated component classes. It opens up doors to a lot of interesting features that we'll be able to add later. ie using different configurations for the same component, providing pre-configured components from "the outside" (ie a bunch of preconfigured relations provided by a gem) and so on, lots of possibilities.
A quick follow-up after this is merged will be adding Components::Struct and Components::Repository - making them 1st-class core components that are easy to set up and use.
I will also make ROM's container 100% compatible with dry-system/hanami2 so that things like my_container.import(persistence: rom_container) will work OOTB.
This is a new implementation of the setup/configure/finalize code which drastically simplifies internals and makes it possible to easily extend ROM with more component types. This could be simplified further but a prerequisite is to simplify command compiler first, which I'll most likely do in a separate PR.
This is meant to be backward compatible, I'll test it out with other adapters and apps to ensure things work.
Here's a simple example of how things work internally now:
This is a gigantic improvement because it demystifies how rom loads its components and isolates component-specific setup/build code in dedicated component classes. It opens up doors to a lot of interesting features that we'll be able to add later. ie using different configurations for the same component, providing pre-configured components from "the outside" (ie a bunch of preconfigured relations provided by a gem) and so on, lots of possibilities.
A quick follow-up after this is merged will be adding
Components::Struct
andComponents::Repository
- making them 1st-class core components that are easy to set up and use.I will also make ROM's container 100% compatible with dry-system/hanami2 so that things like
my_container.import(persistence: rom_container)
will work OOTB.Refs #607