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 Tue, 15 Apr 2008 08:34:34 GMT

> To me it does not seem right to have that method in the API.

So, you wouldn't have any interface that defines shutdown()? This is
bad because:

- Applications must hardcode a specific class,
- Applications can only be compatible to one specific implementation
(Jackrabbit, or CRX)
- Wrappers (for example JCRLog) are impossible

Repository closing can and should be implementation independent. I
know repository creation is not, and that's already bad enough (I hope
this will be fixed in JCR 2.0).

Let's compare this to the JDBC API (as an example). An application
that uses the JDBC API can look like this:

1) import java.sql.*;
2) Class.forName(jdbcDriverClassName);
3) Connection conn = DriverManager.getConnection(url, user, password);
4) conn.close();

The application does not have to import any database vendor or version
specific classes. The driver, url, user and password are parameters
(strings). When using newer versions of Java, you don't even need line
2 (drivers are discovered automatically).

When using your approach, it would look like this:

1) import java.sql.*;
2) import com.oracle10.*;
3) OracleConnectionImpl conn = OracleConnectionImpl.create(...);
4) conn.close();

If you switch from Oracle to PostgreSQL, you would have to change the
import statement and recompile the application. Maybe even if you
change from Oracle 10 to Oracle 11 (because you are importing classes
in line 2, not just interfaces). Your have to pass a specific class
(OracleConnectionImpl) in your application if you close the connection
somewhere else.


View raw message