Hi Sebastian,
the principle followed is that of loose coupling, as expressed by the
Law of Demeter:
http://en.wikipedia.org/wiki/Law_of_Demeter
This means that if a class, e.g. MarkUnmatchedStepsAsPending, depends on
two collaborators such as Keywords and StepFinder, it should depend on
these, and only on these, not on the more generic Configuration.
To ensure the uniqueness of the instances we could have only one
constructor, but this is sometimes impractical. There is a trade-off
between loose coupling and potential duplicate instances of
collaborators when using default constructors.
We can improve the default wiring up of the dependencies via the
Configuration to avoid or minimise duplicate instances.
Cheers
On 12/06/2013 21:10, Sebastian Sickelmann wrote:
Hi,
is there any use case where it is usefull to have different keywords
inside the CandidateSteps-Instances and the StepCollector
MarkUnmatchedStepsAsPending.
If there is no use-case for this. Can we change the implementation of
MarkUnmatchedStepsAsPending as follows?
https://github.com/picpromusic/jbehave-core/compare/master...keywordCheckCandidates
Also it seems that the keywords in MarkUnmatchedStepsAsPending are
always a new Instance of LocalizedKeywords and not the configured one
in the Configuration-Instance. I tried to change too. Maybe there are
other Classes that should get the same refactoring with
InitializableByConfiguration.
Kind regards
Sebastian
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email