jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Refactoring of the backupTool
Date Sat, 02 Sep 2006 15:55:36 GMT
Hi,

On 8/31/06, Nicolas <ntoper@gmail.com> wrote:
> - RestoreBatchedItemOperations extends BatchedItemOperations. This class is
> made to restore empty workspaces. I overload only one method:
> createNodeState to escape the checks.

How about refactoring the original BatchedItemOperations class to a
base class that doesn't do any of the checks (or has just empty
placeholder methods for the checks) and a subclass that contains the
checks. Or even better, refactor the checks to a separate Checker
class to use composition instead of inheritance for the functinality.
This way there wouldn't be a need to override and duplicate existing
functionality in a subclass as you could achieve the goal simply by
using the base class or a different composition.

> - SysViewImporter: takes a system view XML document and import it as it is
> in an empty repository. It is heavily based on the WorkspaceImporter but
> doesn't extend it (I would have to put too many methods in protected for
> this; tell me if you would be ok with this change though).

I think it would make sense in here as well to refactor the
WorkspaceImporter class instead of duplicating the code in a separate
class.

> - NodeVersionHistoriesUpdatableStateManager: is made to update easily the
> Node Version Histories.

This seems a bit overkill for just the version import. Could the
importer be refactored so that it could work with a smaller interface
than the full UpdatableStateManager?

> - Switched RepositoryImpl.getVersionManager to public instead of private.

I'm a bit concerned about this, the version manager should be private
to the repository. I'd rather see something like a more focused
WorkspaceImpl.getVersionHistoryImporter() method that only works when
you have administrator access.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Mime
View raw message