You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@depot.apache.org by "Adam R. B. Jack" <aj...@trysybase.com> on 2004/07/20 16:28:02 UTC

Wrappers & Context

We have an updater 'context' (which holds things like the protocol provider,
and 'base directory', and such. Later it might have some user credentials.)

http://svn.apache.org/repos/asf/incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/ArtifactUpdaterContext.java

This context is important when doing work, in the main 'cos repo work can't
be done w/o it.

A Repository is (to use a non-Java term) a 'abstract' thing (i.e.a
repository out of context). Combined with the (user) context it can do work.
I create a RepositoryWrapper to combine the two (and do a few 'above of the
interface checks' such as checking if a repository has a capability before
calling it to do something.) This RepositoryWrapper seemed to be a nice
useful helper, it combined some things.


http://svn.apache.org/repos/asf/incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositoryWrapper.java

With RepositorySets we have N Repositories. I created RepositorySetWrapper
(a better name might be RepositoryWrapperSet) that constructs wrappers for a
while set of repositories.

http://svn.apache.org/repos/asf/incubator/depot/trunk/update/src/java/org/apache/depot/update/impl/RepositorySetWrapper.java

When we provide a query we can specify a RepositorySet. For us to use it we
need to convert it to a RepositorySetWrapper. This gets tedious, unless we
cache some of these things. I don't want the user to know about these
wrappers, they have to be hidden.

Something tells me something is wrong, something is out of control. Any
thoughts (i.e. 'I've seen that mistake before and ...' come to mind?)

Thanks in advance for any help.

regards

Adam
--
Experience the Unwired Enterprise:
http://www.sybase.com/unwiredenterprise
Try Sybase: http://www.try.sybase.com