This is similar to WIREBOX-46, but instead of overriding the ENTIRE creation process of the object like a provider does, the user might want to simply influence the creation of a "normal" mapping with some additional flair.
In this instance, the instance is already built and then passed into the closure for additional influence. Note, the object is returned from the closure. Make this optional, but if something IS returned, it will override the instance which will allow a developer to replace or decorate the instance as they see fit.
Any feedback on this? Note, this is technically possible with a closure-based provider but I thought it might be nice instead of having to override the entire creation, to just be able to influence an existing mapping. If you liked this, I could do it along with the other 2 WireBox tickets I knocked out today.
So this is similar to the influence closure in the mapDirectory methods. However, this is not for configuraiton but run-time usage. Meaning that we store the influence closure much like the AOP on creation listener. Is that accurate?
I believe that's correct. I envisioned the closure being stored in the mapping object, and after the mapping instance was built, something like this would run:
ok, sounds good, go for it, just make sure you add the appropriate tests for it.
Thanks
https://github.com/ColdBox/coldbox-platform/pull/229
I also added in a test for being able to specify a provider as a closure since it was broken recently and fixed in another ticket.