Object Update Trigger - #40
Conversation
…work Concrete Classes and Descendent Subs
cliffcaseyyet
left a comment
There was a problem hiding this comment.
Very cool, I understand this iteration better than the ones before it. Most of my stuff is organizational or minor but what it's actually doing makes sense.
| if (injectionContext instanceof TestInjectionContext) { | ||
| return handler.handleLookup(null, target, injectionContext); | ||
| if (injectionContext instanceof TestInjectionContext testContext) { | ||
| return handler.handleLookup(alias, definitions.get(alias), target, testContext); |
There was a problem hiding this comment.
i'm having trouble figuring out what this is doing, perhaps i didn't understand what it was doing before either and why it needs to be different from the non-validation runs.
There was a problem hiding this comment.
I did catch up to this in another comment but i'll leave it here until that one is figured out.
There was a problem hiding this comment.
We don't want to start up the cache when doing test injection is all! This is a bypass.
| return objectCache.findValueResolution(object, attrTarget); | ||
| } | ||
|
|
||
| public ValueResolution handleLookup( |
There was a problem hiding this comment.
ah ok i think i get it now per my other question. It cannot pass a CachedObject as the others do beacuse it doesn't have one.
I think part of why this is weird is that it's chosen to already resolve the cachedobject outside the injection handler instead of having the injectionhandler do that work on receiving the details of an injection. Might be worth considering a refactor there, but perhaps there is another structural reason it needs to be done before the injection is being handled?
canonical object and interaction hierarchy extraction
Trigger statement emission from object updates
ObjectCreate,ObjectUpdateandObjectDeleteObjectCreateis fired at most once when an object is created, upon the first reflection of requested attributesObjectUpdateis fired on every update (including the first reflection).previousexpression is now available inObjectUpdateto refer to the previous state of the object. This can be used to implement change detection.ObjectDeleteis fired at most once when an object is deleted.triggerexpression inObjectDeletecan access a snapshot of the object's attributes prior to deletion.