jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller" <thomas.tom.muel...@gmail.com>
Subject Re: remove JackrabbitRepository.shutdown()
Date Wed, 16 Apr 2008 08:24:28 GMT

A) I think that when using libraries, programming against interfaces
is better than programming against fixed implementation classes.

B) The "security" argument is invalid. Isn't it strange to remove the
interface JackrabbitRepository because "shutdown" is "not save", but a
Model 1 application has to call "shutdown" to close the repository?
How is it "saver" to call a method in a class versus calling a method
in an interface? A good way to make it safer is by changing shutdown
to shutdown(Session), by adding shutdownRepository to
JackrabbitSession, or by adding a new JackrabbitRepositoryManagement
interface. But not by removing the interface.

C) How about Javadocs? The JackrabbitRepository interface is removed,
but applications must call shutdown() in Model 1. Shutdown must be
called but is not in the Javadocs? Or in the RepositoryImpl Javadocs
mixed with the other public methods (loggedOut, onEvent,...) that the
user shouldn't call?

D) How about other implementations (RMI, CRX)? If there is no
interface, things will get complicated. If there is no interface, an
application needs to have three ways to shutdown a repository.
Wouldn't it be cool to only have one way?

E) And again, JCRLog is impossible.

>  In model 1 you're embedding the repository and thus you'd have a
>  direct dependency to jackrabbit-core and use RepositoryImpl.create()
>  to start the repository up.

Yes, that's already bad enough. In JSR 283 repository construction
will hopefully be standardized. But there are solutions even without
JCR 283, for example using using Spring or Google Guice. From the
Google Guice home page: "Guice alleviates the need for factories and
the use of new in your Java code... You will still need to write
factories in some cases, but your code will not depend directly on
them. Your code will be easier to change...". Those tools are made for
exactly this use case. Specially for components that don't have a
standard way to create objects (unlike JDBC, and components that have
a service provider interface). I have never used Spring or Guice, do
you know if they support "customizable shutdown mechanisms"?

> Using RepositoryImpl.shutdown() to shut it
> down doesn't make things any more complicated.

Sorry, I don't follow this logic. Because there is a problem at one
place, we don't need to care in another place?


View raw message