Richard Frovarp schrieb:
> Does it make sense to provide a usecase with the
opportunity to do a
> test before the generic tests are ran? Something like
Cut doesn't need
> to call getNodesToLock and go through that mess if a
live version
> exists. If we assume that the site will mostly be live,
this will make
> the site tab much quicker. However, it would appear
that the first call
> is to checkPreconditions, which is final for some
reason and doesn't
> call a method that can be overridden until after
getNodesToLock.
I see what you mean, and it absolutely makes sense. A dirty
workaround
might be to do the check in getNodesToLock() and just return
an empty
array if the check fails.
If we consider the precondition check generally cheaper than
getNodesToLock(), we could change the call order in
AbstractUsecase.checkPreconditions():
doCheckPreconditions();
if (!hasErrors()) {
Node[] nodes = getNodesToLock();
if (!canCheckOut(nodes)) {
addErrorMessage(ERROR_OBJECTS_CHECKED_OUT);
}
}
BTW, checkPreconditions() is final to enforce the template
method
pattern (
http://en.wikipedia.org/wiki/Template_method_pattern).
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe lenya.apache.org
For additional commands, e-mail: dev-help lenya.apache.org
|