jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Müller" <thomas.muel...@day.com>
Subject Re: remove JackrabbitRepository.shutdown()
Date Mon, 28 Apr 2008 10:25:22 GMT
Hi,

>  But we're diverging from the shutdown() issue.

Yes. I propose create a new public interface
JackrabbitManagedRepository extends Repository {
   void shutdown(JackrabbitSession session);
}

This would have the following advantages:

- Developers can write applications against an interface. Programming
against interfaces is a common best practice. It helps achieve
information hiding, encapsulation, and decouples the application that
is using the module from the module itself. See also the book
"Effective Java", item 16 "Prefer interfaces to abstract classes",
item 34 "Refer to objects by their interfaces", and items 12, 15, and
28. See also design pattern "Abstract factory", "Factory method", and
"Builder".

- Developers can use Javadocs. Also, the autocomplete feature in the
IDE would list relevant methods.

- Access right checking can be implemented where required, improving
security. It is no longer possible to shut down a repository without
privileges.

- It is possible to write applications that work with Jackrabbit and
other implementations (for example Day CRX). Applications don't need
to cast to RepositoryImpl, making them only work for Jackrabbit.

- JCRLog can work. When no interface is used, log files are incomplete
and re-running the log file fails.

RepositoryImpl should implement the new JackrabbitManagedRepository
interface. For security reasons, the current JackrabbitRepository
interface should be deprecated and the current shutdown method should
throw an exception. TransientRepository should be kept.

Regards,
Thomas

Mime
View raw message