CadixDev / Bombe

A model of Java types, as per the JVMS specification.
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Bombe 0.3.5 #15

Closed jamierocks closed 3 years ago

jamierocks commented 3 years ago

Okay, so the one thing I would like to address before proceeding:

https://github.com/CadixDev/Bombe/pull/15/files#diff-995d81d6d06293de71a11e7dbc351c6804f95536cf7eeda7b17583acfa919852R103

Should the additions from a transformer be processed by the remaining transformers?

For example:


classes: [a, b, c]
transformers:
  - ta (processes [a, b, c])
    - removes: [b] (by returning null)
  - tb (processes [a, c])
     - additions: [d]
  - tc (processes [a, c, d])
LexManos commented 3 years ago

I would be of the opinion, that no considering we the consumer would typically control the full stack of transformers trying to introduce this would just run down the rabbit hole of transformer ordering/recursion/pain. The use case I have is adding a extra metadata resource object gathered from running the full processor. It has no use for being re-transformed.

However, if you DO decide to go down this route. You'd probably be better off with adding a secondary 'offer' additions thing. Where it gets appended to the things that need processing. And gets run through the full transformer stack. In your example above, ta/tb/tc would all process d Going down this rabbit hole some more. tb/tc should also process b, but be notified that it was nulled out by a previous processor.

Again, this opens up a lot of weird cases where you can short circuit them all by just saying no from the get go. Leaving it up to someone else to request with a specific use case as to why they need it.