On Sun, Aug 31, 2008 at 2:24 PM, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
> Robert Burrell Donkin ha scritto:
>>
>> i think that it should be possible to remove the singletons by two
>> independent refactorings:
>>
>>  * Separating configuration concerns using the factory pattern
>
> Do you mean having a factory to generate all of the services needed by a
> script parsing process and then have services injected or injecting service
> factories to each component?

IMHO JSieve is best understood as a single component with no service
dependencies

AIUI ATM there's really only way to configure JSieve. the information
required is loaded from 3 property files containing the classnames of
tests, comparators and command bindings. this configuration is pure
assembly, no services are required.

>>  * Separating state concerns using a context
>
> We already use "Context" for SieveContext that is a script level context.
> Maybe "Session" is a better term for a script execution context.

context is the term i've seen commonly used for this pattern (for
example, in xml binding) but i agree that session would convey the
appropriate meaning. SieveContext is really a session.

> Maybe both ConditionManager and CommandStateManager "states" can be moved to
> a simple SieveSession (or simply Session) object and the SieveSession could
> even expose generic set/get properties to allow simpler extensibility (new
> commands would not depend on improvements in the core session object).

(this pattern is one i favour so i'm may probably biased but) yes

>> opinions welcomed
>>
>> unless anyone jumps in soon, i'll take a shot at committing a first
>> draft sometime soon. a postumous review phase will probably be needed.
>
> ATM it is almost impossible to make a dependency graph for jsieve because
> components are too much interconnected and there are too many cycles between
> packages and classes.
>
> E.g: IMHO there is no clean separation between parsing and running scripts.
> I hope to be able to do some reorganization of the code/packages once you
> will have refactored it.

+1

once the singletons are gone, there's probably more work needed
factoring into independent parser and execution units. ATM it is
necessary to repeatedly parse scripts even when the documents haven't
changed. probably need to think about separating concerns. probably
need something more like:

configurator --creates--> factory --creates--> parser --creates --> executor

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to