[Hippo-cms7-user BETA] Question about org.hippoecm.repository.HippoRepository

Jettro Coenradie jettro at jteam.nl
Mon Jul 21 11:49:29 CEST 2008


Thanks for the answer, this clarifies a lot. I agree that a different  
name would make it easier to understand.

I am not doing a code/peer review by the way :-), just trying to  
understand the product and using it as best as I can. Hope you do not  
mind asking these kind of questions.

thanks, Jettro

On Jul 21, 2008, at 11:44 AM, (Berry) A.W. van Halderen wrote:

> On Mon, Jul 21, 2008 at 08:40:20AM +0200, Jettro Coenradie wrote:
>> I have a small question. Can someone clarify why the choice was made
>> to create org.hippoecm.repository.HippoRepository and not let it
>> extend the jcr repository interface : javax.jcr.Repository.
>
>
> Good point, and yes it could have been a javax.jcr.Repository.
> Until recently I still was undecided upon whether to let  
> HippoRepository
> extend javax.jcr.Repository or not.  Note that HippoRepository has no,
> and should not contain any functional code apart from getRepository()
> which gives you a full javax.jcr.Repository with no limitations.  The
> functions like login() are just convenience, the real login function
> is in the Repostory obtained as from getRepository().
>
>> It seems strange to me, especially if you look at the following lines
>> of code:
>>
>> HippoRepository repository =
>> HippoRepositoryFactory.getHippoRepository("rmi://localhost:1099/
>> hipporepository");
>> Session session = repository.login(new SimpleCredentials("editor",
>> "editor".toCharArray()));
>> Repository standardRepo = session.getRepository();
>> String[] keys = standardRepo.getDescriptorKeys();
>> for (String key : keys) {
>>    System.out.println("repo property key : " + key + ", value : " +
>> standardRepo.getDescriptor(key));
>> }
>
> The following would have been clearer:
>  HippoRepository repositoryConnector
>  repositoryConnector =  
> HippoRepositoryFactory.getHippoRepository(location);
>  javax.jcr.Repository repository =  
> repositoryConnector.getRepository();
>  repository.login(..);
>  repository.getDescriptorKeys();
>
> The HippoRepository is not, or not just, a JCR repository.  It  
> contains
> embedded logic (but unnecessary for the developer user to handle) on  
> how
> to handle connecting to remote repository and we can put in  
> reconnecting
> modules in where if we really need to.
>
> The basic reason for me to keep it as is (apart from clarification  
> through
> perhaps renaming HippoRepository to HippoRepositoryConnector and/or
> the above code change) lies in the reason for connecting to remote
> repositories.
>
> If a repository is remote, it would be nice if the JCR API is  
> available
> through RMI.  This means that the javax.jcr.Repository interface
> should be implemented by a remoteable object.  If this class (meaning
> HippoRepository if it would implement javax.jcr.Repository) is  
> remotable
> then there are all kind of restrictions and all of the methods are
> always accessed remotely.
>
> Rather than doing this you should view the HippoRepository class as
> a connector class, for accessing a JCR repository.  Itself can return
> a connection to a directly RMI exported JCR repository, or a SPI
> based repository, or (heavens forbid) WebDav repository.  All this is
> then hidden because of the combination HippoRepositoryFactory and
> a non-exported HippoRepository class.
>
> Quite technical though, we were not expected to be peer-reviewed
> on code level..
>
>> repo property key : jcr.repository.vendor, value : Apache Software
>> Foundation
>
> Maybe we should change this property, but this is a non-technical  
> decision
> as well.
>
> Greetings,
> \Berry
> -- 
> Berry A.W. van Halderen       b.vanhalderen at onehippo.com / berry at halderen.net
> Disclaimer: the above is the author's personal opinion and is not  
> the opinion
> or policy of his employer or of the little green men that have been  
> following
> him all day.
> _______________________________________________
> Hippo-cms7-user mailing list
> Hippo-cms7-user at lists.hippo.nl
> http://lists.hippo.nl/mailman/listinfo/hippo-cms7-user


groeten Jettro

Jettro Coenradie - jettro at jteam.nl - http://www.jteam.nl - linkedin
Phone: +31(0)20 486 20 36 Fax: +31(0)20 475 08 28 Mobile: +31(0)6 3473  
9912
Frederiksplein 1 - 1017 XK - Amsterdam - The Netherlands

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onehippo.org/pipermail/hippo-cms7-user/attachments/20080721/7d9e3aa9/attachment.htm>


More information about the Hippo-cms7-user mailing list