Hi,

One question:
If the interface "User" hasn't a method to get the user's password, How can I add to 
my repository a new user with the correct password ? The interface UsersRepository has 
the method: "boolean addUser(User user)", the only reference to the user's data is an 
interface "User".

In other implementations of UserRepository, it is done a cast to "DefaultUser" to use 
the method "getHashedPassword()"

For example in 
org.apache.james.userrepository.DefaultUsersJdbcRepository#setUserForInsertStatement(User
 user, ...)
        DefaultUser defUser = (DefaultUser)user;
  ...
        userInsert.setString(3, defUser.getHashedPassword());
        
What do you think about to include the method "getHashedPassword()" in "User" 
interface ? 
Is it correct to do a cast to a class from an interface ? I think this generate a 
dependency between RemoteManager and Users Repositories then the interface 
"UserRepository" itsn't sufficient to determine the "contract" for the Users 
repository implementation. Is that correct ?

Roberto.

Reply via email to