robert burrell donkin wrote: > > > i've managed to pass positional information through from the parser to > the Command and Test objects. my implementation uses ScriptCoordinate > objects which contain details of line and column numbers. when a > problem occurs during the evaluation of Command and Test > implementations, this object is used to construct SyntaxException > instances with positional information. > > it was necessary to add ScriptCoordinate to ExecutableCommand#execute > and ExecutableTest#execute as well as to objects in the inheritance > hierarchy (AbstractCommand, AbstractTest and so on). > > this means breaking backwards compatibility > > it also means that altering the current pure, clean API design in a > pragmatic (but inelegant) fashion. probably the original APIs are > superior and quite possibly once we start down this route, more > pragmatic changes will be needed later. > > so, i've prepared a patch so that people can take a look before i > commit: https://issues.apache.org/jira/browse/JAMES-780. > > opinions? > > - robert
Hi Robert Perhaps I've missed something scanning the patch (I don't have time to apply it right now), but what you have done seems entirely reasonable and not at all inelegant. The key thing is that the original API did not allow the passing of any context information and you have fixed this, which is great. Maybe if I had been making these changes, having realised that we need to pass contextual information around, I might have amended the api slightly differently and added an extra level of indirection. I might have added a context class which contains your ScriptCoordinate and passed this around. In the future, we might find a need to add other contextual information. We could add this without further reworking of the main API by specializing this context class. In this way we could add functionality without breaking code relying on less specialized versions. Anyway, your changes are cool stuff! Cheers -- Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
