You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@sandglass-software.com> on 2014/08/30 16:00:33 UTC

Removing ThreadLocal variables from GenericDelegator

Based on a previous discussion, I started work on removing the 
ThreadLocal variables from the GenericDelegator class.

It appears they were added to support the entity audit feature. The 
problem is, their existence forces framework code to reference the 
GenericDelegator concrete class instead of the Delegator interface.

The bottom line is, we have a Delegator interface and a Delegator 
factory to facilitate "plugging-in" custom Delegator implementations, 
but all of that is useless because of the framework's GenericDelegator 
references.

It will take some work to unravel the concrete class dependency.

One problem area is in the Service Engine. It would be helpful to change 
the DispatchContext concrete class to an interface - but I don't want to 
do that without feedback from the community. Please let me know if there 
are any strong objections.

At the same time, that interface could be extended to supply certain 
artifacts that are retrieved from other areas - like the current locale, 
time zone, and user identifier. This follows along with a suggestion 
David Jones made a while back about replacing the DispatchContext with 
an Execution Context. So, we have an opportunity to evolve the framework 
in the way he envisioned.


-- 
Adrian Crum
Sandglass Software
www.sandglass-software.com