On Sep 8, 2009, at 1:36 PM, Adrian Crum wrote:
Adam Heath wrote:David E Jones wrote:Sure, understand all that. But this broke ABI. And I understand thatOn Sep 8, 2009, at 11:58 AM, Adam Heath wrote:Adrian Crum wrote:Why? We already had DelegatorInterface, that has existed for years;Adam Heath wrote:I don't have a problem with reverting it, but GenericDelegator willAdrian Crum wrote:Adam Heath wrote:[email protected] wrote:Author: adrianc Date: Sun Aug 9 18:04:26 2009 New Revision: 802567 URL: http://svn.apache.org/viewvc?rev=802567&view=rev Log: Refactored GenericDelegator: 1. Converted GenericDelegator to an interface. We already have DelegatorInterface, but it isn't being used anywhere. Removed DelegatorInterface.java. 2. Extracted the static, cached data from the GenericDelegatorimplementation and put it in its own class - DelegatorData. TheGenericDelegator implementation holds a reference to theDelegatorData instance. This makes it possible to have per- threadinstances of GenericDelegator. 3. Replaced the ThreadLocal variables with regular variables.ThreadLocal variables are no longer needed. Client code doesn't need to be concerned with pushing and popping the GenericDelegator state.This commit paves the way for the forthcoming ExecutionContext.User modifications will have to replace GenericDelegator.getGenericDelegator(...) withDelegatorFactory.getGenericDelegator(...). Also, replace the pushcode with the new setXxx methods, and remove the pop code. If modifications used DelegatorInterface, replace that with GenericDelegator. Aside from those changes, this commit is backwards compatible.No, it is not backwards compatible.When a java class is compiled, the bytecode requests an interface named 'foo', or a class named 'foo'. If 'foo' changes from class tointerface, then pre-compiled classes will *not* load. Please, change GenericDelegator back to a class.If DelegatorInterface wasn't used, and was just not uptodate with the method signatures, wouldn't the simpler thing have been to improve DelegatorInterface, then to change the class itself? It seems morework to change the class to an interface. I have external code(webslinger) that needs to support multipleversions of ofbiz(one all the way back to 512946). This change makesthat impossible. I have to have multiple versions of ofbizinstalled(pre/post this change), and compile the class once for eachofbiz version.Which is easier: rewrite all your Webslinger code to referenceDelegatorInterface instead of GenericDelegator, or just recompile yourexisting code without making any changes?That's just it, I wouldn't have to recompile *at all*, if GenericDelegator stayed a class. Nor would anyone else.become an interface eventually. If you take a look at David's ExecutionContext branch, that is what he has planned.it was just never fleshed out.There was a lot of discussion about this in the context of thereasons/goals behind the executioncontext branch(es). The basic idea is to move the framework to be accessible through a set of interfaces thatare in a single place, a low-level component that other framework components will depend on, and then all code will use the frameworkthrough the interfaces instead of going directly to classes (which willjust be internal implementations of the framework interfaces and not generally used directly).For the rationale behind this, please see the write up I sent to this mailing list a few weeks ago about the ExecutionContext and related stuff.such a set of changes will *have* to break ABI. If this change is to support the ExecutionContext branch, then it should stay in that branch, 'til it is ready.David and I are in agreement on the end result, and this point is where we disagree. Like you, David wants all changes to be made in the branch. I don't think a branch is needed. The interface extractions can be done a little at a time in the trunk.A branch with the kind of extensive changes that are planned will open up a HUGE can of worms when it is merged with the trunk. Consider that this one interface extraction resulted in three bug reports - what would happen if we introduced dozens of interface extractions in a single commit?Anyways, I don't mind reverting it. I'm just making the point that you will have to resolve these issues at some time in the future.
I have to admit that keeping everything outside and then merging things back is HUGE risk without proper unit tests on everything that it will touch. In this case - that would be everything in the system. I would rather it be incremental once the plan is laid down rather than hitting all at once.
-Adrian
smime.p7s
Description: S/MIME cryptographic signature
