apex-enterprise-patterns / force-di

Generic DI library with support for Apex, Triggers, Visualforce and Lightning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

di_PlatformCache treats "lists of bindings" and a "single binding"

ImJohnMDaniel opened this issue · comments

If there are multiple bindings with the same developerName and SObjectType, the regular di_Binding.loadBindings() works with them as a group. But, when the method calls the di_PlatformCache.addBindingToPlatformCache() method, it places that one binding into the platform cache using the specific key value. If there are more bindings that match the same developerName and SObjectType, the previous binding is replaced with the new one in the platform cache. Essentially, the last binding added to the cache is the one that remains. This leads to erroneous behavior and errors.