Adrian Crum wrote: > I understand what you're suggesting. But if the intention is to replace > > GenericDelegator delegator = GenericDelegator.getDelegator(delegatorName); > > with > > Delegator delegator = (Delegator) > UtilObject.getObjectFromFactory(DelegatorFactory.class, delegatorName); > > then the Delegator interface will need to support the same methods as > GenericDelegator.
Nope. Leave GenericDelegator.getDelegator, which returns GenericDelegator. This way, all existing code continues to work, no changes at all. Then, existing scripts can be modified one at a time. Base helper methods should be modified first, so that they take a Delegator instead of a GenericDelegator. This will just require a recompile(as calling code will still be using a GenericDelegator, which implements Delegator). Basically, find all methods that have an incoming GenericDelegator object, but do *not* forward it on to any other method(be careful about services that call out). Modify those methods first. Then move slowly up the chain.
